21#ifndef __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_BOARD_H
22#define __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_BOARD_H
28#include <nuttx/config.h>
30#include <sys/boardctl.h>
32#include <arch/chip/pin.h>
34#include "board_lcdpins.h"
36#include "cxd56_clock.h"
37#include "cxd56_power.h"
38#include "cxd56_flash.h"
39#include "cxd56_gauge.h"
40#include "cxd56_charger.h"
41#include "cxd56_gs2200m.h"
42#include "cxd56_nrc7292.h"
43#include "cxd56_wiznet.h"
44#include "cxd56_i2cdev.h"
45#include "cxd56_spidev.h"
46#include "cxd56_sdcard.h"
47#include "cxd56_automount.h"
51#include "cxd56_audio.h"
52#include "cxd56_alt1250.h"
53#include "cxd56_ak09912.h"
54#include "cxd56_apds9930.h"
55#include "cxd56_apds9960.h"
56#include "cxd56_bcm20706.h"
57#include "cxd56_bh1721fvc.h"
58#include "cxd56_bh1745nuc.h"
59#include "cxd56_bm1383glv.h"
60#include "cxd56_bm1422gmv.h"
61#include "cxd56_bmi160.h"
62#include "cxd56_bmi270.h"
63#include "cxd56_bmp280.h"
64#include "cxd56_emmcdev.h"
65#include "cxd56_spisd.h"
66#include "cxd56_kx022.h"
67#include "cxd56_lt1pa01.h"
68#include "cxd56_rpr0521rs.h"
69#include "cxd56_scd41.h"
70#include "cxd56_sensors.h"
71#include "cxd56_gnss_addon.h"
72#include "cxd56_cxd5602pwbimu.h"
74#ifdef CONFIG_VIDEO_ISX012
75# include "cxd56_isx012.h"
77#ifdef CONFIG_VIDEO_ISX019
78# include "cxd56_isx019.h"
87#ifdef CONFIG_CXD56_80MHz
88# define BOARD_FCLKOUT_FREQUENCY (80000000)
90# define BOARD_FCLKOUT_FREQUENCY (100000000)
97#define BOARD_UART0_BASEFREQ CONFIG_CXD56_XOSC_CLOCK
98#define BOARD_UART1_BASEFREQ BOARD_FCLKOUT_FREQUENCY
99#define BOARD_UART2_BASEFREQ CONFIG_CXD56_XOSC_CLOCK
103#define GPIO_LED1 (PIN_I2S1_BCK)
104#define GPIO_LED2 (PIN_I2S1_LRCK)
105#define GPIO_LED3 (PIN_I2S1_DATA_IN)
106#define GPIO_LED4 (PIN_I2S1_DATA_OUT)
108#define BOARD_LED1 (0)
109#define BOARD_LED2 (1)
110#define BOARD_LED3 (2)
111#define BOARD_LED4 (3)
112#define BOARD_NLEDS (4)
116#define BOARD_LED1_BIT (1 << BOARD_LED1)
117#define BOARD_LED2_BIT (1 << BOARD_LED2)
118#define BOARD_LED3_BIT (1 << BOARD_LED3)
119#define BOARD_LED4_BIT (1 << BOARD_LED4)
123#define LED_STARTED (BOARD_LED1_BIT)
124#define LED_HEAPALLOCATE (BOARD_LED2_BIT)
125#define LED_IRQSENABLED (BOARD_LED1_BIT | BOARD_LED2_BIT)
126#define LED_STACKCREATED (BOARD_LED3_BIT)
127#define LED_INIRQ (BOARD_LED1_BIT | BOARD_LED3_BIT)
128#define LED_SIGNAL (BOARD_LED2_BIT | BOARD_LED3_BIT)
129#define LED_ASSERTION (BOARD_LED1_BIT | BOARD_LED2_BIT | BOARD_LED3_BIT)
130#define LED_PANIC (BOARD_LED4_BIT)
132#ifdef CONFIG_ARCH_LEDS_CPU_ACTIVITY
137#define LED_CPU0 (100)
138#define LED_CPU1 (101)
139#define LED_CPU2 (102)
140#define LED_CPU3 (103)
141#define LED_CPU (LED_CPU0 + up_cpu_index())
146#define BOARD_NUM_BUTTONS (2)
172#define PMIC_TYPE_LSW (1u << 8)
173#define PMIC_TYPE_GPO (1u << 9)
174#define PMIC_TYPE_DDCLDO (1u << 10)
175#define CHIP_TYPE_GPIO (1u << 11)
176#define PMIC_GET_TYPE(v) ((v) & 0xff00)
177#define PMIC_GET_CH(v) ((v) & 0x00ff)
178#define PMIC_LSW(n) (PMIC_TYPE_LSW | (1u << (n)))
179#define PMIC_GPO(n) (PMIC_TYPE_GPO | (1u << (n)))
180#define PMIC_DDCLDO(n) (PMIC_TYPE_DDCLDO | (1u << (n)))
181#define CHIP_GPIO(n) (CHIP_TYPE_GPIO | (n))
183enum board_power_device
187 POWER_DDC_IO = PMIC_DDCLDO(0),
188 POWER_LDO_EMMC = PMIC_DDCLDO(1),
189 POWER_DDC_ANA = PMIC_DDCLDO(2),
190 POWER_LDO_ANA = PMIC_DDCLDO(3),
191 POWER_DDC_CORE = PMIC_DDCLDO(4),
192 POWER_LDO_PERI = PMIC_DDCLDO(5),
196 POWER_AUDIO_DVDD = PMIC_LSW(2),
197 POWER_FLASH = PMIC_LSW(3),
198 POWER_TCXO = PMIC_LSW(4),
199 POWER_LNA = PMIC_LSW(4),
203 POWER_AUDIO_AVDD = PMIC_GPO(1),
204 POWER_AUDIO_MUTE = PMIC_GPO(6),
205 POWER_IMAGE_SENSOR = PMIC_GPO(4),
207#if defined(CONFIG_CXD56_BLE1507_RESET_PIN_I2S0_DATA_IN)
208 POWER_BTBLE = CHIP_GPIO(PIN_I2S0_DATA_IN),
209#elif defined(CONFIG_CXD56_BLE1507_RESET_PIN_EMMC_DATA2)
210 POWER_BTBLE = CHIP_GPIO(PIN_EMMC_DATA2),
212 POWER_BTBLE = PMIC_NONE,
214 POWER_SENSOR = PMIC_NONE,
215#if defined(CONFIG_CXD56_EMMC_POWER_PIN_I2S0_BCK)
216 POWER_EMMC = CHIP_GPIO(PIN_I2S0_BCK),
217#elif defined(CONFIG_CXD56_EMMC_POWER_PIN_UART2_CTS)
218 POWER_EMMC = CHIP_GPIO(PIN_UART2_CTS),
220 POWER_EMMC = PMIC_NONE,
222 POWER_LTE = PMIC_GPO(2),
227#define BOARD_POWEROFF_DEEP (0)
228#define BOARD_POWEROFF_COLD (1)
232#define BOARD_PM_IDLE (0)
233#define BOARD_PM_APPS (1)
237#define CXD5247_XRST PIN_SPI3_CS2_X
238#define CXD5247_AVDD (0x01)
239#define CXD5247_DVDD (0x02)
243#define ILI9340_SPI_MAXFREQUENCY 40000000
247#if defined(CONFIG_LCD_ON_MAIN_BOARD)
251#define DISPLAY_DMA_TXCH (4)
252#define DISPLAY_DMA_RXCH (5)
253#define DISPLAY_DMA_TXCH_CFG CXD56_DMA_PERIPHERAL_SPI5_TX
254#define DISPLAY_DMA_RXCH_CFG CXD56_DMA_PERIPHERAL_SPI5_RX
255#define DISPLAY_DMA_TX_MAXSIZE (192000)
256#define DISPLAY_DMA_RX_MAXSIZE (192000)
258#elif defined(CONFIG_LCD_ON_LTE_EXTENSION_BOARD)
266#define DISPLAY_DMA_TXCH (-1)
267#define DISPLAY_DMA_RXCH (-1)
268#define DISPLAY_DMA_TXCH_CFG (-1)
269#define DISPLAY_DMA_RXCH_CFG (-1)
270#define DISPLAY_DMA_TX_MAXSIZE (192000)
271#define DISPLAY_DMA_RX_MAXSIZE (192000)
277#define DISPLAY_DMA_TXCH (2)
278#define DISPLAY_DMA_RXCH (3)
279#define DISPLAY_DMA_TXCH_CFG CXD56_DMA_PERIPHERAL_SPI4_TX
280#define DISPLAY_DMA_RXCH_CFG CXD56_DMA_PERIPHERAL_SPI4_RX
281#define DISPLAY_DMA_TX_MAXSIZE (192000)
282#define DISPLAY_DMA_RX_MAXSIZE (192000)
286#define DISPLAY_RST ILI934X_RST_PIN
287#define DISPLAY_DC ILI934X_DC_PIN
296#define IMAGER_RST PIN_SDIO_DIR1_3
297#define IMAGER_SLEEP PIN_SDIO_DIR0
308#define BOARDIOC_USBDEV_SETNOTIFYSIG (BOARDIOC_USER+0x0001)
312#define ALT1250_SLAVE_REQ PIN_SPI2_SCK
313#define ALT1250_MASTER_REQ PIN_RTC_IRQ_OUT
314#define ALT1250_WAKEUP PIN_SPI2_MOSI
315#define ALT1250_SHUTDOWN PIN_SPI2_MISO
316#define ALT1250_LTE_POWER_BUTTON PIN_AP_CLK
320#if defined(CONFIG_CXD56_WIZNET_RST_EMMC_DATA3)
321#define WIZNET_PIN_RST PIN_EMMC_DATA3
322#elif defined(CONFIG_CXD56_WIZNET_RST_I2S0_BCK)
323#define WIZNET_PIN_RST PIN_I2S0_BCK
326#if defined(CONFIG_CXD56_WIZNET_INT_EMMC_DATA2)
327#define WIZNET_PIN_INT PIN_EMMC_DATA2
328#elif defined(CONFIG_CXD56_WIZNET_INT_I2S0_LRCK)
329#define WIZNET_PIN_INT PIN_I2S0_LRCK
332#ifdef CONFIG_CXD56_WIZNET_USE_SWCS
333#define WIZNET_PIN_CS PIN_I2S0_DATA_IN
347#if defined(__cplusplus)
348#define EXTERN extern "C"
366void cxd56_boardinitialize(
void);
369#if defined(__cplusplus)