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_wiznet.h"
43#include "cxd56_i2cdev.h"
44#include "cxd56_spidev.h"
45#include "cxd56_sdcard.h"
46#include "cxd56_automount.h"
50#include "cxd56_audio.h"
51#include "cxd56_alt1250.h"
52#include "cxd56_ak09912.h"
53#include "cxd56_apds9930.h"
54#include "cxd56_apds9960.h"
55#include "cxd56_bcm20706.h"
56#include "cxd56_bh1721fvc.h"
57#include "cxd56_bh1745nuc.h"
58#include "cxd56_bm1383glv.h"
59#include "cxd56_bm1422gmv.h"
60#include "cxd56_bmi160.h"
61#include "cxd56_bmi270.h"
62#include "cxd56_bmp280.h"
63#include "cxd56_emmcdev.h"
64#include "cxd56_spisd.h"
65#include "cxd56_kx022.h"
66#include "cxd56_lt1pa01.h"
67#include "cxd56_rpr0521rs.h"
68#include "cxd56_scd41.h"
69#include "cxd56_sensors.h"
70#include "cxd56_gnss_addon.h"
71#include "cxd56_cxd5602pwbimu.h"
73#ifdef CONFIG_VIDEO_ISX012
74# include "cxd56_isx012.h"
76#ifdef CONFIG_VIDEO_ISX019
77# include "cxd56_isx019.h"
86#ifdef CONFIG_CXD56_80MHz
87# define BOARD_FCLKOUT_FREQUENCY (80000000)
89# define BOARD_FCLKOUT_FREQUENCY (100000000)
96#define BOARD_UART0_BASEFREQ CONFIG_CXD56_XOSC_CLOCK
97#define BOARD_UART1_BASEFREQ BOARD_FCLKOUT_FREQUENCY
98#define BOARD_UART2_BASEFREQ CONFIG_CXD56_XOSC_CLOCK
102#define GPIO_LED1 (PIN_I2S1_BCK)
103#define GPIO_LED2 (PIN_I2S1_LRCK)
104#define GPIO_LED3 (PIN_I2S1_DATA_IN)
105#define GPIO_LED4 (PIN_I2S1_DATA_OUT)
107#define BOARD_LED1 (0)
108#define BOARD_LED2 (1)
109#define BOARD_LED3 (2)
110#define BOARD_LED4 (3)
111#define BOARD_NLEDS (4)
115#define BOARD_LED1_BIT (1 << BOARD_LED1)
116#define BOARD_LED2_BIT (1 << BOARD_LED2)
117#define BOARD_LED3_BIT (1 << BOARD_LED3)
118#define BOARD_LED4_BIT (1 << BOARD_LED4)
122#define LED_STARTED (BOARD_LED1_BIT)
123#define LED_HEAPALLOCATE (BOARD_LED2_BIT)
124#define LED_IRQSENABLED (BOARD_LED1_BIT | BOARD_LED2_BIT)
125#define LED_STACKCREATED (BOARD_LED3_BIT)
126#define LED_INIRQ (BOARD_LED1_BIT | BOARD_LED3_BIT)
127#define LED_SIGNAL (BOARD_LED2_BIT | BOARD_LED3_BIT)
128#define LED_ASSERTION (BOARD_LED1_BIT | BOARD_LED2_BIT | BOARD_LED3_BIT)
129#define LED_PANIC (BOARD_LED4_BIT)
131#ifdef CONFIG_ARCH_LEDS_CPU_ACTIVITY
136#define LED_CPU0 (100)
137#define LED_CPU1 (101)
138#define LED_CPU2 (102)
139#define LED_CPU3 (103)
140#define LED_CPU (LED_CPU0 + up_cpu_index())
145#define BOARD_NUM_BUTTONS (2)
171#define PMIC_TYPE_LSW (1u << 8)
172#define PMIC_TYPE_GPO (1u << 9)
173#define PMIC_TYPE_DDCLDO (1u << 10)
174#define CHIP_TYPE_GPIO (1u << 11)
175#define PMIC_GET_TYPE(v) ((v) & 0xff00)
176#define PMIC_GET_CH(v) ((v) & 0x00ff)
177#define PMIC_LSW(n) (PMIC_TYPE_LSW | (1u << (n)))
178#define PMIC_GPO(n) (PMIC_TYPE_GPO | (1u << (n)))
179#define PMIC_DDCLDO(n) (PMIC_TYPE_DDCLDO | (1u << (n)))
180#define CHIP_GPIO(n) (CHIP_TYPE_GPIO | (n))
182enum board_power_device
186 POWER_DDC_IO = PMIC_DDCLDO(0),
187 POWER_LDO_EMMC = PMIC_DDCLDO(1),
188 POWER_DDC_ANA = PMIC_DDCLDO(2),
189 POWER_LDO_ANA = PMIC_DDCLDO(3),
190 POWER_DDC_CORE = PMIC_DDCLDO(4),
191 POWER_LDO_PERI = PMIC_DDCLDO(5),
195 POWER_AUDIO_DVDD = PMIC_LSW(2),
196 POWER_FLASH = PMIC_LSW(3),
197 POWER_TCXO = PMIC_LSW(4),
198 POWER_LNA = PMIC_LSW(4),
202 POWER_AUDIO_AVDD = PMIC_GPO(1),
203 POWER_AUDIO_MUTE = PMIC_GPO(6),
204 POWER_IMAGE_SENSOR = PMIC_GPO(4),
206 POWER_BTBLE = PMIC_NONE,
207 POWER_SENSOR = PMIC_NONE,
208#if defined(CONFIG_CXD56_EMMC_POWER_PIN_I2S0_BCK)
209 POWER_EMMC = CHIP_GPIO(PIN_I2S0_BCK),
210#elif defined(CONFIG_CXD56_EMMC_POWER_PIN_UART2_CTS)
211 POWER_EMMC = CHIP_GPIO(PIN_UART2_CTS),
213 POWER_EMMC = PMIC_NONE,
215 POWER_LTE = PMIC_GPO(2),
220#define BOARD_POWEROFF_DEEP (0)
221#define BOARD_POWEROFF_COLD (1)
225#define BOARD_PM_IDLE (0)
226#define BOARD_PM_APPS (1)
230#define CXD5247_XRST PIN_SPI3_CS2_X
231#define CXD5247_AVDD (0x01)
232#define CXD5247_DVDD (0x02)
236#define ILI9340_SPI_MAXFREQUENCY 40000000
240#if defined(CONFIG_LCD_ON_MAIN_BOARD)
244#define DISPLAY_DMA_TXCH (4)
245#define DISPLAY_DMA_RXCH (5)
246#define DISPLAY_DMA_TXCH_CFG CXD56_DMA_PERIPHERAL_SPI5_TX
247#define DISPLAY_DMA_RXCH_CFG CXD56_DMA_PERIPHERAL_SPI5_RX
248#define DISPLAY_DMA_TX_MAXSIZE (192000)
249#define DISPLAY_DMA_RX_MAXSIZE (192000)
251#elif defined(CONFIG_LCD_ON_LTE_EXTENSION_BOARD)
259#define DISPLAY_DMA_TXCH (-1)
260#define DISPLAY_DMA_RXCH (-1)
261#define DISPLAY_DMA_TXCH_CFG (-1)
262#define DISPLAY_DMA_RXCH_CFG (-1)
263#define DISPLAY_DMA_TX_MAXSIZE (192000)
264#define DISPLAY_DMA_RX_MAXSIZE (192000)
270#define DISPLAY_DMA_TXCH (2)
271#define DISPLAY_DMA_RXCH (3)
272#define DISPLAY_DMA_TXCH_CFG CXD56_DMA_PERIPHERAL_SPI4_TX
273#define DISPLAY_DMA_RXCH_CFG CXD56_DMA_PERIPHERAL_SPI4_RX
274#define DISPLAY_DMA_TX_MAXSIZE (192000)
275#define DISPLAY_DMA_RX_MAXSIZE (192000)
279#define DISPLAY_RST ILI934X_RST_PIN
280#define DISPLAY_DC ILI934X_DC_PIN
289#define IMAGER_RST PIN_SDIO_DIR1_3
290#define IMAGER_SLEEP PIN_SDIO_DIR0
301#define BOARDIOC_USBDEV_SETNOTIFYSIG (BOARDIOC_USER+0x0001)
305#define ALT1250_SLAVE_REQ PIN_SPI2_SCK
306#define ALT1250_MASTER_REQ PIN_RTC_IRQ_OUT
307#define ALT1250_WAKEUP PIN_SPI2_MOSI
308#define ALT1250_SHUTDOWN PIN_SPI2_MISO
309#define ALT1250_LTE_POWER_BUTTON PIN_AP_CLK
313#if defined(CONFIG_CXD56_WIZNET_RST_EMMC_DATA3)
314#define WIZNET_PIN_RST PIN_EMMC_DATA3
315#elif defined(CONFIG_CXD56_WIZNET_RST_I2S0_BCK)
316#define WIZNET_PIN_RST PIN_I2S0_BCK
319#if defined(CONFIG_CXD56_WIZNET_INT_EMMC_DATA2)
320#define WIZNET_PIN_INT PIN_EMMC_DATA2
321#elif defined(CONFIG_CXD56_WIZNET_INT_I2S0_LRCK)
322#define WIZNET_PIN_INT PIN_I2S0_LRCK
325#ifdef CONFIG_CXD56_WIZNET_USE_SWCS
326#define WIZNET_PIN_CS PIN_I2S0_DATA_IN
340#if defined(__cplusplus)
341#define EXTERN extern "C"
359void cxd56_boardinitialize(
void);
362#if defined(__cplusplus)