Merged in alinjerpelea/nuttx (pull request #967)

group boards based on chip

* a1x: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* am335x: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* c5471: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* scx56xx: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* dm320: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* efm32: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* imx6: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* imxrt: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* kinetis: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* kl: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* lc823450: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* lpc17xx_40xx: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* lpc214x: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* lpc2378: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* lpc31xx: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* lpc43xx: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* lpc54xx: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* max326xx: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* moxart: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* nrf52: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* nuc1xx: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* sam34: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* sama5: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* samd2l2: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* samd5e5: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* samv7: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* stm32f0l0g0: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* stm32f7: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* stm32h7: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* stm32l4: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* stm32: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* str71x: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* tiva: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* tms570: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* xmc4: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* p112: typo fix

    this boars is a z80 board and was moved to the wrong arch

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* avr: at32uc3: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* avr: at90usb: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* avr: atmega: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* hc: mcs92s12ne64: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* mips: pic32mx: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* mips: pic32mz: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* misoc: lm32: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* or1k: mor1kx: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* renesas: m32262f8: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* renesas: sh7032: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* risk-v: gap8: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* risk-v: nr5m100: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* sim: sim: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* x86: qemu: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* xtensa: esp32: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* z16: z16f2811: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* z80: ez80: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* z80: z180: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* z80: z80: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* z80: z8: group boards based on chip

    All boards based on the same chip are moved to the same folder

    following the arch layout <arch>/<chip>/<board>.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* tools: update tools for boards based on chip

    This patch updates only the linux tools

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* pcduino-a10: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* beaglebone-black: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* c5471evm: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* spresense: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* ntosd-dm320: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* efm32-g8xx-stk: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* efm32gg-stk3700: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* olimex-efm32g880f128-stk: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* sabre-6quad: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* imxrt1050-evk: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* imxrt1060-evk: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* freedom-k28f: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* freedom-k64f: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* freedom-k66f: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* kwikstik-k40: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* teensy-3.x: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* twr-k60n512: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* twr-k64f120m: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* freedom-kl25z: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* freedom-kl26z: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* teensy-lc: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* lc823450: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* lincoln60: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* lpc4088-devkit: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* lpc4088-quickstart: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* lpcxpresso-lpc1768: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* mbed: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* mcb1700: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* olimex-lpc1766stk: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* open1788: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* pnev5180b: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* u-blox-c027: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* zkit-arm-1769: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* mcu123-lpc214x: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* zp214xpa: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* olimex-lpc2378: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* ea3131: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* ea3152: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* olimex-lpc-h3131: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* bambino-200e: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* lpc4330-xplorer: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* lpc4337-ws: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* lpc4337-evb: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* lpc4370-link2: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* lpcxpresso-lpc54628: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* max32660-evsys: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* moxa: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* nrf52-generic: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* nutiny-nuc120: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* arduino-due: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* flipnclick-sam3x: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* sam3u-ek: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* sam4cmp-db: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* sam4e-ek: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* sam4l-xplained: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* sam4s-xplained: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* sam4s-xplained-pro: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* sama5d2-xult: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* sama5d3-xplained: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* sama5d3x-ek: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* sama5d4-ek: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* samd20-xplained: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* samd21-xplained: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* saml21-xplained: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* metro-m4: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* same70-xplained: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* same71-xult: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* axoloti: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* clicker2-stm32: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* cloudctrl: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* fire-stm32v2: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* hymini-stm32v: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* maple: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* mikroe-stm32f4: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* nucleo-f103rb: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* nucleo-f207zg: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* nucleo-f302r8: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* nucleo-f303re: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* nucleo-f303ze: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* nucleo-f334r8: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* nucleo-f410rb: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* nucleo-f446re: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* nucleo-f4x1re: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* nucleo-1152re: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* olimex-stm32-e407: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* olimex-stm32-h405: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* olimex-stm32-h407: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* olimex-stm32-p107: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* olimex-stm32-p207: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* olimex-stm32-p407: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* olimex-stm32: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* omnibusf4: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* photon: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* shenzou: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* stm3210e-eval: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* stm3220g-eval: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* stm3240g-eval: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* stm32_tiny: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* stm32butterfly2: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* stm32f103-minimum: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* stm32f334-disco: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* stm32f3discovery: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* stm32f411e-disco: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* stm32f429i-disco: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* stm32f4discovery: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* stm32ldiscovery: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* stm32vldiscovery: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* viewtool-stm32f107: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* b-l072z-lrwan1: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* nucleo-f072rb: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* nucleo-f091rc: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* nucleo-f071rg: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* nucleo-l073rz: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* stm32f051-discovery: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* stm32f072-discovery: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* nucleo-144: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* stm32f746-ws: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* stm32f746g-disco: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* stm32f746g-disco: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* nucleo-h743zi: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* b-l475e-iot01a: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* nucleo-l432kc: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* nucleo-l432re: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* nucleo-l476rg: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* nucleo-l496zg: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* stm32l476-mdk: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* stm32l476vg-disco: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* stm32l4r9ai-disco: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* olimex-strp711: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* dk-tm4c129x: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* eagle100: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* ekk-lm3s9b96: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* launchxl-cc1310: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* launchxl-cc1312r1: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* lm3s6432-s2e: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* lm3s6965-ek: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* lm3s8962-ek: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* lm4f120-launchpad: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* lm4c123g-launchpad: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* lm4c1294-launchpad: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* launchxl-tms57004: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* tms570ls31x-usb-kit: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* xmc4500-relax: defconfig update

    add ARCH_CHIP to defconfig

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* zp214xpa: typo fix

    add missing tools/oocd.sh

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
Alin Jerpelea
2019-08-07 20:49:39 +00:00
committed by Gregory Nutt
parent a1f1adb878
commit 1358e829ad
3863 changed files with 1649 additions and 1189 deletions
+59
View File
@@ -0,0 +1,59 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
if ARCH_BOARD_SPRESENSE
config CXD56_SPIFLASHSIZE
hex
default 0x400000
depends on CXD56_SFC
---help---
Specify the SPI flash total available size for the application.
This value is generally set half of SPI flash device capacity.
config SDCARD_TXS02612
bool "SD Card TXS02612 port expander with voltage level translation"
default y
---help---
Enable TXS02612 Dual Voltage Level Translator for SD-Card interface.
This device is used in SPD-003C board.
if SDCARD_TXS02612
choice
prompt "TXS02612 port"
default SDCARD_TXS02612_PORT0
config SDCARD_TXS02612_PORT0
bool "Port 0"
config SDCARD_TXS02612_PORT1
bool "Port 1"
endchoice # "TXS02612 port"
endif # SDCARD_TXS02612
if LCD
choice
prompt "LCD SPI connection"
default LCD_ON_EXTENSION_BOARD
config LCD_ON_EXTENSION_BOARD
bool "Extension board: SPI4"
select CXD56_SPI4
---help---
Display connected to extension board.
config LCD_ON_MAIN_BOARD
bool "Main board: SPI5"
select CXD56_SPI5
---help---
Display connected to main board.
endchoice
endif
endif
+92
View File
@@ -0,0 +1,92 @@
README
======
Spresense is a compact development board based on Sonys power-efficient
multicore microcontroller CXD5602. It allows developers to create IoT
applications in a very short time and is supported by the Arduino IDE as well
as the more advanced NuttX based SDK.
- Integrated GPS
The embedded GNSS with support for GPS, QZSS and GLONASS enables applications
where tracking is required.
- Hi-res audio output and multi mic inputs
Advanced 192kHz/24 bit audio codec and amplifier for audio output, and
support for up to 8 mic input channels.
- Multicore microcontroller
Spresense is powered by Sony's CXD5602 microcontroller (ARM® Cortex®-M4F × 6
cores), with a clock speed of 156 MHz.
Refer to https://developer.sony.com/develop/spresense/ for further information
about this board.
Configuration sub-directories
-----------------------------
wifi
This is a configuration for Spresense + Wi-Fi addon (Telit GS2200M) module.
With this configuration, (1) you can connect Spresense to an existing Wi-Fi
access point (2.4GHz 802.11b/g/n are supported) or (2) you can make
Spresense as a Wi-Fi access point. In both cases, you can login to the
Spresense with telnet, also access to a webserver (NOTE: this case you need
an extension board with microSDHC card)
(1) Station (STA) mode
To run the module in Station mode (i.e. to connect to an existing Wi-Fi
access point), You need to specify SSID with passcode.
nsh> gs2200m ssid-to-connect passcode &
If the connection succeeded, IP address is statically assigned.
nsh> ifconfig
eth0 Link encap:Ethernet HWaddr 3c:95:09:00:69:92 at UP
inet addr:10.0.0.2 DRaddr:10.0.0.1 Mask:255.255.255.0
Then, you can run DHCP client (renew command) to obtain IP address as well
as DNS server information. (NOTE: In current configuration, DHCP client on
GS2200M is disabled. If you enable the internal DHCP client, you can not
use DNS client on NuttX)
nsh> renew eth0 &
renew [6:100]
nsh> ifconfig
eth0 Link encap:Ethernet HWaddr 3c:95:09:00:69:92 at UP
inet addr:192.168.1.101 DRaddr:192.168.1.1 Mask:255.255.255.0
Now, you can run telnetd and webserver on Spresense.
nsh> telnetd &
telnetd [7:100]
nsh> webserver &
webserver [9:100]
nsh> Starting webserver
Also, you can run NTP client to adjust the RTC on Spresense. (NOTE: we
assume your network can access to pool.ntp.org, otherwise, you can specify
CONFIG_NETUTILS_NTPCLIENT_SERVER)
nsh> date
Jan 01 00:00:36 1970
nsh> ntpcstart
Started the NTP daemon as PID=11
nsh> date
Jul 30 06:42:13 2019
(2) Acess Point (AP) mode
To run the module in AP mode, you need to specify SSID to advertise and
WEP-key. (NOTE: in AP mode, you can also specify channel number to use)
nsh> gs2200m -a ssid-to-advertise 10-hex-digits-wep-key &
If the module was initialized in AP mode, you can see a new IP address is
assigned.
nsh> ifconfig
eth0 Link encap:Ethernet HWaddr 3c:95:09:00:69:93 at UP
inet addr:192.168.11.1 DRaddr:192.168.11.1 Mask:255.255.255.0
Now you can connect your PC to the AP with the above SSID and WEP-key
which you specified.
@@ -0,0 +1,102 @@
#
# This file is autogenerated: PLEASE DO NOT EDIT IT.
#
# You can use "make menuconfig" to make any modifications to the installed .config file.
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
# modifications.
#
# CONFIG_CXD56_I2C0_SCUSEQ is not set
# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set
# CONFIG_MMCSD_SPI is not set
# CONFIG_MTD_SMART_WEAR_LEVEL is not set
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="spresense"
CONFIG_ARCH_BOARD_SPRESENSE=y
CONFIG_ARCH_CHIP="cxd56xx"
CONFIG_ARCH_CHIP_CXD56XX=y
CONFIG_ARCH_STACKDUMP=y
CONFIG_ARMV7M_USEBASEPRI=y
CONFIG_BOARD_LOOPSPERMSEC=5434
CONFIG_BOOT_RUNFROMISRAM=y
CONFIG_BUILTIN=y
CONFIG_CDCACM=y
CONFIG_CDCACM_COMPOSITE=y
CONFIG_CLOCK_MONOTONIC=y
CONFIG_COMPOSITE_IAD=y
CONFIG_COMPOSITE_MSFT_OS_DESCRIPTORS=y
CONFIG_COMPOSITE_PRODUCTID=0x0bc2
CONFIG_COMPOSITE_VENDORID=0x054c
CONFIG_COMPOSITE_VENDORSTR="Sony"
CONFIG_CXD56_BINARY=y
CONFIG_CXD56_DMAC_SPI4_RX=y
CONFIG_CXD56_DMAC_SPI4_TX=y
CONFIG_CXD56_I2C0=y
CONFIG_CXD56_I2C=y
CONFIG_CXD56_SDIO=y
CONFIG_CXD56_SPI4=y
CONFIG_CXD56_SPI5=y
CONFIG_CXD56_SPI=y
CONFIG_CXD56_USBDEV=y
CONFIG_DEBUG_FULLOPT=y
CONFIG_DEBUG_SYMBOLS=y
CONFIG_FAT_LCNAMES=y
CONFIG_FAT_LFN=y
CONFIG_FAT_MAXFNAME=64
CONFIG_FS_FAT=y
CONFIG_FS_PROCFS=y
CONFIG_FS_PROCFS_REGISTER=y
CONFIG_FS_SMARTFS=y
CONFIG_HAVE_CXX=y
CONFIG_HAVE_CXXINITIALIZE=y
CONFIG_I2C=y
CONFIG_LCD=y
CONFIG_LCD_ILI9340=y
CONFIG_LCD_ILI9340_IFACE0=y
CONFIG_MAX_TASKS=16
CONFIG_MAX_WDOGPARMS=2
CONFIG_MMCSD=y
CONFIG_MMCSD_SDIO=y
CONFIG_MTD_BYTE_WRITE=y
CONFIG_MTD_PARTITION=y
CONFIG_MTD_SMART=y
CONFIG_MTD_SMART_ENABLE_CRC=y
CONFIG_MTD_SMART_SECTOR_SIZE=4096
CONFIG_NFILE_DESCRIPTORS=8
CONFIG_NFILE_STREAMS=8
CONFIG_NSH_ARCHINIT=y
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_READLINE=y
CONFIG_PREALLOC_MQ_MSGS=4
CONFIG_PREALLOC_TIMERS=4
CONFIG_PREALLOC_WDOGS=16
CONFIG_RAM_SIZE=1572864
CONFIG_RAM_START=0x0d000000
CONFIG_READLINE_CMD_HISTORY=y
CONFIG_RR_INTERVAL=200
CONFIG_RTC=y
CONFIG_RTC_DRIVER=y
CONFIG_SCHED_WAITPID=y
CONFIG_SDCLONE_DISABLE=y
CONFIG_SMARTFS_ALIGNED_ACCESS=y
CONFIG_SMARTFS_MAXNAMLEN=30
CONFIG_SMARTFS_MULTI_ROOT_DIRS=y
CONFIG_SPI=y
CONFIG_START_DAY=6
CONFIG_START_MONTH=12
CONFIG_START_YEAR=2011
CONFIG_SYSTEM_CDCACM=y
CONFIG_SYSTEM_CLE=y
CONFIG_SYSTEM_COMPOSITE=y
CONFIG_SYSTEM_NSH=y
CONFIG_SYSTEM_NSH_CXXINITIALIZE=y
CONFIG_SYSTEM_USBMSC=y
CONFIG_UART1_SERIAL_CONSOLE=y
CONFIG_USBDEV=y
CONFIG_USBDEV_COMPOSITE=y
CONFIG_USBDEV_DMA=y
CONFIG_USBDEV_DUALSPEED=y
CONFIG_USBMSC=y
CONFIG_USBMSC_COMPOSITE=y
CONFIG_USBMSC_REMOVABLE=y
CONFIG_USER_ENTRYPOINT="spresense_main"
@@ -0,0 +1,99 @@
#
# This file is autogenerated: PLEASE DO NOT EDIT IT.
#
# You can use "make menuconfig" to make any modifications to the installed .config file.
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
# modifications.
#
# CONFIG_CXD56_I2C0_SCUSEQ is not set
# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set
# CONFIG_MMCSD_SPI is not set
# CONFIG_MTD_SMART_WEAR_LEVEL is not set
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="spresense"
CONFIG_ARCH_BOARD_SPRESENSE=y
CONFIG_ARCH_CHIP="cxd56xx"
CONFIG_ARCH_CHIP_CXD56XX=y
CONFIG_ARCH_STACKDUMP=y
CONFIG_ARMV7M_USEBASEPRI=y
CONFIG_BOARD_LOOPSPERMSEC=5434
CONFIG_BOOT_RUNFROMISRAM=y
CONFIG_BUILTIN=y
CONFIG_CLOCK_MONOTONIC=y
CONFIG_CXD56_BINARY=y
CONFIG_CXD56_ADC=y
CONFIG_CXD56_CISIF=y
CONFIG_CXD56_HPADC0=y
CONFIG_CXD56_HPADC1=y
CONFIG_CXD56_I2C0=y
CONFIG_CXD56_I2C2=y
CONFIG_CXD56_I2C=y
CONFIG_CXD56_LPADC=y
CONFIG_CXD56_PWM0=y
CONFIG_CXD56_PWM1=y
CONFIG_CXD56_PWM2=y
CONFIG_CXD56_PWM3=y
CONFIG_CXD56_PWM=y
CONFIG_CXD56_SDIO=y
CONFIG_CXD56_SPI4=y
CONFIG_CXD56_SPI5=y
CONFIG_CXD56_SPI=y
CONFIG_CXD56_UART2=y
CONFIG_CXD56_USBDEV=y
CONFIG_DEBUG_FULLOPT=y
CONFIG_DEBUG_SYMBOLS=y
CONFIG_FAT_LCNAMES=y
CONFIG_FAT_LFN=y
CONFIG_FAT_MAXFNAME=64
CONFIG_FS_FAT=y
CONFIG_FS_PROCFS=y
CONFIG_FS_PROCFS_REGISTER=y
CONFIG_FS_SMARTFS=y
CONFIG_HAVE_CXX=y
CONFIG_HAVE_CXXINITIALIZE=y
CONFIG_I2C=y
CONFIG_MAX_TASKS=16
CONFIG_MAX_WDOGPARMS=2
CONFIG_MMCSD=y
CONFIG_MMCSD_SDIO=y
CONFIG_MTD_BYTE_WRITE=y
CONFIG_MTD_PARTITION=y
CONFIG_MTD_SMART=y
CONFIG_MTD_SMART_ENABLE_CRC=y
CONFIG_MTD_SMART_SECTOR_SIZE=4096
CONFIG_NFILE_DESCRIPTORS=8
CONFIG_NFILE_STREAMS=8
CONFIG_NSH_ARCHINIT=y
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_READLINE=y
CONFIG_PREALLOC_MQ_MSGS=4
CONFIG_PREALLOC_TIMERS=4
CONFIG_PREALLOC_WDOGS=16
CONFIG_RAM_SIZE=1572864
CONFIG_RAM_START=0x0d000000
CONFIG_READLINE_CMD_HISTORY=y
CONFIG_RR_INTERVAL=200
CONFIG_RTC=y
CONFIG_RTC_DRIVER=y
CONFIG_SCHED_WAITPID=y
CONFIG_SDCLONE_DISABLE=y
CONFIG_SMARTFS_ALIGNED_ACCESS=y
CONFIG_SMARTFS_MAXNAMLEN=30
CONFIG_SMARTFS_MULTI_ROOT_DIRS=y
CONFIG_SPI=y
CONFIG_START_DAY=6
CONFIG_START_MONTH=12
CONFIG_START_YEAR=2011
CONFIG_SYSTEM_CLE=y
CONFIG_SYSTEM_NSH=y
CONFIG_SYSTEM_NSH_CXXINITIALIZE=y
CONFIG_SYSTEM_USBMSC=y
CONFIG_UART1_SERIAL_CONSOLE=y
CONFIG_USBDEV=y
CONFIG_USBDEV_DMA=y
CONFIG_USBDEV_DUALSPEED=y
CONFIG_USBMSC=y
CONFIG_USBMSC_EPBULKIN=1
CONFIG_USBMSC_REMOVABLE=y
CONFIG_USER_ENTRYPOINT="spresense_main"
@@ -0,0 +1,60 @@
#
# This file is autogenerated: PLEASE DO NOT EDIT IT.
#
# You can use "make menuconfig" to make any modifications to the installed .config file.
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
# modifications.
#
# CONFIG_CXD56_I2C0_SCUSEQ is not set
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="spresense"
CONFIG_ARCH_BOARD_SPRESENSE=y
CONFIG_ARCH_CHIP="cxd56xx"
CONFIG_ARCH_CHIP_CXD56XX=y
CONFIG_ARCH_STACKDUMP=y
CONFIG_ARMV7M_USEBASEPRI=y
CONFIG_BOARD_LOOPSPERMSEC=5434
CONFIG_BOOT_RUNFROMISRAM=y
CONFIG_BUILTIN=y
CONFIG_CLOCK_MONOTONIC=y
CONFIG_CXD56_BINARY=y
CONFIG_CXD56_I2C0=y
CONFIG_CXD56_I2C=y
CONFIG_CXD56_SPI4=y
CONFIG_CXD56_SPI5=y
CONFIG_CXD56_SPI=y
CONFIG_DEBUG_FULLOPT=y
CONFIG_DEBUG_SYMBOLS=y
CONFIG_FS_PROCFS=y
CONFIG_FS_PROCFS_REGISTER=y
CONFIG_HAVE_CXX=y
CONFIG_HAVE_CXXINITIALIZE=y
CONFIG_I2C=y
CONFIG_MAX_TASKS=16
CONFIG_MAX_WDOGPARMS=2
CONFIG_NFILE_DESCRIPTORS=8
CONFIG_NFILE_STREAMS=8
CONFIG_NSH_ARCHINIT=y
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_READLINE=y
CONFIG_PREALLOC_MQ_MSGS=4
CONFIG_PREALLOC_TIMERS=4
CONFIG_PREALLOC_WDOGS=16
CONFIG_RAM_SIZE=1572864
CONFIG_RAM_START=0x0d000000
CONFIG_READLINE_CMD_HISTORY=y
CONFIG_RR_INTERVAL=200
CONFIG_RTC=y
CONFIG_RTC_DRIVER=y
CONFIG_SCHED_WAITPID=y
CONFIG_SDCLONE_DISABLE=y
CONFIG_SPI=y
CONFIG_START_DAY=6
CONFIG_START_MONTH=12
CONFIG_START_YEAR=2011
CONFIG_SYSTEM_CLE=y
CONFIG_SYSTEM_NSH=y
CONFIG_SYSTEM_NSH_CXXINITIALIZE=y
CONFIG_UART1_SERIAL_CONSOLE=y
CONFIG_USER_ENTRYPOINT="spresense_main"
@@ -0,0 +1,116 @@
#
# This file is autogenerated: PLEASE DO NOT EDIT IT.
#
# You can use "make menuconfig" to make any modifications to the installed .config file.
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
# modifications.
#
# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set
# CONFIG_MMCSD_SPI is not set
# CONFIG_MTD_SMART_WEAR_LEVEL is not set
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="spresense"
CONFIG_ARCH_BOARD_SPRESENSE=y
CONFIG_ARCH_CHIP_CXD56XX=y
CONFIG_ARCH_CHIP="cxd56xx"
CONFIG_ARCH_STACKDUMP=y
CONFIG_ARMV7M_USEBASEPRI=y
CONFIG_BOARDCTL_RESET=y
CONFIG_BOARDCTL_USBDEVCTRL=y
CONFIG_BOARD_LOOPSPERMSEC=5434
CONFIG_BOOT_RUNFROMISRAM=y
CONFIG_BUILTIN=y
CONFIG_CLOCK_MONOTONIC=y
CONFIG_CODECS_HASH_MD5=y
CONFIG_CXD56_BINARY=y
CONFIG_CXD56_SDIO=y
CONFIG_CXD56_USBDEV=y
CONFIG_DEBUG_FULLOPT=y
CONFIG_DEBUG_SYMBOLS=y
CONFIG_EXAMPLES_HELLO=y
CONFIG_EXAMPLES_WEBSERVER=y
CONFIG_FAT_LCNAMES=y
CONFIG_FAT_LFN=y
CONFIG_FAT_MAXFNAME=64
CONFIG_FS_FAT=y
CONFIG_FS_FATTIME=y
CONFIG_FS_PROCFS=y
CONFIG_FS_PROCFS_REGISTER=y
CONFIG_FS_SMARTFS=y
CONFIG_HAVE_CXX=y
CONFIG_HAVE_CXXINITIALIZE=y
CONFIG_I2C=y
CONFIG_MAX_TASKS=16
CONFIG_MAX_WDOGPARMS=2
CONFIG_MMCSD=y
CONFIG_MMCSD_SDIO=y
CONFIG_NAME_MAX=256
CONFIG_NET=y
CONFIG_NETDB_DNSCLIENT=y
CONFIG_NETDEVICES=y
CONFIG_NETINIT_MACADDR_1=0xdeadbeff
CONFIG_NETINIT_NOMAC=y
CONFIG_NETINIT_THREAD=y
CONFIG_NETUTILS_CODECS=y
CONFIG_NETUTILS_DHCPC=y
CONFIG_NETUTILS_HTTPD_DIRLIST=y
CONFIG_NETUTILS_HTTPD_SENDFILE=y
CONFIG_NETUTILS_TELNETD=y
CONFIG_NETUTILS_WEBCLIENT=y
CONFIG_NETUTILS_WEBSERVER=y
CONFIG_NET_ARP_SEND=y
CONFIG_NET_BROADCAST=y
CONFIG_NET_ETH_PKTSIZE=1500
CONFIG_NET_ICMP=y
CONFIG_NET_ICMP_SOCKET=y
CONFIG_NET_LOOPBACK=y
CONFIG_NET_PKT=y
CONFIG_NET_ROUTE=y
CONFIG_NET_STATISTICS=y
CONFIG_NET_TCP=y
CONFIG_NET_UDP=y
CONFIG_NET_UDP_BINDTODEVICE=y
CONFIG_MTD_BYTE_WRITE=y
CONFIG_MTD_PARTITION=y
CONFIG_MTD_SMART=y
CONFIG_MTD_SMART_ENABLE_CRC=y
CONFIG_MTD_SMART_SECTOR_SIZE=4096
CONFIG_NFILE_DESCRIPTORS=8
CONFIG_NFILE_STREAMS=8
CONFIG_NSH_ARCHINIT=y
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_DISABLE_TELNETD=y
CONFIG_NSH_READLINE=y
CONFIG_NSH_TELNETD_CLIENTSTACKSIZE=3072
CONFIG_NSH_WGET_USERAGENT="NuttX/7.2x.x (; http://www.nuttx.org/)"
CONFIG_PREALLOC_MQ_MSGS=4
CONFIG_PREALLOC_TIMERS=4
CONFIG_PREALLOC_WDOGS=16
CONFIG_RAM_SIZE=1572864
CONFIG_RAM_START=0x0d000000
CONFIG_READLINE_CMD_HISTORY=y
CONFIG_RNDIS=y
CONFIG_RR_INTERVAL=200
CONFIG_RTC=y
CONFIG_SCHED_LPWORK=y
CONFIG_SCHED_WAITPID=y
CONFIG_SDCLONE_DISABLE=y
CONFIG_SMARTFS_ALIGNED_ACCESS=y
CONFIG_SMARTFS_MAXNAMLEN=30
CONFIG_SMARTFS_MULTI_ROOT_DIRS=y
CONFIG_SPI=y
CONFIG_STACK_COLORATION=y
CONFIG_START_DAY=16
CONFIG_START_MONTH=7
CONFIG_START_YEAR=2019
CONFIG_SYSLOG_TIMESTAMP=y
CONFIG_SYSTEM_NSH=y
CONFIG_SYSTEM_NSH_CXXINITIALIZE=y
CONFIG_SYSTEM_PING=y
CONFIG_TELNET_CHARACTER_MODE=y
CONFIG_UART1_SERIAL_CONSOLE=y
CONFIG_USBDEV=y
CONFIG_USBDEV_DMA=y
CONFIG_USBDEV_DUALSPEED=y
CONFIG_USER_ENTRYPOINT="spresense_main"
@@ -0,0 +1,97 @@
#
# This file is autogenerated: PLEASE DO NOT EDIT IT.
#
# You can use "make menuconfig" to make any modifications to the installed .config file.
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
# modifications.
#
# CONFIG_CXD56_I2C0_SCUSEQ is not set
# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set
# CONFIG_MMCSD_SPI is not set
# CONFIG_MTD_SMART_WEAR_LEVEL is not set
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="spresense"
CONFIG_ARCH_BOARD_SPRESENSE=y
CONFIG_ARCH_CHIP="cxd56xx"
CONFIG_ARCH_CHIP_CXD56XX=y
CONFIG_ARCH_STACKDUMP=y
CONFIG_ARMV7M_USEBASEPRI=y
CONFIG_BOARD_LOOPSPERMSEC=5434
CONFIG_BOOT_RUNFROMISRAM=y
CONFIG_BUILTIN=y
CONFIG_CDCACM=y
CONFIG_CDCACM_COMPOSITE=y
CONFIG_CLOCK_MONOTONIC=y
CONFIG_COMPOSITE_IAD=y
CONFIG_COMPOSITE_MSFT_OS_DESCRIPTORS=y
CONFIG_COMPOSITE_PRODUCTID=0x0bc2
CONFIG_COMPOSITE_VENDORID=0x054c
CONFIG_COMPOSITE_VENDORSTR="Sony"
CONFIG_CXD56_BINARY=y
CONFIG_CXD56_I2C0=y
CONFIG_CXD56_I2C=y
CONFIG_CXD56_SDIO=y
CONFIG_CXD56_SPI4=y
CONFIG_CXD56_SPI5=y
CONFIG_CXD56_SPI=y
CONFIG_CXD56_USBDEV=y
CONFIG_DEBUG_FULLOPT=y
CONFIG_DEBUG_SYMBOLS=y
CONFIG_FAT_LCNAMES=y
CONFIG_FAT_LFN=y
CONFIG_FAT_MAXFNAME=64
CONFIG_FS_FAT=y
CONFIG_FS_PROCFS=y
CONFIG_FS_PROCFS_REGISTER=y
CONFIG_FS_SMARTFS=y
CONFIG_HAVE_CXX=y
CONFIG_HAVE_CXXINITIALIZE=y
CONFIG_I2C=y
CONFIG_MAX_TASKS=16
CONFIG_MAX_WDOGPARMS=2
CONFIG_MMCSD=y
CONFIG_MMCSD_SDIO=y
CONFIG_MTD_BYTE_WRITE=y
CONFIG_MTD_PARTITION=y
CONFIG_MTD_SMART=y
CONFIG_MTD_SMART_ENABLE_CRC=y
CONFIG_MTD_SMART_SECTOR_SIZE=4096
CONFIG_NFILE_DESCRIPTORS=8
CONFIG_NFILE_STREAMS=8
CONFIG_NSH_ARCHINIT=y
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_READLINE=y
CONFIG_PREALLOC_MQ_MSGS=4
CONFIG_PREALLOC_TIMERS=4
CONFIG_PREALLOC_WDOGS=16
CONFIG_RAM_SIZE=1572864
CONFIG_RAM_START=0x0d000000
CONFIG_READLINE_CMD_HISTORY=y
CONFIG_RR_INTERVAL=200
CONFIG_RTC=y
CONFIG_RTC_DRIVER=y
CONFIG_SCHED_WAITPID=y
CONFIG_SDCLONE_DISABLE=y
CONFIG_SMARTFS_ALIGNED_ACCESS=y
CONFIG_SMARTFS_MAXNAMLEN=30
CONFIG_SMARTFS_MULTI_ROOT_DIRS=y
CONFIG_SPI=y
CONFIG_START_DAY=6
CONFIG_START_MONTH=12
CONFIG_START_YEAR=2011
CONFIG_SYSTEM_CDCACM=y
CONFIG_SYSTEM_CLE=y
CONFIG_SYSTEM_COMPOSITE=y
CONFIG_SYSTEM_NSH=y
CONFIG_SYSTEM_NSH_CXXINITIALIZE=y
CONFIG_SYSTEM_USBMSC=y
CONFIG_UART1_SERIAL_CONSOLE=y
CONFIG_USBDEV=y
CONFIG_USBDEV_COMPOSITE=y
CONFIG_USBDEV_DMA=y
CONFIG_USBDEV_DUALSPEED=y
CONFIG_USBMSC=y
CONFIG_USBMSC_COMPOSITE=y
CONFIG_USBMSC_REMOVABLE=y
CONFIG_USER_ENTRYPOINT="spresense_main"
@@ -0,0 +1,87 @@
#
# This file is autogenerated: PLEASE DO NOT EDIT IT.
#
# You can use "make menuconfig" to make any modifications to the installed .config file.
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
# modifications.
#
# CONFIG_CXD56_I2C0_SCUSEQ is not set
# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set
# CONFIG_MMCSD_SPI is not set
# CONFIG_MTD_SMART_WEAR_LEVEL is not set
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="spresense"
CONFIG_ARCH_BOARD_SPRESENSE=y
CONFIG_ARCH_CHIP="cxd56xx"
CONFIG_ARCH_CHIP_CXD56XX=y
CONFIG_ARCH_STACKDUMP=y
CONFIG_ARMV7M_USEBASEPRI=y
CONFIG_BOARD_LOOPSPERMSEC=5434
CONFIG_BOOT_RUNFROMISRAM=y
CONFIG_BUILTIN=y
CONFIG_CLOCK_MONOTONIC=y
CONFIG_CXD56_BINARY=y
CONFIG_CXD56_I2C0=y
CONFIG_CXD56_I2C=y
CONFIG_CXD56_SDIO=y
CONFIG_CXD56_SPI4=y
CONFIG_CXD56_SPI5=y
CONFIG_CXD56_SPI=y
CONFIG_CXD56_USBDEV=y
CONFIG_DEBUG_FULLOPT=y
CONFIG_DEBUG_SYMBOLS=y
CONFIG_FAT_LCNAMES=y
CONFIG_FAT_LFN=y
CONFIG_FAT_MAXFNAME=64
CONFIG_FS_FAT=y
CONFIG_FS_PROCFS=y
CONFIG_FS_PROCFS_REGISTER=y
CONFIG_FS_SMARTFS=y
CONFIG_HAVE_CXX=y
CONFIG_HAVE_CXXINITIALIZE=y
CONFIG_I2C=y
CONFIG_MAX_TASKS=16
CONFIG_MAX_WDOGPARMS=2
CONFIG_MMCSD=y
CONFIG_MMCSD_SDIO=y
CONFIG_MTD_BYTE_WRITE=y
CONFIG_MTD_PARTITION=y
CONFIG_MTD_SMART=y
CONFIG_MTD_SMART_ENABLE_CRC=y
CONFIG_MTD_SMART_SECTOR_SIZE=4096
CONFIG_NFILE_DESCRIPTORS=8
CONFIG_NFILE_STREAMS=8
CONFIG_NSH_ARCHINIT=y
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_READLINE=y
CONFIG_PREALLOC_MQ_MSGS=4
CONFIG_PREALLOC_TIMERS=4
CONFIG_PREALLOC_WDOGS=16
CONFIG_RAM_SIZE=1572864
CONFIG_RAM_START=0x0d000000
CONFIG_READLINE_CMD_HISTORY=y
CONFIG_RR_INTERVAL=200
CONFIG_RTC=y
CONFIG_RTC_DRIVER=y
CONFIG_SCHED_WAITPID=y
CONFIG_SDCLONE_DISABLE=y
CONFIG_SMARTFS_ALIGNED_ACCESS=y
CONFIG_SMARTFS_MAXNAMLEN=30
CONFIG_SMARTFS_MULTI_ROOT_DIRS=y
CONFIG_SPI=y
CONFIG_START_DAY=6
CONFIG_START_MONTH=12
CONFIG_START_YEAR=2011
CONFIG_SYSTEM_CLE=y
CONFIG_SYSTEM_NSH=y
CONFIG_SYSTEM_NSH_CXXINITIALIZE=y
CONFIG_SYSTEM_USBMSC=y
CONFIG_UART1_SERIAL_CONSOLE=y
CONFIG_USBDEV=y
CONFIG_USBDEV_DMA=y
CONFIG_USBDEV_DUALSPEED=y
CONFIG_USBMSC=y
CONFIG_USBMSC_EPBULKIN=1
CONFIG_USBMSC_REMOVABLE=y
CONFIG_USER_ENTRYPOINT="spresense_main"
@@ -0,0 +1,121 @@
#
# This file is autogenerated: PLEASE DO NOT EDIT IT.
#
# You can use "make menuconfig" to make any modifications to the installed .config file.
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
# modifications.
#
# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set
# CONFIG_MMCSD_SPI is not set
# CONFIG_STANDARD_SERIAL is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="spresense"
CONFIG_ARCH_BOARD_SPRESENSE=y
CONFIG_ARCH_CHIP="cxd56xx"
CONFIG_ARCH_CHIP_CXD56XX=y
CONFIG_ARCH_STACKDUMP=y
CONFIG_ARMV7M_USEBASEPRI=y
CONFIG_BOARDCTL_RESET=y
CONFIG_BOARD_LOOPSPERMSEC=5434
CONFIG_BOOT_RUNFROMISRAM=y
CONFIG_BUILTIN=y
CONFIG_CLOCK_MONOTONIC=y
CONFIG_CODECS_HASH_MD5=y
CONFIG_CXD56_BINARY=y
CONFIG_CXD56_DMAC_SPI5_RX=y
CONFIG_CXD56_DMAC_SPI5_TX=y
CONFIG_CXD56_SDIO=y
CONFIG_CXD56_SPI5=y
CONFIG_CXD56_SPI=y
CONFIG_CXD56_USBDEV=y
CONFIG_DEBUG_FULLOPT=y
CONFIG_DEBUG_SYMBOLS=y
CONFIG_DRIVERS_WIRELESS=y
CONFIG_EXAMPLES_HELLO=y
CONFIG_EXAMPLES_WEBSERVER=y
CONFIG_FAT_LCNAMES=y
CONFIG_FAT_LFN=y
CONFIG_FAT_MAXFNAME=64
CONFIG_FS_FAT=y
CONFIG_FS_FATTIME=y
CONFIG_FS_PROCFS=y
CONFIG_FS_PROCFS_REGISTER=y
CONFIG_FS_SMARTFS=y
CONFIG_HAVE_CXX=y
CONFIG_HAVE_CXXINITIALIZE=y
CONFIG_I2C=y
CONFIG_LIB_SENDFILE_BUFSIZE=1024
CONFIG_MAX_WDOGPARMS=2
CONFIG_MMCSD=y
CONFIG_MMCSD_SDIO=y
CONFIG_MTD_BYTE_WRITE=y
CONFIG_MTD_PARTITION=y
CONFIG_MTD_SMART=y
CONFIG_MTD_SMART_ENABLE_CRC=y
CONFIG_MTD_SMART_SECTOR_SIZE=4096
CONFIG_NAME_MAX=256
CONFIG_NET=y
CONFIG_NETDB_DNSCLIENT=y
CONFIG_NETDEVICES=y
CONFIG_NETINIT_NETLOCAL=y
CONFIG_NETUTILS_CODECS=y
CONFIG_NETUTILS_FTPC=y
CONFIG_NETUTILS_HTTPD_DIRLIST=y
CONFIG_NETUTILS_HTTPD_SENDFILE=y
CONFIG_NETUTILS_TELNETD=y
CONFIG_NETUTILS_WEBCLIENT=y
CONFIG_NETUTILS_WEBSERVER=y
CONFIG_NET_BROADCAST=y
CONFIG_NET_ICMP=y
CONFIG_NET_LOCAL=y
CONFIG_NET_TCP_NO_STACK=y
CONFIG_NET_UDP_NO_STACK=y
CONFIG_NET_USRSOCK=y
CONFIG_NET_USRSOCK_CONNS=16
CONFIG_NET_USRSOCK_UDP=y
CONFIG_NFILE_DESCRIPTORS=8
CONFIG_NFILE_STREAMS=8
CONFIG_NSH_ARCHINIT=y
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_DISABLE_ARP=y
CONFIG_NSH_DISABLE_IFUPDOWN=y
CONFIG_NSH_DISABLE_NSLOOKUP=y
CONFIG_NSH_READLINE=y
CONFIG_NSH_WGET_USERAGENT="NuttX/7.2x.x (; http://www.nuttx.org/)"
CONFIG_PREALLOC_MQ_MSGS=4
CONFIG_PREALLOC_TIMERS=4
CONFIG_PREALLOC_WDOGS=16
CONFIG_RAM_SIZE=1572864
CONFIG_RAM_START=0x0d000000
CONFIG_READLINE_CMD_HISTORY=y
CONFIG_RR_INTERVAL=200
CONFIG_RTC=y
CONFIG_SCHED_LPWORK=y
CONFIG_SCHED_LPWORKPRIORITY=30
CONFIG_SCHED_WAITPID=y
CONFIG_SDCLONE_DISABLE=y
CONFIG_SMARTFS_ALIGNED_ACCESS=y
CONFIG_SMARTFS_MAXNAMLEN=30
CONFIG_SMARTFS_MULTI_ROOT_DIRS=y
CONFIG_STACK_COLORATION=y
CONFIG_START_DAY=16
CONFIG_START_MONTH=7
CONFIG_START_YEAR=2019
CONFIG_SYSLOG_TIMESTAMP=y
CONFIG_SYSTEM_DHCPC_RENEW=y
CONFIG_SYSTEM_NSH=y
CONFIG_SYSTEM_NSH_CXXINITIALIZE=y
CONFIG_SYSTEM_NTPC=y
CONFIG_SYSTEM_USBMSC=y
CONFIG_UART1_SERIAL_CONSOLE=y
CONFIG_USBDEV=y
CONFIG_USBDEV_DMA=y
CONFIG_USBDEV_DUALSPEED=y
CONFIG_USBMSC=y
CONFIG_USBMSC_EPBULKIN=1
CONFIG_USBMSC_REMOVABLE=y
CONFIG_USER_ENTRYPOINT="spresense_main"
CONFIG_WIRELESS_GS2200M=y
CONFIG_WL_GS2200M=y
CONFIG_WL_GS2200M_DISABLE_DHCPC=y
CONFIG_WL_GS2200M_SPI_FREQUENCY=10000000
@@ -0,0 +1,289 @@
/****************************************************************************
* boards/spresense/include/board.h
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef _CONFIGS_SPRESENSE_INCLUDE_BOARD_H
#define _CONFIGS_SPRESENSE_INCLUDE_BOARD_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <nuttx/irq.h>
#include <sys/boardctl.h>
#include <stdbool.h>
#include "cxd56_clock.h"
#include "cxd56_power.h"
#include "cxd56_flash.h"
#include "cxd56_gauge.h"
#include "cxd56_charger.h"
#include "cxd56_gs2200m.h"
#include "cxd56_i2cdev.h"
#include "cxd56_bmi160.h"
#include "cxd56_sdcard.h"
#include "cxd56_wdt.h"
#include "cxd56_gpioif.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Clocking ****************************************************************/
#define BOARD_XTAL_FREQUENCY (26000000) /* XTAL oscillator frequency */
#define BOARD_RTCCLK_FREQUENCY (32768) /* RTC oscillator frequency */
#define BOARD_INTRCOSC_FREQUENCY (8192000) /* Internal RC oscillator frequency */
#ifdef CONFIG_CXD56_80MHz
# define BOARD_FCLKOUT_FREQUENCY (80000000)
#else
# define BOARD_FCLKOUT_FREQUENCY (97500000)
#endif
#define CXD56_CCLK BOARD_FCLKOUT_FREQUENCY
/* USB0 ********************************************************************/
#define BOARD_USB0_CLKSRC PLL0USB_CLKSEL_XTAL
#define BOARD_USB0_MDIV 0x06167ffa /* Table 149 datsheet, valid for 12Mhz Fclkin */
#define BOARD_USB0_NP_DIV 0x00302062 /* Table 149 datsheet, valid for 12Mhz Fclkin */
/* SPIFI clocking **********************************************************/
/* The SPIFI will receive clocking from a divider per the settings provided
* in this file. The NuttX code will configure PLL1 as the input clock
* for the selected divider
*/
#undef BOARD_SPIFI_PLL1 /* No division */
#undef BOARD_SPIFI_DIVA /* Supports division by 1-4 */
#undef BOARD_SPIFI_DIVB /* Supports division by 1-16 */
#undef BOARD_SPIFI_DIVC /* Supports division by 1-16 */
#undef BOARD_SPIFI_DIVD /* Supports division by 1-16 */
#undef BOARD_SPIFI_DIVE /* Supports division by 1-256 */
#if BOARD_FCLKOUT_FREQUENCY < 20000000
# define BOARD_SPIFI_PLL1 1 /* Use PLL1 directly */
#else
# define BOARD_SPIFI_DIVB 1 /* Use IDIVB */
#endif
/* We need to configure the divider so that its output is as close to the
* desired SCLK value. The peak data transfer rate will be about half of
* this frequency in bytes per second.
*/
#if BOARD_FCLKOUT_FREQUENCY < 20000000
# define BOARD_SPIFI_FREQUENCY BOARD_FCLKOUT_FREQUENCY /* 72Mhz? */
#else
# define BOARD_SPIFI_DIVIDER (14) /* 204MHz / 14 = 14.57MHz */
# define BOARD_SPIFI_FREQUENCY (102000000) /* 204MHz / 14 = 14.57MHz */
#endif
/* UART clocking ***********************************************************/
/* Configure all UARTs to use the XTAL input frequency */
#define BOARD_UART0_BASEFREQ BOARD_XTAL_FREQUENCY
#define BOARD_UART1_BASEFREQ 48750000
#define BOARD_UART2_BASEFREQ BOARD_XTAL_FREQUENCY
/* LED definitions *********************************************************/
#define GPIO_LED1 (PIN_I2S1_BCK)
#define GPIO_LED2 (PIN_I2S1_LRCK)
#define GPIO_LED3 (PIN_I2S1_DATA_IN)
#define GPIO_LED4 (PIN_I2S1_DATA_OUT)
#define BOARD_LED1 (0)
#define BOARD_LED2 (1)
#define BOARD_LED3 (2)
#define BOARD_LED4 (3)
#define BOARD_NLEDS (4)
/* LED bits for use with board_userled_all() */
#define BOARD_LED1_BIT (1 << BOARD_LED1)
#define BOARD_LED2_BIT (1 << BOARD_LED2)
#define BOARD_LED3_BIT (1 << BOARD_LED3)
#define BOARD_LED4_BIT (1 << BOARD_LED4)
/* LED pattern for use with board_autoled_on() and board_autoled_off() */
#define LED_STARTED (BOARD_LED1_BIT)
#define LED_HEAPALLOCATE (BOARD_LED2_BIT)
#define LED_IRQSENABLED (BOARD_LED1_BIT | BOARD_LED2_BIT)
#define LED_STACKCREATED (BOARD_LED3_BIT)
#define LED_INIRQ (BOARD_LED1_BIT | BOARD_LED3_BIT)
#define LED_SIGNAL (BOARD_LED2_BIT | BOARD_LED3_BIT)
#define LED_ASSERTION (BOARD_LED1_BIT | BOARD_LED2_BIT | BOARD_LED3_BIT)
#define LED_PANIC (BOARD_LED4_BIT)
/* Buttons definitions *****************************************************/
#define BOARD_NUM_BUTTONS (2)
/* Power Control definitions ***********************************************/
/* Switch Device
* --------- -------------------------------
* LSW2 AcaPulco Audio Digital VDD
* LSW3 SPI-Flash & TCXO
* LSW4 GNSS LNA
* GPO0 AcaPulco Audio Analog VDD
* GPO1 Sensor 1.8V
* GPO2 Sensor 3.3V
* GPO3 Bluetooth/Bluetooth Low Energy
* GPO4 Image Sensor 1.2V
* GPO5 Image Sensor 3.3V
* GPO6 eMMC 3.3V/1.8V
* GPO7 Image Sensor 1.8V
*
*/
#define PMIC_NONE (0)
#define PMIC_TYPE_LSW (1u << 8)
#define PMIC_TYPE_GPO (1u << 9)
#define PMIC_TYPE_DDCLDO (1u << 10)
#define PMIC_GET_TYPE(v) ((v) & 0xff00)
#define PMIC_GET_CH(v) ((v) & 0x00ff)
#define PMIC_LSW(n) (PMIC_TYPE_LSW | (1u << (n)))
#define PMIC_GPO(n) (PMIC_TYPE_GPO | (1u << (n)))
#define PMIC_DDCLDO(n) (PMIC_TYPE_DDCLDO | (1u << (n)))
enum board_power_device
{
/* DDC/LDO */
POWER_DDC_IO = PMIC_DDCLDO(0),
POWER_LDO_EMMC = PMIC_DDCLDO(1),
POWER_DDC_ANA = PMIC_DDCLDO(2),
POWER_LDO_ANA = PMIC_DDCLDO(3),
POWER_DDC_CORE = PMIC_DDCLDO(4),
POWER_LDO_PERI = PMIC_DDCLDO(5),
/* Load Switch */
POWER_AUDIO_DVDD = PMIC_LSW(2),
POWER_FLASH = PMIC_LSW(3),
POWER_TCXO = PMIC_LSW(3),
POWER_LNA = PMIC_LSW(4),
/* GPO */
POWER_AUDIO_AVDD = PMIC_GPO(0),
POWER_SENSOR_18V = PMIC_GPO(1),
POWER_SENSOR_33V = PMIC_GPO(2),
POWER_BMI160 = POWER_SENSOR_18V,
POWER_SENSOR = POWER_SENSOR_18V | POWER_SENSOR_33V,
POWER_BTBLE = PMIC_GPO(3),
POWER_EINK = PMIC_NONE,
POWER_EMMC = PMIC_GPO(6),
POWER_LFOUR = PMIC_NONE,
POWER_LTE = PMIC_NONE,
POWER_IMAGE_SENSOR = PMIC_GPO(4) | PMIC_GPO(5) | PMIC_GPO(7),
};
/* LCD Display clocking ****************************************************/
#define ILI9340_SPI_MAXFREQUENCY 40000000
/* Display device pin definitions ******************************************/
#if defined(CONFIG_LCD_ON_MAIN_BOARD) /* Display connected to main board. */
#define DISPLAY_RST PIN_I2S0_BCK
#define DISPLAY_DC PIN_I2S0_LRCK
#define DISPLAY_SPI 5
#else /* Display is connected through extension board. */
#define DISPLAY_RST PIN_SPI2_MISO
#define DISPLAY_DC PIN_PWM2
#define DISPLAY_SPI 4
#endif
/* Set signal id for notify USB device connection status and
* supply current value.
* signal returns "usbdev_notify_s" struct pointer in sival_ptr.
*
* Arg: Value of sinal number
*/
#define BOARDIOC_USBDEV_SETNOTIFYSIG (BOARDIOC_USER+0x0001)
/****************************************************************************
* Public Types
****************************************************************************/
#ifndef __ASSEMBLY__
/****************************************************************************
* Public Data
****************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: cxd56_boardinitialize
*
* Description:
*
****************************************************************************/
void cxd56_boardinitialize(void);
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* _CONFIGS_SPRESENSE_INCLUDE_BOARD_H */
@@ -0,0 +1,84 @@
/****************************************************************************
* boards/spresense/include/cxd56_bmi160.h
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef __BOARD_COMMON_INCLUDE_CXD56_BMI160_H
#define __BOARD_COMMON_INCLUDE_CXD56_BMI160_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
/****************************************************************************
* Public Types
****************************************************************************/
#ifndef __ASSEMBLY__
/****************************************************************************
* Public Data
****************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: board_bmi160_initialize
*
* Description:
* Initialize BMI160 i2c driver and register the BMI160 device.
*
****************************************************************************/
int board_bmi160_initialize(int bus);
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARD_COMMON_INCLUDE_CXD56_BMI160_H */
@@ -0,0 +1,94 @@
/****************************************************************************
* boards/spresense/include/cxd56_charger.h
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef __BOARD_COMMON_INCLUDE_CXD56_CHARGER_H
#define __BOARD_COMMON_INCLUDE_CXD56_CHARGER_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
/****************************************************************************
* Public Types
****************************************************************************/
#ifndef __ASSEMBLY__
/****************************************************************************
* Public Data
****************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: board_charger_initialize
*
* Description:
* Initialize battery charger driver
*
****************************************************************************/
int board_charger_initialize(FAR const char *devpath);
/****************************************************************************
* Name: board_charger_uninitialize
*
* Description:
* Uninitialize battery charger driver
*
****************************************************************************/
int board_charger_uninitialize(FAR const char *devpath);
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARD_COMMON_INCLUDE_CXD56_CHARGER_H */
@@ -0,0 +1,86 @@
/****************************************************************************
* boards/spresense/include/cxd56_clock.h
*
* Copyright 2019 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef __BOARD_COMMON_INCLUDE_CXD56_CLOCK_H
#define __BOARD_COMMON_INCLUDE_CXD56_CLOCK_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdbool.h>
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/****************************************************************************
* Name: board_clock_initialize
*
* Description:
* Initialize clock control.
* If this API is called and is returned, the clock mode is the highest
* clock mode. For example, CPU frequency is 156MHz.
*
****************************************************************************/
void board_clock_initialize(void);
/****************************************************************************
* Name: board_clock_enable
*
* Description:
* Enable dynamic clock control.
* If this API is called and is returned, the clock mode is the lowest
* clock mode. Later, you can control the clock mode dynamically by calling
* up_pm_acquire_freqlock() or up_pm_release_freqlock.
*
****************************************************************************/
void board_clock_enable(void);
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __BOARD_COMMON_INCLUDE_CXD56_CLOCK_H */
@@ -0,0 +1,86 @@
/****************************************************************************
* boards/spresense/include/cxd56_flash.h
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef __BOARD_COMMON_INCLUDE_CXD56_FLASH_H
#define __BOARD_COMMON_INCLUDE_CXD56_FLASH_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
/****************************************************************************
* Public Types
****************************************************************************/
#ifndef __ASSEMBLY__
/****************************************************************************
* Public Data
****************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: board_flash_initialize
*
* Description:
* Initialize the SPI-Flash device and mount the file system.
*
****************************************************************************/
#ifdef CONFIG_CXD56_SFC
int board_flash_initialize(void);
#endif
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARD_COMMON_INCLUDE_CXD56_FLASH_H */
@@ -0,0 +1,94 @@
/****************************************************************************
* boards/spresense/include/cxd56_gauge.h
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef __BOARD_COMMON_INCLUDE_CXD56_GAUGE_H
#define __BOARD_COMMON_INCLUDE_CXD56_GAUGE_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
/****************************************************************************
* Public Types
****************************************************************************/
#ifndef __ASSEMBLY__
/****************************************************************************
* Public Data
****************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: board_gauge_initialize
*
* Description:
* Initialize battery gauge driver
*
****************************************************************************/
int board_gauge_initialize(FAR const char *devpath);
/****************************************************************************
* Name: board_gauge_uninitialize
*
* Description:
* Uninitialize battery gauge driver
*
****************************************************************************/
int board_gauge_uninitialize(FAR const char *devpath);
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARD_COMMON_INCLUDE_CXD56_GAUGE_H */
@@ -0,0 +1,202 @@
/****************************************************************************
* boards/spresense/include/cxd56_gpioif.h
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef __BOARD_COMMON_INCLUDE_CXD56_GPIOIF_H
#define __BOARD_COMMON_INCLUDE_CXD56_GPIOIF_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
#include <stdbool.h>
#include <nuttx/irq.h>
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/* gpioif GPIO Interface driver */
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Pin Pull Setting
* Pin floating, pull up, pull down definitions
*/
#define PIN_FLOAT (0) /**< Floating */
#define PIN_PULLUP (1) /**< Internal Weak Pull Up */
#define PIN_PULLDOWN (2) /**< Internal Weak Pull Down */
#define PIN_BUSKEEPER (3) /**< Internal Bus-Keeper */
/*
* GPIO Interrupt Setting
* GPIO interrupt level and edge trigger types
*/
#define INT_HIGH_LEVEL (2) /**< High Level */
#define INT_LOW_LEVEL (3) /**< Low Level */
#define INT_RISING_EDGE (4) /**< Rising Edge */
#define INT_FALLING_EDGE (5) /**< Falling Edge */
#define INT_BOTH_EDGE (7) /**< Both Edge */
#ifndef __ASSEMBLY__
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/*
* GPIO Configure
*
* [in] pin: Pin number
* [in] mode: Function mode 0=GPIO
* [in] input: Input Enable true=enable, false=disable
* [in] drive: Drive Strength true=High Drive(4mA), false=Normal(2mA)
* [in] pull: 0=float, 1=pullup, 2=pulldown, 3=buskeeper
* - PIN_FLOAT
* - PIN_PULLUP
* - PIN_PULLDOWN
* - PIN_BUSKEEPER
*
* return: OK(0) is success. negative value is failure.
*/
int board_gpio_config(uint32_t pin, int mode, bool input, bool drive,
int pull);
/*
* GPIO Status
*
* [in] pin: Pin number
* [out] input: Input Enable true=enable, false=disable
* [out] output: Output Enable true=enable, false=disable
* [out] drive: Drive Strength true=HighDrive(4mA), false=Normal(2mA)
* [out] pull: 0=float, 1=pullup, 2=pulldown, 3=buskeeper
* - PIN_FLOAT
* - PIN_PULLUP
* - PIN_PULLDOWN
* - PIN_BUSKEEPER
*
* return: Pin function mode. negative value is failure.
*/
int board_gpio_status(uint32_t pin, bool *input, bool *output, bool *drive,
int *pull);
/*
* GPIO Write
*
* [in] pin: Pin number
* [in] value: Write Value 0<high, 0=low, 0>hiz
*/
void board_gpio_write(uint32_t pin, int value);
/*
* GPIO Read
*
* param: [in] pin: Pin number
*
* return: read value 1=high, 0=low
*/
int board_gpio_read(uint32_t pin);
/*
* GPIO Interrupt Configure
*
* [in] pin: Pin number
* [in] mode: Interrupt polarity
* - #INT_HIGH_LEVEL
* - #INT_LOW_LEVEL
* - #INT_RISING_EDGE
* - #INT_FALLING_EDGE
* - #INT_BOTH_EDGE
* [in] filter: Noise Filter true=enable, false=disable
* [in] isr: Interrupt Service Routine
*
* IRQ number. negative value is failure.
*/
int board_gpio_intconfig(uint32_t pin, int mode, bool filter, xcpt_t isr);
/*
* GPIO Interrupt Configure
*
* [in] pin: Pin number
* [out] mode: Interrupt polarity
* - #INT_HIGH_LEVEL
* - #INT_LOW_LEVEL
* - #INT_RISING_EDGE
* - #INT_FALLING_EDGE
* - #INT_BOTH_EDGE
* [out] filter: Noise Filter true=enable, false=disable
* [out] enabled: Interrupt true=enable, false=disable
*
* IRQ number. negative value is failure.
*/
int board_gpio_intstatus(uint32_t pin, int *mode,
bool *filter, bool *enabled);
/*
* GPIO Interrupt Enable/Disable
*
* [in] pin: Pin number
* [in] enable: Interrupt true=enable, false=disable
*
* IRQ number. negative value is failure.
*/
int board_gpio_int(uint32_t pin, bool enable);
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARD_COMMON_INCLUDE_CXD56_GPIOIF_H */
@@ -0,0 +1,87 @@
/****************************************************************************
* boards/spresense/include/cxd56_gs2200m.h
*
* Copyright 2019 Sony Home Entertainment & Sound Products Inc.
* Author: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef __BOARDS_ARM_SPRESENSE_INCLUDE_CXD56_GS2200M_H
#define __BOARDS_ARM_SPRESENSE_INCLUDE_CXD56_GS2200M_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
/****************************************************************************
* Public Types
****************************************************************************/
#ifndef __ASSEMBLY__
/****************************************************************************
* Public Data
****************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: board_gs2200m_initialize
*
* Description:
* Initialize Tilt GS2200M board
*
****************************************************************************/
int board_gs2200m_initialize(FAR const char *devpath, int bus);
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_ARM_SPRESENSE_INCLUDE_CXD56_GS2200M_H */
@@ -0,0 +1,86 @@
/****************************************************************************
* boards/spresense/include/cxd56_i2cdev.h
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef __BOARD_COMMON_INCLUDE_CXD56_I2CDEV_H
#define __BOARD_COMMON_INCLUDE_CXD56_I2CDEV_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
/****************************************************************************
* Public Types
****************************************************************************/
#ifndef __ASSEMBLY__
/****************************************************************************
* Public Data
****************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: board_i2cdev_initialize
*
* Description:
* Initialize i2c driver and register the /dev/i2c device.
*
****************************************************************************/
#ifdef CONFIG_CXD56_I2C_DRIVER
int board_i2cdev_initialize(int bus);
#endif
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARD_COMMON_INCLUDE_CXD56_I2CDEV_H */
@@ -0,0 +1,202 @@
/****************************************************************************
* boards/spresense/include/cxd56_power.h
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef __BOARD_COMMON_INCLUDE_CXD56_POWER_H
#define __BOARD_COMMON_INCLUDE_CXD56_POWER_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdbool.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#define PMIC_NONE (0)
#define PMIC_TYPE_LSW (1u << 8)
#define PMIC_TYPE_GPO (1u << 9)
#define PMIC_TYPE_DDCLDO (1u << 10)
#define PMIC_GET_TYPE(v) ((v) & 0xff00)
#define PMIC_GET_CH(v) ((v) & 0x00ff)
#define PMIC_LSW(n) (PMIC_TYPE_LSW | (1u << (n)))
#define PMIC_GPO(n) (PMIC_TYPE_GPO | (1u << (n)))
#define PMIC_DDCLDO(n) (PMIC_TYPE_DDCLDO | (1u << (n)))
/****************************************************************************
* Public Types
****************************************************************************/
#ifndef __ASSEMBLY__
/****************************************************************************
* Public Data
****************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/****************************************************************************
* Name: board_pmic_read
*
* Description:
* Read the value from the specified sub address
*
* Input Parameter:
* addr - sub address
* buf - pointer to read buffer
* size - byte count of read
*
* Returned Value:
* Return 0 on success. Otherwise, return a negated errno.
*
****************************************************************************/
int board_pmic_read(uint8_t addr, void *buf, uint32_t size);
/****************************************************************************
* Name: board_pmic_write
*
* Description:
* Write the value to the specified sub address
*
* Input Parameter:
* addr - sub address
* buf - pointer to write buffer
* size - byte count of write
*
* Returned Value:
* Return 0 on success. Otherwise, return a negated errno.
*
****************************************************************************/
int board_pmic_write(uint8_t addr, void *buf, uint32_t size);
/****************************************************************************
* Name: board_power_setup
*
* Description:
* Initial setup for board-specific power control
*
****************************************************************************/
int board_power_setup(int status);
/****************************************************************************
* Name: board_power_control
*
* Description:
* Power on/off the device on the board.
*
****************************************************************************/
int board_power_control(int target, bool en);
/****************************************************************************
* Name: board_power_monitor
*
* Description:
* Get status of Power on/off the device on the board.
*
****************************************************************************/
bool board_power_monitor(int target);
/****************************************************************************
* Name: board_flash_power_control
*
* Description:
* Power on/off the flash device on the board.
*
****************************************************************************/
int board_flash_power_control(bool en);
/****************************************************************************
* Name: board_flash_power_monitor
*
* Description:
* Get status of Power on/off the flash device on the board.
*
****************************************************************************/
bool board_flash_power_monitor(void);
/****************************************************************************
* Name: board_xtal_power_control
*
* Description:
* Power on/off the Xtal device on the board.
*
****************************************************************************/
int board_xtal_power_control(bool en);
/****************************************************************************
* Name: board_xtal_power_monitor
*
* Description:
* Get status of Power on/off the Xtal device on the board.
*
****************************************************************************/
bool board_xtal_power_monitor(void);
/****************************************************************************
* Name: board_lna_power_control
*
* Description:
* Power on/off the LNA device on the board.
*
****************************************************************************/
int board_lna_power_control(bool en);
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARD_COMMON_INCLUDE_CXD56_POWER_H */
@@ -0,0 +1,84 @@
/****************************************************************************
* boards/spresense/include/cxd56_pwm.h
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef __BOARD_COMMON_INCLUDE_CXD56_PWM_H
#define __BOARD_COMMON_INCLUDE_CXD56_PWM_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
/****************************************************************************
* Public Types
****************************************************************************/
#ifndef __ASSEMBLY__
/****************************************************************************
* Public Data
****************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: board_pwm_setup
*
* Description:
* Initialize PWM on the board.
*
****************************************************************************/
int board_pwm_setup(void);
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARD_COMMON_INCLUDE_CXD56_PWM_H */
@@ -0,0 +1,154 @@
/****************************************************************************
* boards/spresense/include/cxd56_sdcard.h
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef __BOARD_COMMON_INCLUDE_CXD56_SDCARD_H
#define __BOARD_COMMON_INCLUDE_CXD56_SDCARD_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
/****************************************************************************
* Public Types
****************************************************************************/
#ifndef __ASSEMBLY__
/****************************************************************************
* Public Data
****************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: board_sdcard_initialize
*
* Description:
* Initialize SD Card on the board.
*
****************************************************************************/
int board_sdcard_initialize(void);
/****************************************************************************
* Name: board_sdcard_pin_initialize
*
* Description:
* Initialize SD Card pins on the board.
*
****************************************************************************/
void board_sdcard_pin_initialize(void);
/****************************************************************************
* Name: board_sdcard_pin_finalize
*
* Description:
* Finalize SD Card pins on the board.
*
****************************************************************************/
void board_sdcard_pin_finalize(void);
/****************************************************************************
* Name: board_sdcard_pin_configuraton
*
* Description:
* Configure SD Card pins on the board.
*
****************************************************************************/
void board_sdcard_pin_configuraton(void);
/****************************************************************************
* Name: board_sdcard_pin_enable
*
* Description:
* Enable SD Card pins on the board.
*
****************************************************************************/
void board_sdcard_pin_enable(void);
/****************************************************************************
* Name: board_sdcard_pin_disable
*
* Description:
* Disable SD Card pins on the board.
*
****************************************************************************/
void board_sdcard_pin_disable(void);
/****************************************************************************
* Name: board_sdcard_set_high_voltage
*
* Description:
* Set SD Card IO voltage to 3.3V
*
****************************************************************************/
void board_sdcard_set_high_voltage(void);
/****************************************************************************
* Name: board_sdcard_set_low_voltage
*
* Description:
* Set SD Card IO voltage to 1.8V
*
****************************************************************************/
void board_sdcard_set_low_voltage(void);
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARD_COMMON_INCLUDE_CXD56_SDCARD_H */
@@ -0,0 +1,84 @@
/****************************************************************************
* boards/spresense/include/cxd56_wdt.h
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef __BOARD_COMMON_INCLUDE_CXD56_WDT_H
#define __BOARD_COMMON_INCLUDE_CXD56_WDT_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
/****************************************************************************
* Public Types
****************************************************************************/
#ifndef __ASSEMBLY__
/****************************************************************************
* Public Data
****************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: cxd56_wdt_initialize
*
* Description:
* Initialize WDT on the board.
*
****************************************************************************/
int cxd56_wdt_initialize(void);
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARD_COMMON_INCLUDE_CXD56_WDT_H */
@@ -0,0 +1,150 @@
############################################################################
# boards/spresense/nsh/Make.defs
#
# Copyright (C) 2014 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
include ${TOPDIR}/.config
include ${TOPDIR}/tools/Config.mk
include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs
# Setup for the kind of memory that we are executing from
LDSCRIPT = ramconfig.ld
ifeq ($(WINTOOL),y)
# Windows-native toolchains
DIRLINK = $(TOPDIR)/tools/copydir.sh
DIRUNLINK = $(TOPDIR)/tools/unlink.sh
MKDEP = $(TOPDIR)/tools/mkwindeps.sh
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/boards/$(CONFIG_ARCH)/$(CONFIG_ARCH_CHIP)/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)}"
else
# Linux/Cygwin-native toolchain
MKDEP = $(TOPDIR)/tools/mkdeps$(HOSTEXEEXT)
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
ARCHSCRIPT = -T$(TOPDIR)/boards/$(CONFIG_ARCH)/$(CONFIG_ARCH_CHIP)/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)
endif
CC = $(CROSSDEV)gcc
CXX = $(CROSSDEV)g++
CPP = $(CROSSDEV)gcc -E
LD = $(CROSSDEV)ld
AR = $(ARCROSSDEV)ar rcs
NM = $(ARCROSSDEV)nm
OBJCOPY = $(CROSSDEV)objcopy
OBJDUMP = $(CROSSDEV)objdump
STRIP = $(CROSSDEV)strip
MKNXFLAT = mknxflat
LDNXFLAT = ldnxflat
ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'}
ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1}
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
ARCHOPTIMIZATION = -g
endif
ifneq ($(CONFIG_DEBUG_NOOPT),y)
ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
endif
ARCHCFLAGS = -fno-builtin -mabi=aapcs
ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fno-rtti -std=c++98
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef
ARCHDEFINES =
ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10
CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
# Loadable module definitions
CMODULEFLAGS = $(CFLAGS) -mlong-calls # --target1-abs
LDMODULEFLAGS = -r -e module_initialize
ifeq ($(WINTOOL),y)
LDMODULEFLAGS += -T "${shell cygpath -w $(TOPDIR)/sched/module/gnu-elf.ld}"
else
LDMODULEFLAGS += -T $(TOPDIR)/sched/module/gnu-elf.ld
endif
# ELF module definitions
CELFFLAGS = $(CFLAGS)
CXXELFFLAGS = $(CXXFLAGS)
LDELFFLAGS = -r -e main
ifeq ($(WINTOOL),y)
LDELFFLAGS += -T "${shell cygpath -w $(TOPDIR)/boards/$(CONFIG_ARCH)/$(CONFIG_ARCH_CHIP)/$(CONFIG_ARCH_BOARD)/scripts/gnu-elf.ld}"
else
LDELFFLAGS += -T $(TOPDIR)/boards/$(CONFIG_ARCH)/$(CONFIG_ARCH_CHIP)/$(CONFIG_ARCH_BOARD)/scripts/gnu-elf.ld
endif
ASMEXT = .S
OBJEXT = .o
LIBEXT = .a
EXEEXT =
ifneq ($(CROSSDEV),arm-nuttx-elf-)
LDFLAGS += -nostartfiles -nodefaultlibs
endif
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
CFLAGS += -gdwarf-3
CXXFLAGS += -gdwarf-3
LDFLAGS += -g
endif
# Output map file with cross reference table
ifeq ($(WINTOOL),y)
LDFLAGS += -Map="${shell cygpath -w $(TOPDIR)/nuttx.map}" --cref
else
LDFLAGS += -Map=$(TOPDIR)/nuttx.map --cref
endif
HOSTCC = gcc
HOSTINCLUDES = -I.
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -g -pipe
HOSTLDFLAGS =
@@ -0,0 +1,119 @@
/****************************************************************************
* boards/spresense/scripts/ramconfig.ld
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
MEMORY
{
ram (rwx) : ORIGIN = 0x0d000000, LENGTH = 1536K
}
OUTPUT_ARCH(arm)
ENTRY(__start) /* Treat __start as the anchor for dead code stripping */
EXTERN(_vectors) /* Force the vectors to be included in the output */
EXTERN(__stack) /* Force the __stack to be included in the output */
SECTIONS
{
.text : {
_stext = ABSOLUTE(.);
*(.vectors)
*(.text .text.*)
*(.fixup)
*(.gnu.warning)
*(.rodata .rodata.*)
*(.gnu.linkonce.t.*)
*(.glue_7)
*(.glue_7t)
*(.got)
*(.gcc_except_table)
*(.gnu.linkonce.r.*)
Image$$MODLIST$$Base = .;
KEEP(*(.modulelist))
Image$$MODLIST$$Limit = .;
_etext = ABSOLUTE(.);
} > ram
.init_section : {
_sinit = ABSOLUTE(.);
KEEP(*(.init_array .init_array.*))
_einit = ABSOLUTE(.);
} > ram
.ARM.extab : {
*(.ARM.extab*)
} > ram
__exidx_start = ABSOLUTE(.);
.ARM.exidx : {
*(.ARM.exidx*)
} > ram
__exidx_end = ABSOLUTE(.);
_eronly = ABSOLUTE(.);
.data : {
_sdata = ABSOLUTE(.);
*(.data .data.*)
*(.gnu.linkonce.d.*)
CONSTRUCTORS
_edata = ABSOLUTE(.);
} > ram
.bss : { /* BSS */
_sbss = ABSOLUTE(.);
*(.bss .bss.*)
*(.gnu.linkonce.b.*)
*(COMMON)
_ebss = ABSOLUTE(.);
} > ram
/* __stack symbol is referred from mkspk tool
* and means the end address of heap region */
PROVIDE(__stack = ORIGIN(ram) + LENGTH(ram));
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_info 0 : { *(.debug_info) }
.debug_line 0 : { *(.debug_line) }
.debug_pubnames 0 : { *(.debug_pubnames) }
.debug_aranges 0 : { *(.debug_aranges) }
}
@@ -0,0 +1,2 @@
/.depend
/Make.dep
+136
View File
@@ -0,0 +1,136 @@
############################################################################
# boards/spresense/src/Makefile
#
# Copyright 2018 Sony Semiconductor Solutions Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
-include $(TOPDIR)/Make.defs
DEPPATH = --dep-path .
ASRCS =
CSRCS =
CSRCS += cxd56_main.c
CSRCS += cxd56_boot.c
CSRCS += cxd56_clock.c
CSRCS += cxd56_bringup.c
ifeq ($(CONFIG_LIB_BOARDCTL),y)
CSRCS += cxd56_appinit.c
CSRCS += cxd56_power.c
endif
ifeq ($(CONFIG_BOARDCTL_IOCTL),y)
CSRCS += cxd56_ioctl.c
endif
ifeq ($(CONFIG_BOARDCTL_UNIQUEID),y)
CSRCS += cxd56_uid.c
endif
ifeq ($(CONFIG_ARCH_FPU),y)
CSRCS += cxd56_ostest.c
endif
ifeq ($(CONFIG_ARCH_LEDS),y)
CSRCS += cxd56_leds.c
else
ifeq ($(CONFIG_USERLED),y)
CSRCS += cxd56_userleds.c
endif
endif
ifeq ($(CONFIG_ARCH_BUTTONS),y)
CSRCS += cxd56_buttons.c
endif
ifeq ($(CONFIG_CXD56_GPIO_IRQ),y)
CSRCS += cxd56_gpioif.c
endif
ifeq ($(CONFIG_CXD56_PWM),y)
CSRCS += cxd56_pwm.c
endif
ifeq ($(CONFIG_CXD56_SFC),y)
CSRCS += cxd56_flash.c
endif
ifeq ($(CONFIG_SPI),y)
CSRCS += cxd56_spi.c
endif
ifeq ($(CONFIG_CXD56_SDIO),y)
CSRCS += cxd56_sdcard.c
endif
ifeq ($(CONFIG_CXD56_GAUGE),y)
CSRCS += cxd56_gauge.c
endif
ifeq ($(CONFIG_CXD56_CHARGER),y)
CSRCS += cxd56_charger.c
endif
ifeq ($(CONFIG_USBMSC),y)
CSRCS += cxd56_usbmsc.c
endif
ifeq ($(CONFIG_USBDEV_COMPOSITE),y)
CSRCS += cxd56_composite.c
endif
ifeq ($(CONFIG_NETDEVICES),y)
CSRCS += cxd56_netinit.c
endif
ifeq ($(CONFIG_WL_GS2200M),y)
CSRCS += cxd56_gs2200m.c
endif
ifeq ($(CONFIG_SENSORS_BMI160_I2C),y)
CSRCS += cxd56_bmi160_i2c.c
endif
ifeq ($(CONFIG_CXD56_I2C_DRIVER),y)
CSRCS += cxd56_i2cdev.c
endif
ifeq ($(CONFIG_LCD_LPM013M091A),y)
CSRCS += cxd56_lpm013m091a.c
endif
ifeq ($(CONFIG_LCD_ILI9340),y)
CSRCS += cxd56_ili9340.c
endif
include $(TOPDIR)/boards/Board.mk
@@ -0,0 +1,94 @@
/****************************************************************************
* boards/spresense/src/cxd56_appinit.c
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <nuttx/board.h>
#include "spresense.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#ifndef OK
# define OK 0
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_app_initialize
*
* Description:
* Perform application specific initialization. This function is never
* called directly from application code, but only indirectly via the
* (non-standard) boardctl() interface using the command BOARDIOC_INIT.
*
* Input Parameters:
* arg - The boardctl() argument is passed to the board_app_initialize()
* implementation without modification. The argument has no
* meaning to NuttX; the meaning of the argument is a contract
* between the board-specific initialization logic and the
* matching application logic. The value cold be such things as a
* mode enumeration value, a set of DIP switch switch settings, a
* pointer to configuration data read from a file or serial FLASH,
* or whatever you would like to do with it. Every implementation
* should accept zero/NULL as a default configuration.
*
* Returned Value:
* Zero (OK) is returned on success; a negated errno value is returned on
* any failure to indicate the nature of the failure.
*
****************************************************************************/
int board_app_initialize(uintptr_t arg)
{
#ifdef CONFIG_BOARD_LATE_INITIALIZE
/* Board initialization already performed by board_late_initialize() */
return OK;
#else
/* Perform board-specific initialization */
return cxd56_bringup();
#endif
}
@@ -0,0 +1,86 @@
/****************************************************************************
* boards/spresense/src/cxd56_bmi160_i2c.c
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdio.h>
#include <debug.h>
#include <errno.h>
#include <nuttx/board.h>
#include <nuttx/sensors/bmi160.h>
#include "cxd56_i2c.h"
#ifdef CONFIG_CXD56_DECI_GYRO
#define GYRO_NR_SEQS 3
#else
#define GYRO_NR_SEQS 1
#endif
#ifdef CONFIG_CXD56_DECI_ACCEL
#define ACCEL_NR_SEQS 3
#else
#define ACCEL_NR_SEQS 1
#endif
int board_bmi160_initialize(int bus)
{
int ret;
FAR struct i2c_master_s *i2c;
sninfo("Initializing BMI160..\n");
/* Initialize i2c deivce */
i2c = cxd56_i2cbus_initialize(bus);
if (!i2c)
{
snerr("ERROR: Failed to initialize i2c%d.\n", bus);
return -ENODEV;
}
ret = bmi160_register("/dev/accel0", i2c);
if (ret < 0)
{
snerr("Error registering BMI160\n");
}
return ret;
}
@@ -0,0 +1,71 @@
/****************************************************************************
* boards/spresense/src/cxd56_boot.c
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <debug.h>
#include <nuttx/board.h>
#include <arch/board/board.h>
#include "up_arch.h"
#include "up_internal.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: cxd56_boardinitialize
*
* Description:
*
****************************************************************************/
void cxd56_boardinitialize(void)
{
}
@@ -0,0 +1,385 @@
/****************************************************************************
* boards/spresense/src/cxd56_bringup.c
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdio.h>
#include <sys/mount.h>
#include <sys/types.h>
#include <errno.h>
#include <debug.h>
#include <nuttx/arch.h>
#include <nuttx/board.h>
#include <arch/board/board.h>
#ifdef CONFIG_RNDIS
#include <nuttx/usb/rndis.h>
#endif
#ifdef CONFIG_USERLED_LOWER
#include <nuttx/leds/userled.h>
#endif
#include <arch/chip/pm.h>
#include "chip.h"
#include "cxd56_sysctl.h"
#include "cxd56_powermgr.h"
#include "cxd56_uart.h"
#include "cxd56_timerisr.h"
#include "cxd56_gpio.h"
#include "cxd56_pinconfig.h"
#ifdef CONFIG_CXD56_PM_PROCFS
# include "cxd56_powermgr_procfs.h"
#endif
#ifdef CONFIG_TIMER
# include "cxd56_timer.h"
#endif
#ifdef CONFIG_WDT
# include "cxd56_wdt.h"
#endif
#ifdef CONFIG_CXD56_RTC
# include <nuttx/timers/rtc.h>
# include "cxd56_rtc.h"
#endif
#ifdef CONFIG_CXD56_CPUFIFO
# include "cxd56_cpufifo.h"
#endif
#ifdef CONFIG_CXD56_ICC
# include "cxd56_icc.h"
#endif
#ifdef CONFIG_CXD56_FARAPI
# include "cxd56_farapi.h"
#endif
#if defined(CONFIG_USBDEV) && defined(CONFIG_FS_PROCFS_REGISTER)
# include "cxd56_usbdev.h"
#endif
#ifdef CONFIG_PWM
# include "cxd56_pwm.h"
#endif
#ifdef CONFIG_CXD56_ADC
# include <arch/chip/adc.h>
#endif
#include "spresense.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Configuration ************************************************************/
/* procfs File System */
#ifdef CONFIG_FS_PROCFS
#ifdef CONFIG_NSH_PROC_MOUNTPOINT
#define CXD56_PROCFS_MOUNTPOINT CONFIG_NSH_PROC_MOUNTPOINT
#else
#define CXD56_PROCFS_MOUNTPOINT "/proc"
#endif
#endif
/****************************************************************************
* Private Functions
****************************************************************************/
#ifdef CONFIG_CXD56_CPUFIFO
static int nsh_cpucom_initialize(void)
{
int ret = OK;
cxd56_cfinitialize();
#ifdef CONFIG_CXD56_ICC
cxd56_iccinitialize();
#endif
#ifdef CONFIG_CXD56_FARAPI
cxd56_farapiinitialize();
#endif
cxd56_sysctlinitialize();
return ret;
}
#else
# define nsh_cpucom_initialize() (OK)
#endif
#ifdef CONFIG_TIMER
static void timer_initialize(void)
{
int i;
char devname[16];
for (i = 0; i < CXD56_TIMER_NUM; i++)
{
snprintf(devname, sizeof(devname), "/dev/timer%d", i);
cxd56_timer_initialize(devname, i);
}
return;
}
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: cxd56_bringup
*
* Description:
* Perform architecture-specific initialization
*
* CONFIG_BOARD_LATE_INITIALIZE=y :
* Called from board_late_initialize().
*
* CONFIG_BOARD_LATE_INITIALIZE=n && CONFIG_LIB_BOARDCTL=y :
* Called from the NSH library
*
****************************************************************************/
int cxd56_bringup(void)
{
struct pm_cpu_wakelock_s wlock;
int ret;
ret = nsh_cpucom_initialize();
if (ret < 0)
{
_err("ERROR: Failed to initialize cpucom.\n");
}
ret = cxd56_pm_initialize();
if (ret < 0)
{
_err("ERROR: Failed to initialize powermgr.\n");
}
#ifdef CONFIG_CXD56_PM_PROCFS
ret = cxd56_pm_initialize_procfs();
if (ret < 0)
{
_err("ERROR: Failed to initialize powermgr.\n");
}
#endif
wlock.info = PM_CPUWAKELOCK_TAG('C', 'A', 0);
wlock.count = 0;
up_pm_acquire_wakelock(&wlock);
#ifdef CONFIG_RTC_DRIVER
rtc_initialize(0, cxd56_rtc_lowerhalf());
#endif
#ifdef CONFIG_TIMER
timer_initialize();
#endif
#ifdef CONFIG_CXD56_WDT
ret = cxd56_wdt_initialize();
if (ret < 0)
{
_err("ERROR: Failed to initialize WDT.\n");
}
#endif
#ifdef CONFIG_CXD56_I2C_DRIVER
#ifdef CONFIG_CXD56_I2C0
ret = board_i2cdev_initialize(0);
if (ret < 0)
{
_err("ERROR: Failed to initialize I2C0.\n");
}
#endif
#ifdef CONFIG_CXD56_I2C1
ret = board_i2cdev_initialize(1);
if (ret < 0)
{
_err("ERROR: Failed to initialize I2C1.\n");
}
#endif
#ifdef CONFIG_CXD56_I2C2
ret = board_i2cdev_initialize(2);
if (ret < 0)
{
_err("ERROR: Failed to initialize I2C2.\n");
}
#endif
#endif
cxd56_uart_initialize();
cxd56_timerisr_initialize();
#ifdef CONFIG_CXD56_CPUFIFO
ret = cxd56_pm_bootup();
if (ret < 0)
{
_err("ERROR: Failed to powermgr bootup.\n");
}
#endif
/* Initialize CPU clock to max frequency */
board_clock_initialize();
/* Setup the power of external device */
board_power_setup(0);
#ifdef CONFIG_FS_PROCFS
#if defined(CONFIG_USBDEV) && defined(CONFIG_FS_PROCFS_REGISTER)
/* Register usbdev procfs */
ret = cxd56_usbdev_procfs_register();
if (ret < 0)
{
_err("ERROR: Failed to register usbdev.\n");
}
#endif
ret = mount(NULL, CXD56_PROCFS_MOUNTPOINT, "procfs", 0, NULL);
if (ret < 0)
{
_err("ERROR: Failed to mount the procfs: %d\n", errno);
}
#endif
#ifdef CONFIG_PWM
ret = board_pwm_setup();
if (ret < 0)
{
_err("ERROR: Failed to initialze pwm. \n");
}
#endif
#ifdef CONFIG_CXD56_ADC
ret = cxd56_adcinitialize();
if (ret < 0)
{
_err("ERROR: Failed to initialze adc. \n");
}
#endif
#ifdef CONFIG_USERLED_LOWER
ret = userled_lower_initialize("/dev/userleds");
if (ret < 0)
{
_err("ERROR: Failed to initialze led. \n");
}
#endif
#ifdef CONFIG_CXD56_SFC
ret = board_flash_initialize();
if (ret < 0)
{
_err("ERROR: Failed to initialze SPI-Flash. %d\n", errno);
}
#endif
/* In order to prevent Hi-Z from being input to the SD Card controller,
* Initialize SDIO pins to GPIO low output with internal pull-down.
*/
CXD56_PIN_CONFIGS(PINCONFS_SDIOA_GPIO);
cxd56_gpio_write(PIN_SDIO_CLK, false);
cxd56_gpio_write(PIN_SDIO_CMD, false);
cxd56_gpio_write(PIN_SDIO_DATA0, false);
cxd56_gpio_write(PIN_SDIO_DATA1, false);
cxd56_gpio_write(PIN_SDIO_DATA2, false);
cxd56_gpio_write(PIN_SDIO_DATA3, false);
#if defined(CONFIG_CXD56_SDIO)
ret = board_sdcard_initialize();
if (ret < 0)
{
_err("ERROR: Failed to initialize sdhci. \n");
}
#endif
#ifdef CONFIG_CPUFREQ_RELEASE_LOCK
/* Enable dynamic clock control and CPU clock down for power saving */
board_clock_enable();
#endif
up_pm_release_wakelock(&wlock);
#if defined(CONFIG_RNDIS)
uint8_t mac[6];
mac[0] = 0xa0; /* TODO */
mac[1] = (CONFIG_NETINIT_MACADDR_2 >> (8 * 0)) & 0xff;
mac[2] = (CONFIG_NETINIT_MACADDR_1 >> (8 * 3)) & 0xff;
mac[3] = (CONFIG_NETINIT_MACADDR_1 >> (8 * 2)) & 0xff;
mac[4] = (CONFIG_NETINIT_MACADDR_1 >> (8 * 1)) & 0xff;
mac[5] = (CONFIG_NETINIT_MACADDR_1 >> (8 * 0)) & 0xff;
usbdev_rndis_initialize(mac);
#endif
#ifdef CONFIG_WL_GS2200M
ret = board_gs2200m_initialize("/dev/gs2200m", 5);
if (ret < 0)
{
_err("ERROR: Failed to initialze GS2200M. \n");
}
#endif
#ifdef CONFIG_SENSORS_BMI160_I2C
ret = board_bmi160_initialize(0);
if (ret < 0)
{
_err("ERROR: Failed to initialze BMI160. \n");
}
#endif
return 0;
}
@@ -0,0 +1,96 @@
/****************************************************************************
* boards/spresense/src/cxd56_buttons.c
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
#include <stdbool.h>
#include <debug.h>
#include <nuttx/arch.h>
#include <nuttx/board.h>
#include <nuttx/irq.h>
#include <arch/board/board.h>
#include "cxd56_gpio.h"
#include "cxd56_gpioint.h"
#include "cxd56_pinconfig.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
/* Below functions are template to support the Board button for NuttX original
* feature. If you support the feature, copy this file into your board
* directory and implement the contents.
*/
/****************************************************************************
* Name: board_button_initialize
****************************************************************************/
void board_button_initialize(void)
{
}
/****************************************************************************
* Name: board_buttons
****************************************************************************/
uint32_t board_buttons(void)
{
uint8_t ret = 0;
return ret;
}
/****************************************************************************
* Name: board_button_irq
****************************************************************************/
#ifdef CONFIG_ARCH_IRQBUTTONS
int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg)
{
return OK;
}
#endif
@@ -0,0 +1,104 @@
/****************************************************************************
* boards/spresense/src/cxd56_charger.c
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <debug.h>
#include <stdio.h>
#include <errno.h>
#include "cxd56_charger.h"
#if defined(CONFIG_CXD56_CHARGER)
static int g_chargerinitialized = 0;
/****************************************************************************
* Name: board_charger_initialize
*
* Description:
* Initialize and register battery charger driver
*
****************************************************************************/
int board_charger_initialize(FAR const char *devpath, FAR int16_t *gaugemeter)
{
int ret;
if (!g_chargerinitialized)
{
ret = cxd56_charger_initialize(devpath);
if (ret < 0)
{
_err("ERROR: Failed to initialize charger.\n");
return -ENODEV;
}
g_chargerinitialized = 1;
}
return OK;
}
/****************************************************************************
* Name: board_charger_uninitialize
*
* Description:
* Uninitialize and unregister battery charger driver
*
****************************************************************************/
int board_charger_uninitialize(FAR const char *devpath)
{
int ret;
if (g_chargerinitialized)
{
ret = cxd56_charger_uninitialize(devpath);
if (ret)
{
_err("ERROR: Failed to finalize charger.\n");
return -ENODEV;
}
g_chargerinitialized = 0;
}
return OK;
}
#endif
@@ -0,0 +1,77 @@
/****************************************************************************
* boards/spresense/src/cxd56_clock.c
*
* Copyright 2019 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdio.h>
#include <debug.h>
#include <errno.h>
#include <nuttx/board.h>
#include <arch/board/board.h>
#include <arch/chip/pm.h>
/****************************************************************************
* Private Data
****************************************************************************/
static struct pm_cpu_freqlock_s g_hv_lock =
PM_CPUFREQLOCK_INIT(PM_CPUFREQLOCK_TAG('C','P',0), PM_CPUFREQLOCK_FLAG_HV);
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_clock_initialize
****************************************************************************/
void board_clock_initialize(void)
{
up_pm_acquire_freqlock(&g_hv_lock);
}
/****************************************************************************
* Name: board_clock_enable
****************************************************************************/
void board_clock_enable(void)
{
up_pm_release_freqlock(&g_hv_lock);
}
@@ -0,0 +1,283 @@
/****************************************************************************
* boards/spresense/src/cxd56_composite.c
*
* Copyright (C) 2016, 2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <debug.h>
#include <assert.h>
#include <nuttx/usb/usbdev.h>
#include <nuttx/usb/cdcacm.h>
#include <nuttx/usb/usbmsc.h>
#include <nuttx/usb/composite.h>
#if defined(CONFIG_BOARDCTL_USBDEVCTRL) && defined(CONFIG_USBDEV_COMPOSITE)
/****************************************************************************
* Private Data
****************************************************************************/
#ifdef CONFIG_USBMSC_COMPOSITE
static FAR void *g_mschandle;
#endif
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Name: board_mscclassobject
*
* Description:
* If the mass storage class driver is part of composite device, then
* its instantiation and configuration is a multi-step, board-specific,
* process (See comments for usbmsc_configure below). In this case,
* board-specific logic must provide board_mscclassobject().
*
* board_mscclassobject() is called from the composite driver. It must
* encapsulate the instantiation and configuration of the mass storage
* class and the return the mass storage device's class driver instance
* to the composite driver.
*
* Input Parameters:
* classdev - The location to return the mass storage class' device
* instance.
*
* Returned Value:
* 0 on success; a negated errno on failure
*
****************************************************************************/
#ifdef CONFIG_USBMSC_COMPOSITE
static int board_mscclassobject(int minor,
FAR struct usbdev_devinfo_s *devinfo,
FAR struct usbdevclass_driver_s **classdev)
{
int ret;
DEBUGASSERT(g_mschandle == NULL);
/* Configure the mass storage device */
uinfo("Configuring with NLUNS=1\n");
ret = usbmsc_configure(1, &g_mschandle);
if (ret < 0)
{
uerr("ERROR: usbmsc_configure failed: %d\n", -ret);
return ret;
}
uinfo("MSC handle=%p\n", g_mschandle);
/* Bind the LUN(s) */
uinfo("Bind LUN=0 to /dev/mmcsd0\n");
ret = usbmsc_bindlun(g_mschandle, "/dev/mmcsd0", 0, 0, 0, false);
if (ret < 0)
{
uerr("ERROR: usbmsc_bindlun failed for LUN 1 at /dev/mmcsd0: %d\n",
ret);
usbmsc_uninitialize(g_mschandle);
g_mschandle = NULL;
return ret;
}
/* Get the mass storage device's class object */
ret = usbmsc_classobject(g_mschandle, devinfo, classdev);
if (ret < 0)
{
uerr("ERROR: usbmsc_classobject failed: %d\n", -ret);
usbmsc_uninitialize(g_mschandle);
g_mschandle = NULL;
}
return ret;
}
#endif
/****************************************************************************
* Name: board_mscuninitialize
*
* Description:
* Un-initialize the USB storage class driver. This is just an application-
* specific wrapper aboutn usbmsc_unitialize() that is called form the
* composite device logic.
*
* Input Parameters:
* classdev - The class driver instrance previously give to the composite
* driver by board_mscclassobject().
*
* Returned Value:
* None
*
****************************************************************************/
#ifdef CONFIG_USBMSC_COMPOSITE
static void board_mscuninitialize(FAR struct usbdevclass_driver_s *classdev)
{
DEBUGASSERT(g_mschandle != NULL);
usbmsc_uninitialize(g_mschandle);
g_mschandle = NULL;
}
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_composite_initialize
*
* Description:
* Perform architecture specific initialization of a composite USB device.
*
****************************************************************************/
int board_composite_initialize(int port)
{
return OK;
}
/****************************************************************************
* Name: board_composite_connect
*
* Description:
* Connect the USB composite device on the specified USB device port using
* the specified configuration. The interpretation of the configid is
* board specific.
*
* Input Parameters:
* port - The USB device port.
* configid - The USB composite configuration
*
* Returned Value:
* A non-NULL handle value is returned on success. NULL is returned on
* any failure.
*
****************************************************************************/
FAR void *board_composite_connect(int port, int configid)
{
/* Here we are composing the configuration of the usb composite device.
*
* The standard is to use one CDC/ACM and one USB mass storage device.
*/
if (configid == 0)
{
#ifdef CONFIG_USBMSC_COMPOSITE
struct composite_devdesc_s dev[2];
int ifnobase = 0;
int strbase = COMPOSITE_NSTRIDS;
/* Configure the mass storage device device */
/* Ask the usbmsc driver to fill in the constants we didn't
* know here.
*/
usbmsc_get_composite_devdesc(&dev[0]);
/* Overwrite and correct some values... */
/* The callback functions for the USBMSC class */
dev[0].classobject = board_mscclassobject;
dev[0].uninitialize = board_mscuninitialize;
/* Interfaces */
dev[0].devinfo.ifnobase = ifnobase; /* Offset to Interface-IDs */
dev[0].minor = 0; /* The minor interface number */
/* Strings */
dev[0].devinfo.strbase = strbase; /* Offset to String Numbers */
/* Endpoints */
dev[0].devinfo.epno[USBMSC_EP_BULKIN_IDX] = 1;
dev[0].devinfo.epno[USBMSC_EP_BULKOUT_IDX] = 2;
/* Count up the base numbers */
ifnobase += dev[0].devinfo.ninterfaces;
strbase += dev[0].devinfo.nstrings;
/* Configure the CDC/ACM device */
/* Ask the cdcacm driver to fill in the constants we didn't
* know here.
*/
cdcacm_get_composite_devdesc(&dev[1]);
/* Overwrite and correct some values... */
/* The callback functions for the CDC/ACM class */
dev[1].classobject = cdcacm_classobject;
dev[1].uninitialize = cdcacm_uninitialize;
/* Interfaces */
dev[1].devinfo.ifnobase = ifnobase; /* Offset to Interface-IDs */
dev[1].minor = 0; /* The minor interface number */
/* Strings */
dev[1].devinfo.strbase = strbase; /* Offset to String Numbers */
/* Endpoints */
dev[1].devinfo.epno[CDCACM_EP_INTIN_IDX] = 3;
dev[1].devinfo.epno[CDCACM_EP_BULKIN_IDX] = 4;
dev[1].devinfo.epno[CDCACM_EP_BULKOUT_IDX] = 5;
return composite_initialize(2, dev);
#else
return NULL;
#endif
}
else
{
return NULL;
}
}
#endif /* CONFIG_BOARDCTL_USBDEVCTRL && CONFIG_USBDEV_COMPOSITE */
@@ -0,0 +1,133 @@
/****************************************************************************
* boards/spresense/src/cxd56_flash.c
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdio.h>
#include <errno.h>
#include <debug.h>
#include <sys/mount.h>
#include <nuttx/board.h>
#include <arch/board/board.h>
#include <nuttx/mtd/mtd.h>
#ifdef CONFIG_FS_NXFFS
# include <nuttx/fs/nxffs.h>
#endif
#include "cxd56_sfc.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#ifndef CONFIG_SFC_DEVNO
# define CONFIG_SFC_DEVNO 0
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_flash_initialize
*
* Description:
* Initialize the SPI-Flash device and mount the file system.
*
****************************************************************************/
int board_flash_initialize(void)
{
int ret;
FAR struct mtd_dev_s *mtd;
mtd = cxd56_sfc_initialize();
if (!mtd)
{
ferr("ERROR: Failed to initialize SFC. %d\n ", ret);
return -ENODEV;
}
/* use the FTL layer to wrap the MTD driver as a block driver */
ret = ftl_initialize(CONFIG_SFC_DEVNO, mtd);
if (ret < 0)
{
ferr("ERROR: Initializing the FTL layer: %d\n", ret);
return ret;
}
#if defined(CONFIG_FS_SMARTFS)
/* Initialize to provide SMARTFS on the MTD interface */
ret = smart_initialize(CONFIG_SFC_DEVNO, mtd, NULL);
if (ret < 0)
{
ferr("ERROR: SmartFS initialization failed: %d\n", ret);
return ret;
}
ret = mount("/dev/smart0d1", "/mnt/spif", "smartfs", 0, NULL);
if (ret < 0)
{
ferr("ERROR: Failed to mount the SmartFS volume: %d\n", errno);
return ret;
}
#elif defined(CONFIG_FS_NXFFS)
/* Initialize to provide NXFFS on the MTD interface */
ret = nxffs_initialize(mtd);
if (ret < 0)
{
ferr("ERROR: NXFFS initialization failed: %d\n", ret);
return ret;
}
ret = mount(NULL, "/mnt/spif", "nxffs", 0, NULL);
if (ret < 0)
{
ferr("ERROR: Failed to mount the NXFFS volume: %d\n", errno);
return ret;
}
#endif
return OK;
}
@@ -0,0 +1,104 @@
/****************************************************************************
* boards/spresense/src/cxd56_gauge.c
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <debug.h>
#include <stdio.h>
#include <errno.h>
#include "cxd56_gauge.h"
#if defined(CONFIG_CXD56_GAUGE)
static int g_gaugeinitialized = 0;
/****************************************************************************
* Name: board_gauge_initialize
*
* Description:
* Initialize and register battery gauge driver
*
****************************************************************************/
int board_gauge_initialize(FAR const char *devpath, FAR int16_t *gaugemeter)
{
int ret;
if (!g_gaugeinitialized)
{
ret = cxd56_gauge_initialize(devpath);
if (ret < 0)
{
_err("ERROR: Failed to initialize gauge.\n");
return -ENODEV;
}
g_gaugeinitialized = 1;
}
return OK;
}
/****************************************************************************
* Name: board_gauge_uninitialize
*
* Description:
* Uninitialize and unregister battery gauge driver
*
****************************************************************************/
int board_gauge_uninitialize(FAR const char *devpath)
{
int ret;
if (g_gaugeinitialized)
{
ret = cxd56_gauge_uninitialize(devpath);
if (ret)
{
_err("ERROR: Failed to finalize gauge.\n");
return -ENODEV;
}
g_gaugeinitialized = 0;
}
return OK;
}
#endif
@@ -0,0 +1,285 @@
/****************************************************************************
* boards/spresense/src/cxd56_gpioif.c
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdio.h>
#include <debug.h>
#include <errno.h>
#include <nuttx/board.h>
#include <arch/board/board.h>
#include "cxd56_pinconfig.h"
#include "cxd56_gpio.h"
#include "cxd56_gpioint.h"
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_gpio_config
****************************************************************************/
int board_gpio_config(uint32_t pin, int mode, bool input, bool drive,
int pull)
{
uint32_t pinconf;
pinconf = PINCONF_SET_PIN(pin);
pinconf |= (input) ? PINCONF_INPUT_ENABLE : PINCONF_INPUT_DISABLE;
pinconf |= (drive) ? PINCONF_DRIVE_HIGH : PINCONF_DRIVE_NORMAL;
switch (pull)
{
case PIN_PULLUP:
pinconf |= PINCONF_PULLUP;
break;
case PIN_PULLDOWN:
pinconf |= PINCONF_PULLDOWN;
break;
case PIN_BUSKEEPER:
pinconf |= PINCONF_BUSKEEPER;
break;
default:
case PIN_FLOAT:
pinconf |= PINCONF_FLOAT;
break;
}
pinconf |= PINCONF_SET_MODE(mode);
return cxd56_pin_config(pinconf);
}
/****************************************************************************
* Name: board_gpio_status
****************************************************************************/
int board_gpio_status(uint32_t pin, bool *input, bool *output, bool *drive,
int *pull)
{
int ret;
cxd56_pin_status_t pstat;
cxd56_gpio_status_t gstat;
DEBUGASSERT(input);
DEBUGASSERT(output);
DEBUGASSERT(drive);
DEBUGASSERT(pull);
ret = cxd56_pin_status(pin, &pstat);
if (ret < 0)
{
return ret;
}
*input = PINCONF_INPUT_ENABLED(pstat.input_en);
*drive = PINCONF_IS_DRIVE_HIGH(pstat.drive);
if (PINCONF_IS_FLOAT(pstat.pull))
{
*pull = PIN_FLOAT;
}
else if (PINCONF_IS_PULLUP(pstat.pull))
{
*pull = PIN_PULLUP;
}
else if (PINCONF_IS_PULLDOWN(pstat.pull))
{
*pull = PIN_PULLDOWN;
}
else
{
*pull = PIN_BUSKEEPER;
}
cxd56_gpio_status(pin, &gstat);
*output = gstat.output_en;
return pstat.mode;
}
/****************************************************************************
* Name: board_gpio_write
****************************************************************************/
void board_gpio_write(uint32_t pin, int value)
{
if (value < 0)
{
cxd56_gpio_write_hiz(pin);
}
else
{
cxd56_gpio_write(pin, (value > 0));
}
return;
}
/****************************************************************************
* Name: board_gpio_read
****************************************************************************/
int board_gpio_read(uint32_t pin)
{
return (int)cxd56_gpio_read(pin);
}
/****************************************************************************
* Name: board_gpio_intconfig
****************************************************************************/
int board_gpio_intconfig(uint32_t pin, int mode, bool filter, xcpt_t isr)
{
#ifdef CONFIG_CXD56_GPIO_IRQ
int ret = OK;
uint32_t gpiocfg = 0;
switch (mode)
{
case INT_HIGH_LEVEL:
gpiocfg = GPIOINT_LEVEL_HIGH;
break;
case INT_LOW_LEVEL:
gpiocfg = GPIOINT_LEVEL_LOW;
break;
case INT_RISING_EDGE:
gpiocfg = GPIOINT_PSEUDO_EDGE_RISE;
break;
case INT_FALLING_EDGE:
gpiocfg = GPIOINT_PSEUDO_EDGE_FALL;
break;
case INT_BOTH_EDGE:
gpiocfg = GPIOINT_PSEUDO_EDGE_BOTH;
break;
default:
if (isr)
{
return -EINVAL;
}
break;
}
if (filter)
{
gpiocfg |= GPIOINT_NOISE_FILTER_ENABLE;
}
ret = cxd56_gpioint_config(pin, gpiocfg, isr, NULL);
return ret;
#else
return -ENOTSUP;
#endif
}
/****************************************************************************
* Name: board_gpio_intstatus
****************************************************************************/
int board_gpio_intstatus(uint32_t pin, int *mode, bool *filter, bool *enabled)
{
#ifdef CONFIG_CXD56_GPIO_IRQ
int ret;
cxd56_gpioint_status_t stat;
DEBUGASSERT(mode);
DEBUGASSERT(filter);
DEBUGASSERT(enabled);
ret = cxd56_gpioint_status(pin, &stat);
if (ret < 0)
{
return ret;
}
switch (stat.polarity)
{
case GPIOINT_LEVEL_HIGH:
*mode = INT_HIGH_LEVEL;
break;
case GPIOINT_LEVEL_LOW:
*mode = INT_LOW_LEVEL;
break;
case GPIOINT_EDGE_RISE:
*mode = INT_RISING_EDGE;
break;
case GPIOINT_EDGE_FALL:
*mode = INT_FALLING_EDGE;
break;
case GPIOINT_EDGE_BOTH:
*mode = INT_BOTH_EDGE;
break;
default:
*mode = 0;
break;
}
*filter = stat.filter;
*enabled = stat.enable;
return stat.irq;
#else
return -ENOTSUP;
#endif
}
/****************************************************************************
* Name: board_gpio_int
****************************************************************************/
int board_gpio_int(uint32_t pin, bool enable)
{
#ifdef CONFIG_CXD56_GPIO_IRQ
int irq = cxd56_gpioint_irq(pin);
if (irq > 0)
{
if (enable)
{
cxd56_gpioint_enable(pin);
}
else
{
cxd56_gpioint_disable(pin);
}
}
return irq;
#else
return -ENOTSUP;
#endif
}
@@ -0,0 +1,248 @@
/****************************************************************************
* boards/spresense/src/cxd56_gs2200m.c
*
* Copyright 2019 Sony Home Entertainment & Sound Products Inc.
* Author: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <debug.h>
#include <nuttx/arch.h>
#include <nuttx/config.h>
#include <nuttx/board.h>
#include <nuttx/spi/spi.h>
#include <nuttx/irq.h>
#include <nuttx/wireless/gs2200m.h>
#include <arch/chip/pin.h>
#include "cxd56_pinconfig.h"
#include "cxd56_spi.h"
#include "cxd56_gpio.h"
#include "cxd56_gpioint.h"
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
static int gs2200m_irq_attach(xcpt_t, FAR void *);
static void gs2200m_irq_enable(void);
static void gs2200m_irq_disable(void);
static uint32_t gs2200m_dready(int *);
/****************************************************************************
* Private Data
****************************************************************************/
static const struct gs2200m_lower_s g_wifi_lower =
{
.attach = gs2200m_irq_attach,
.enable = gs2200m_irq_enable,
.disable = gs2200m_irq_disable,
.dready = gs2200m_dready,
};
static FAR void *g_devhandle = NULL;
static volatile int32_t _enable_count = 0;
static volatile uint32_t _n_called;
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Name: gs2200m_irq_attach
****************************************************************************/
static int gs2200m_irq_attach(xcpt_t handler, FAR void *arg)
{
(void)cxd56_gpioint_config(PIN_UART2_CTS,
GPIOINT_LEVEL_HIGH,
handler,
arg);
return 0;
}
/****************************************************************************
* Name: gs2200m_irq_enable
****************************************************************************/
static void gs2200m_irq_enable(void)
{
irqstate_t flags = spin_lock_irqsave();
wlinfo("== ec:%d called=%d \n", _enable_count, _n_called++);
if (1 == _enable_count)
{
/* NOTE: This would happen if we received an event */
return;
}
_enable_count++;
if (1 == _enable_count)
{
cxd56_gpioint_enable(PIN_UART2_CTS);
}
spin_unlock_irqrestore(flags);
}
/****************************************************************************
* Name: gs2200m_irq_disable
****************************************************************************/
static void gs2200m_irq_disable(void)
{
irqstate_t flags = spin_lock_irqsave();
wlinfo("== ec:%d called=%d \n", _enable_count, _n_called++);
_enable_count--;
if (0 == _enable_count)
{
cxd56_gpioint_disable(PIN_UART2_CTS);
}
spin_unlock_irqrestore(flags);
}
/****************************************************************************
* Name: gs2200m_disable
****************************************************************************/
static uint32_t gs2200m_dready(int *ec)
{
irqstate_t flags = spin_lock_irqsave();
uint32_t r = cxd56_gpio_read(PIN_UART2_CTS);
if (ec)
{
/* Copy enable count (just for debug) */
*ec = _enable_count;
}
spin_unlock_irqrestore(flags);
return r;
}
/****************************************************************************
* Name: spi_pincontrol
*
* Description:
* Configure the SPI pin
*
* Input Parameter:
* on - true: enable pin, false: disable pin
****************************************************************************/
static void spi_pincontrol(int bus, bool on)
{
if (bus == 5)
{
#ifdef CONFIG_CXD56_SPI5_PINMAP_EMMC
if (on)
{
CXD56_PIN_CONFIGS(PINCONFS_EMMCA_SPI5);
}
else
{
CXD56_PIN_CONFIGS(PINCONFS_EMMCA_GPIO);
}
#endif
#ifdef CONFIG_CXD56_SPI5_PINMAP_SDIO
if (on)
{
CXD56_PIN_CONFIGS(PINCONFS_SDIOA_SPI5);
}
else
{
CXD56_PIN_CONFIGS(PINCONFS_SDIOA_GPIO);
}
#endif
}
}
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_gs2200m_initialize
****************************************************************************/
int board_gs2200m_initialize(FAR const char *devpath, int bus)
{
FAR struct spi_dev_s *spi;
wlinfo("Initializing GS2200M..\n");
if (!g_devhandle)
{
/* Change UART2 to GPIO */
CXD56_PIN_CONFIGS(PINCONFS_UART2_GPIO);
(void)cxd56_gpio_config(PIN_UART2_CTS, true);
/* Initialize spi deivce */
spi = cxd56_spibus_initialize(bus);
if (!spi)
{
wlerr("ERROR: Failed to initialize spi%d.\n", bus);
return -ENODEV;
}
/* Enable SPI5 */
spi_pincontrol(5, true);
g_devhandle = gs2200m_register(devpath, spi, &g_wifi_lower);
if (!g_devhandle)
{
wlerr("ERROR: Failed to register gs2200m driver.\n");
return -ENODEV;
}
}
return OK;
}
@@ -0,0 +1,79 @@
/****************************************************************************
* boards/spresense/src/cxd56_i2cdev.c
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdio.h>
#include <debug.h>
#include <errno.h>
#include "cxd56_i2c.h"
/****************************************************************************
* Name: board_i2cdev_initialize
*
* Description:
* Initialize and register i2c driver for the specified i2c port
*
****************************************************************************/
int board_i2cdev_initialize(int port)
{
int ret;
FAR struct i2c_master_s *i2c;
_info("Initializing /dev/i2c%d..\n", port);
/* Initialize i2c deivce */
i2c = cxd56_i2cbus_initialize(port);
if (!i2c)
{
_err("ERROR: Failed to initialize i2c%d.\n", port);
return -ENODEV;
}
ret = i2c_register(i2c, port);
if (ret < 0)
{
_err("ERROR: Failed to register i2c%d: %d\n", port, ret);
}
return ret;
}
@@ -0,0 +1,398 @@
/****************************************************************************
* boards/spresense/src/cxd56_ili9340.c
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include <errno.h>
#include <debug.h>
#include <nuttx/arch.h>
#include <nuttx/board.h>
#include <nuttx/spi/spi.h>
#include <nuttx/lcd/lcd.h>
#include <nuttx/lcd/ili9340.h>
#include <arch/board/board.h>
#include "cxd56_gpio.h"
#include "cxd56_spi.h"
#include "cxd56_pinconfig.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Check if the following are defined in the board.h */
#ifndef DISPLAY_RST
# error "DISPLAY_RST must be defined in board.h !!"
#endif
#ifndef DISPLAY_DC
# error "DISPLAY_DC must be defined in board.h !!"
#endif
#ifndef DISPLAY_SPI
# error "DISPLAY_SPI must be defined in board.h !!"
#endif
/****************************************************************************
* Private Type Definition
****************************************************************************/
#ifndef ILI9340_SPI_MAXFREQUENCY
# define ILI9340_SPI_MAXFREQUENCY 20000000
#endif
/****************************************************************************
* Private Function Protototypes
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
struct ili93404ws_lcd_s
{
struct ili9340_lcd_s dev;
struct spi_dev_s *spi;
};
static struct ili93404ws_lcd_s g_lcddev;
static struct lcd_dev_s *g_lcd = NULL;
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Name: cxd56_ili93404ws_select
*
* Description:
* Select the SPI, locking and re-configuring if necessary
*
* Input Parameters:
* spi - Reference to the public driver structure
*
* Returned Value:
*
****************************************************************************/
static void cxd56_ili93404ws_select(FAR struct ili9340_lcd_s *lcd)
{
FAR struct ili93404ws_lcd_s *priv = (FAR struct ili93404ws_lcd_s *)lcd;
SPI_LOCK(priv->spi, true);
SPI_SELECT(priv->spi, SPIDEV_DISPLAY(0), true);
}
/****************************************************************************
* Name: cxd56_ili93404ws_deselect
*
* Description:
* De-select the SPI
*
* Input Parameters:
* spi - Reference to the public driver structure
*
* Returned Value:
*
****************************************************************************/
static void cxd56_ili93404ws_deselect(FAR struct ili9340_lcd_s *lcd)
{
FAR struct ili93404ws_lcd_s *priv = (FAR struct ili93404ws_lcd_s *)lcd;
SPI_SELECT(priv->spi, SPIDEV_DISPLAY(0), false);
SPI_LOCK(priv->spi, false);
}
/****************************************************************************
* Name: cxd56_ili93404ws_backlight
*
* Description:
* Set the backlight level of the connected display.
*
* Input Parameters:
* spi - Reference to the public driver structure
* level - backligth level
*
* Returned Value:
* OK - On Success
*
****************************************************************************/
static int cxd56_ili93404ws_backlight(FAR struct ili9340_lcd_s *lcd,
int level)
{
if (level > 0)
{
lcd->sendcmd(lcd, ILI9340_WRITE_CTRL_DISPLAY);
lcd->sendparam(lcd, 0x24);
}
else
{
lcd->sendcmd(lcd, ILI9340_WRITE_CTRL_DISPLAY);
lcd->sendparam(lcd, 0x0);
}
return OK;
}
/****************************************************************************
* Name: cxd56_ili93404ws_sendcmd
*
* Description:
* Send a command to the lcd driver.
*
* Input Parameters:
* lcd - Reference to the ili9340_lcd_s driver structure
* cmd - command to send
*
* Returned Value:
* On success - OK
*
****************************************************************************/
static int cxd56_ili93404ws_sendcmd(FAR struct ili9340_lcd_s *lcd,
const uint8_t cmd)
{
FAR struct ili93404ws_lcd_s *priv = (FAR struct ili93404ws_lcd_s *)lcd;
lcdinfo("%02x\n", cmd);
SPI_SETBITS(priv->spi, 8);
/* FIXME: This function can be replaced with SPI_CMDDATA().
* This feature is needed to enable CONFIG_SPI_CMDDATA and board specific
* cmddata() function.
*/
cxd56_gpio_write(DISPLAY_DC, false); /* Indicate CMD */
(void) SPI_SEND(priv->spi, cmd);
cxd56_gpio_write(DISPLAY_DC, true); /* Indicate DATA */
return OK;
}
/****************************************************************************
* Name: cxd56_ili93404ws_sendparam
*
* Description:
* Send a parameter to the lcd driver.
*
* Input Parameters:
* lcd - Reference to the ili9340_lcd_s driver structure
* param - parameter to send
*
* Returned Value:
* OK - On Success
*
****************************************************************************/
static int cxd56_ili93404ws_sendparam(FAR struct ili9340_lcd_s *lcd,
const uint8_t param)
{
FAR struct ili93404ws_lcd_s *priv = (FAR struct ili93404ws_lcd_s *)lcd;
cxd56_gpio_write(DISPLAY_DC, true); /* Indicate DATA */
(void) SPI_SEND(priv->spi, param);
return OK;
}
/****************************************************************************
* Name: cxd56_ili93404ws_sendgram
*
* Description:
* Send a number of pixel words to the lcd driver gram.
*
* Input Parameters:
* lcd - Reference to the ili9340_lcd_s driver structure
* wd - Reference to the words to send
* nwords - number of words to send
*
* Returned Value:
* OK - On Success
*
****************************************************************************/
static int cxd56_ili93404ws_sendgram(FAR struct ili9340_lcd_s *lcd,
const uint16_t *wd, uint32_t nwords)
{
FAR struct ili93404ws_lcd_s *priv = (FAR struct ili93404ws_lcd_s *)lcd;
lcdinfo("lcd:%p, wd=%p, nwords=%d\n", lcd, wd, nwords);
SPI_SETBITS(priv->spi, 16);
(void) SPI_SNDBLOCK(priv->spi, wd, nwords);
return OK;
}
/****************************************************************************
* Name: cxd56_ili93404ws_recvparam
*
* Description:
* Receive a parameter from the lcd driver.
*
* Input Parameters:
* lcd - Reference to the ili9340_lcd_s driver structure
* param - Reference to where parameter receive
*
* Returned Value:
* OK - On Success
*
****************************************************************************/
static int cxd56_ili93404ws_recvparam(FAR struct ili9340_lcd_s *lcd,
uint8_t *param)
{
FAR struct ili93404ws_lcd_s *priv = (FAR struct ili93404ws_lcd_s *)lcd;
cxd56_gpio_write(DISPLAY_DC, true); /* Indicate DATA */
*param = (uint8_t)(SPI_SEND(priv->spi, param) & 0xff);
return OK;
}
/****************************************************************************
* Name: cxd56_ili93404ws_recvgram
*
* Description:
* Receive pixel words from the lcd driver gram.
*
* Input Parameters:
* lcd - Reference to the public driver structure
* wd - Reference to where the pixel words receive
* nwords - number of pixel words to receive
*
* Returned Value:
* OK - On Success
*
****************************************************************************/
static int cxd56_ili93404ws_recvgram(FAR struct ili9340_lcd_s *lcd,
uint16_t *wd, uint32_t nwords)
{
lcdinfo("wd=%p, nwords=%d\n", wd, nwords);
return OK;
};
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_lcd_initialize
*
* Description:
* Initialize the LCD video hardware. The initial state of the LCD is
* fully initialized, display memory cleared, and the LCD ready to use,
* but with the power setting at 0 (full off).
*
****************************************************************************/
int board_lcd_initialize(void)
{
FAR struct ili93404ws_lcd_s *priv = &g_lcddev;
FAR struct spi_dev_s *spi;
lcdinfo("Initializing lcd\n");
if (g_lcd == NULL)
{
spi = cxd56_spibus_initialize(DISPLAY_SPI);
if (!spi)
{
lcderr("ERROR: Failed to initialize spi bus.\n");
return -ENODEV;
}
priv->spi = spi;
/* Reset ILI9340 */
up_mdelay(10);
cxd56_gpio_write(DISPLAY_RST, false);
up_mdelay(10);
cxd56_gpio_write(DISPLAY_RST, true);
up_mdelay(50);
/* Configure SPI */
SPI_SETMODE(priv->spi, SPIDEV_MODE3);
SPI_SETBITS(priv->spi, 8);
(void)SPI_HWFEATURES(priv->spi, 0);
(void)SPI_SETFREQUENCY(priv->spi, ILI9340_SPI_MAXFREQUENCY);
/* Initialize ILI9340 driver with necessary methods */
priv->dev.select = cxd56_ili93404ws_select;
priv->dev.deselect = cxd56_ili93404ws_deselect;
priv->dev.sendcmd = cxd56_ili93404ws_sendcmd;
priv->dev.sendparam = cxd56_ili93404ws_sendparam;
priv->dev.recvparam = cxd56_ili93404ws_recvparam;
priv->dev.sendgram = cxd56_ili93404ws_sendgram;
priv->dev.recvgram = cxd56_ili93404ws_recvgram;
priv->dev.backlight = cxd56_ili93404ws_backlight;
g_lcd = ili9340_initialize(&priv->dev, 0);
}
return OK;
}
/****************************************************************************
* Name: board_lcd_getdev
*
* Description:
* Return a a reference to the LCD object for the specified LCD. This
* allows support for multiple LCD devices.
*
****************************************************************************/
FAR struct lcd_dev_s *board_lcd_getdev(int lcddev)
{
if (lcddev == 0)
{
return g_lcd;
}
return NULL;
}
@@ -0,0 +1,116 @@
/****************************************************************************
* boards/spresense/src/cxd56_ioctl.c
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <debug.h>
#include <errno.h>
#include <nuttx/arch.h>
#include <nuttx/board.h>
#include <arch/board/board.h>
#include "chip.h"
#include "cxd56_uart.h"
#ifdef CONFIG_BOARDCTL_IOCTL
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: boardctl
*
* Description:
* In a small embedded system, there will typically be a much greater
* interaction between application and low-level board features. The
* canonically correct to implement such interactions is by implementing a
* character driver and performing the interactions via low level ioctl
* calls. This, however, may not be practical in many cases and will lead
* to "correct" but awkward implementations.
*
* boardctl() is non-standard OS interface to alleviate the problem. It
* basically circumvents the normal device driver ioctl interlace and allows
* the application to perform direct IOCTL-like calls to the board-specific
* logic. It is especially useful for setting up board operational and
* test configurations.
*
* Input Parameters:
* cmd - Identifies the board command to be executed
* arg - The argument that accompanies the command. The nature of the
* argument is determined by the specific command.
*
* Returned Value:
* On success zero (OK) is returned; -1 (ERROR) is returned on failure
* with the errno variable to to indicate the nature of the failure.
*
****************************************************************************/
int board_ioctl(unsigned int cmd, uintptr_t arg)
{
int ret = -ENOTTY; /* The correct return for the case of an unrecognized command */
switch (cmd)
{
#ifdef CONFIG_USBDEV
/* CMD: BOARDIOC_USBDEV_SETNOTIFYSIG
* DESCRIPTION: Set signal id for notify USB device connection status
* and supply current value.
* ARG: None
* CONFIGURATION: CONFIG_LIB_BOARDCTL
* DEPENDENCIES: Board logic must provide board_app_initialization
*/
case BOARDIOC_USBDEV_SETNOTIFYSIG:
{
ret = cxd56_usbdev_setsigno((int)arg);
}
break;
#endif
default:
break;
}
/* Any failure errno value will be set in boardctl() */
return ret;
}
#endif
@@ -0,0 +1,144 @@
/****************************************************************************
* boards/spresense/src/cxd56_leds.c
*
* Copyright (C) 2011-2013, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
* Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
#include <stdbool.h>
#include <debug.h>
#include <nuttx/board.h>
#include <arch/board/board.h>
#include "cxd56_gpio.h"
#include "cxd56_pinconfig.h"
#ifdef CONFIG_ARCH_LEDS
/****************************************************************************
* Private Functions
****************************************************************************/
static inline void led_clrbits(unsigned int clrbits)
{
if ((clrbits & BOARD_LED1_BIT) != 0)
{
cxd56_gpio_write(GPIO_LED1, false);
}
if ((clrbits & BOARD_LED2_BIT) != 0)
{
cxd56_gpio_write(GPIO_LED2, false);
}
if ((clrbits & BOARD_LED3_BIT) != 0)
{
cxd56_gpio_write(GPIO_LED3, false);
}
if ((clrbits & BOARD_LED4_BIT) != 0)
{
cxd56_gpio_write(GPIO_LED4, false);
}
}
static inline void led_setbits(unsigned int setbits)
{
if ((setbits & BOARD_LED1_BIT) != 0)
{
cxd56_gpio_write(GPIO_LED1, true);
}
if ((setbits & BOARD_LED2_BIT) != 0)
{
cxd56_gpio_write(GPIO_LED2, true);
}
if ((setbits & BOARD_LED3_BIT) != 0)
{
cxd56_gpio_write(GPIO_LED3, true);
}
if ((setbits & BOARD_LED4_BIT) != 0)
{
cxd56_gpio_write(GPIO_LED4, true);
}
}
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_autoled_initialize
****************************************************************************/
void board_autoled_initialize(void)
{
cxd56_gpio_config(GPIO_LED1,false);
cxd56_gpio_config(GPIO_LED2,false);
cxd56_gpio_config(GPIO_LED3,false);
cxd56_gpio_config(GPIO_LED4,false);
}
/****************************************************************************
* Name: board_autoled_on
****************************************************************************/
void board_autoled_on(int led)
{
led_clrbits(BOARD_LED1_BIT | BOARD_LED2_BIT | BOARD_LED3_BIT | BOARD_LED4_BIT);
led_setbits(led);
}
/****************************************************************************
* Name: board_autoled_off
****************************************************************************/
void board_autoled_off(int led)
{
led_clrbits(led);
}
#endif /* CONFIG_ARCH_LEDS */
@@ -0,0 +1,398 @@
/****************************************************************************
* boards/spresense/src/cxd56_lpm013m091a.c
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include <errno.h>
#include <debug.h>
#include <nuttx/arch.h>
#include <nuttx/board.h>
#include <nuttx/spi/spi.h>
#include <nuttx/lcd/lcd.h>
#include <nuttx/lcd/lpm013m091a.h>
#include <arch/board/board.h>
#include "cxd56_gpio.h"
#include "cxd56_spi.h"
#include "cxd56_pinconfig.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Check if the following are defined in the board.h */
#ifndef DISPLAY_RST
# error "DISPLAY_RST must be defined in board.h !!"
#endif
#ifndef DISPLAY_DC
# error "DISPLAY_DC must be defined in board.h !!"
#endif
#ifndef DISPLAY_SPI
# error "DISPLAY_SPI must be defined in board.h !!"
#endif
/****************************************************************************
* Private Type Definition
****************************************************************************/
#ifndef LPM013M091A_SPI_MAXFREQUENCY
# define LPM013M091A_SPI_MAXFREQUENCY 20000000
#endif
/****************************************************************************
* Private Function Protototypes
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
struct lpm013m091a_lcd_s
{
struct lpm013m091a_lcd_s dev;
struct spi_dev_s *spi;
};
static struct lpm013m091a_lcd_s g_lcddev;
static struct lcd_dev_s *g_lcd = NULL;
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Name: cxd56_lpm013m091a4ws_select
*
* Description:
* Select the SPI, locking and re-configuring if necessary
*
* Input Parameters:
* spi - Reference to the public driver structure
*
* Returned Value:
*
****************************************************************************/
static void cxd56_lpm013m091a4ws_select(FAR struct lpm013m091a_lcd_s *lcd)
{
FAR struct lpm013m091a_lcd_s *priv = (FAR struct lpm013m091a_lcd_s *)lcd;
SPI_LOCK(priv->spi, true);
SPI_SELECT(priv->spi, SPIDEV_DISPLAY(0), true);
}
/****************************************************************************
* Name: cxd56_lpm013m091a4ws_deselect
*
* Description:
* De-select the SPI
*
* Input Parameters:
* spi - Reference to the public driver structure
*
* Returned Value:
*
****************************************************************************/
static void cxd56_lpm013m091a4ws_deselect(FAR struct lpm013m091a_lcd_s *lcd)
{
FAR struct lpm013m091a_lcd_s *priv = (FAR struct lpm013m091a_lcd_s *)lcd;
SPI_SELECT(priv->spi, SPIDEV_DISPLAY(0), false);
SPI_LOCK(priv->spi, false);
}
/****************************************************************************
* Name: cxd56_lpm013m091a4ws_backlight
*
* Description:
* Set the backlight level of the connected display.
*
* Input Parameters:
* spi - Reference to the public driver structure
* level - backligth level
*
* Returned Value:
* OK - On Success
*
****************************************************************************/
static int cxd56_lpm013m091a4ws_backlight(FAR struct lpm013m091a_lcd_s *lcd,
int level)
{
if (level > 0)
{
lcd->sendcmd(lcd, 0x53);
lcd->sendparam(lcd, 0x24);
}
else
{
lcd->sendcmd(lcd, 0x53);
lcd->sendparam(lcd, 0x0);
}
return OK;
}
/****************************************************************************
* Name: cxd56_lpm013m091a4ws_sendcmd
*
* Description:
* Send a command to the lcd driver.
*
* Input Parameters:
* lcd - Reference to the lpm013m091a_lcd_s driver structure
* cmd - command to send
*
* Returned Value:
* On success - OK
*
****************************************************************************/
static int cxd56_lpm013m091a4ws_sendcmd(FAR struct lpm013m091a_lcd_s *lcd,
const uint8_t cmd)
{
FAR struct lpm013m091a_lcd_s *priv = (FAR struct lpm013m091a_lcd_s *)lcd;
lcdinfo("%02x\n", cmd);
SPI_SETBITS(priv->spi, 8);
/* FIXME: This function can be replaced with SPI_CMDDATA().
* This feature is needed to enable CONFIG_SPI_CMDDATA and board specific
* cmddata() function.
*/
cxd56_gpio_write(DISPLAY_DC, false); /* Indicate CMD */
(void) SPI_SEND(priv->spi, cmd);
cxd56_gpio_write(DISPLAY_DC, true); /* Indicate DATA */
return OK;
}
/****************************************************************************
* Name: cxd56_lpm013m091a4ws_sendparam
*
* Description:
* Send a parameter to the lcd driver.
*
* Input Parameters:
* lcd - Reference to the lpm013m091a_lcd_s driver structure
* param - parameter to send
*
* Returned Value:
* OK - On Success
*
****************************************************************************/
static int cxd56_lpm013m091a4ws_sendparam(FAR struct lpm013m091a_lcd_s *lcd,
const uint8_t param)
{
FAR struct lpm013m091a_lcd_s *priv = (FAR struct lpm013m091a_lcd_s *)lcd;
cxd56_gpio_write(DISPLAY_DC, true); /* Indicate DATA */
(void) SPI_SEND(priv->spi, param);
return OK;
}
/****************************************************************************
* Name: cxd56_lpm013m091a4ws_sendgram
*
* Description:
* Send a number of pixel words to the lcd driver gram.
*
* Input Parameters:
* lcd - Reference to the lpm013m091a_lcd_s driver structure
* wd - Reference to the words to send
* nwords - number of words to send
*
* Returned Value:
* OK - On Success
*
****************************************************************************/
static int cxd56_lpm013m091a4ws_sendgram(FAR struct lpm013m091a_lcd_s *lcd,
const uint16_t *wd, uint32_t nwords)
{
FAR struct lpm013m091a_lcd_s *priv = (FAR struct lpm013m091a_lcd_s *)lcd;
lcdinfo("lcd:%p, wd=%p, nwords=%d\n", lcd, wd, nwords);
SPI_SETBITS(priv->spi, 16);
(void) SPI_SNDBLOCK(priv->spi, wd, nwords);
return OK;
}
/****************************************************************************
* Name: cxd56_lpm013m091a4ws_recvparam
*
* Description:
* Receive a parameter from the lcd driver.
*
* Input Parameters:
* lcd - Reference to the lpm013m091a_lcd_s driver structure
* param - Reference to where parameter receive
*
* Returned Value:
* OK - On Success
*
****************************************************************************/
static int cxd56_lpm013m091a4ws_recvparam(FAR struct lpm013m091a_lcd_s *lcd,
uint8_t *param)
{
FAR struct lpm013m091a_lcd_s *priv = (FAR struct lpm013m091a_lcd_s *)lcd;
cxd56_gpio_write(DISPLAY_DC, true); /* Indicate DATA */
*param = (uint8_t)(SPI_SEND(priv->spi, param) & 0xff);
return OK;
}
/****************************************************************************
* Name: cxd56_lpm013m091a4ws_recvgram
*
* Description:
* Receive pixel words from the lcd driver gram.
*
* Input Parameters:
* lcd - Reference to the public driver structure
* wd - Reference to where the pixel words receive
* nwords - number of pixel words to receive
*
* Returned Value:
* OK - On Success
*
****************************************************************************/
static int cxd56_lpm013m091a4ws_recvgram(FAR struct lpm013m091a_lcd_s *lcd,
uint16_t *wd, uint32_t nwords)
{
lcdinfo("wd=%p, nwords=%d\n", wd, nwords);
return OK;
};
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_lcd_initialize
*
* Description:
* Initialize the LCD video hardware. The initial state of the LCD is
* fully initialized, display memory cleared, and the LCD ready to use,
* but with the power setting at 0 (full off).
*
****************************************************************************/
int board_lcd_initialize(void)
{
FAR struct lpm013m091a_lcd_s *priv = &g_lcddev;
FAR struct spi_dev_s *spi;
lcdinfo("Initializing lcd\n");
if (g_lcd == NULL)
{
spi = cxd56_spibus_initialize(DISPLAY_SPI);
if (!spi)
{
lcderr("ERROR: Failed to initialize spi bus.\n");
return -ENODEV;
}
priv->spi = spi;
/* Reset LPM013M091A */
up_mdelay(10);
cxd56_gpio_write(DISPLAY_RST, false);
up_mdelay(10);
cxd56_gpio_write(DISPLAY_RST, true);
up_mdelay(50);
/* Configure SPI */
SPI_SETMODE(priv->spi, SPIDEV_MODE3);
SPI_SETBITS(priv->spi, 8);
(void)SPI_HWFEATURES(priv->spi, 0);
(void)SPI_SETFREQUENCY(priv->spi, LPM013M091A_SPI_MAXFREQUENCY);
/* Initialize LPM013M091A driver with necessary methods */
priv->dev.select = cxd56_lpm013m091a4ws_select;
priv->dev.deselect = cxd56_lpm013m091a4ws_deselect;
priv->dev.sendcmd = cxd56_lpm013m091a4ws_sendcmd;
priv->dev.sendparam = cxd56_lpm013m091a4ws_sendparam;
priv->dev.recvparam = cxd56_lpm013m091a4ws_recvparam;
priv->dev.sendgram = cxd56_lpm013m091a4ws_sendgram;
priv->dev.recvgram = cxd56_lpm013m091a4ws_recvgram;
priv->dev.backlight = cxd56_lpm013m091a4ws_backlight;
g_lcd = lpm013m091a_initialize(&priv->dev, 0);
}
return OK;
}
/****************************************************************************
* Name: board_lcd_getdev
*
* Description:
* Return a a reference to the LCD object for the specified LCD. This
* allows support for multiple LCD devices.
*
****************************************************************************/
FAR struct lcd_dev_s *board_lcd_getdev(int lcddev)
{
if (lcddev == 0)
{
return g_lcd;
}
return NULL;
}
@@ -0,0 +1,56 @@
/****************************************************************************
* boards/spresense/src/spresense_main.c
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <nuttx/compiler.h>
/****************************************************************************
* Public Functions
****************************************************************************/
/* This function is provided outside exported SDK, therefore here is defined
* as weak symbol to avoid link error.
*/
int nsh_main(int argc, char *argv[]);
int weak_function spresense_main(int argc, char *argv[])
{
return nsh_main(argc, argv);
}
@@ -0,0 +1,55 @@
/****************************************************************************
* boards/spresense/src/cxd56_netinit.c
*
* Copyright 2019 Sony Home Entertainment & Sound Products Inc.
* Author: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: up_netinitialize
****************************************************************************/
#if defined(CONFIG_NET) && !defined(CONFIG_NETDEV_LATEINIT)
void up_netinitialize(void)
{
}
#endif
@@ -0,0 +1,113 @@
/****************************************************************************
* boards/spresense/src/cxd56_ostest.c
*
* Copyright (C) 2019 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include <debug.h>
#include <nuttx/irq.h>
#include <arch/board/board.h>
#include "up_arch.h"
#include "up_internal.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Configuration ************************************************************/
#undef HAVE_FPU
#if defined(CONFIG_ARCH_FPU) && defined(CONFIG_EXAMPLES_OSTEST_FPUSIZE) && \
defined(CONFIG_SCHED_WAITPID) && !defined(CONFIG_ARMV7M_CMNVECTOR)
# define HAVE_FPU 1
#endif
#ifdef HAVE_FPU
#if CONFIG_EXAMPLES_OSTEST_FPUSIZE != (4*SW_FPU_REGS)
# error "CONFIG_EXAMPLES_OSTEST_FPUSIZE has the wrong size"
#endif
/****************************************************************************
* Private Data
****************************************************************************/
static uint32_t g_saveregs[XCPTCONTEXT_REGS];
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
/* Given an array of size CONFIG_EXAMPLES_OSTEST_FPUSIZE, this function will
* return the current FPU registers.
*/
void arch_getfpu(FAR uint32_t *fpusave)
{
irqstate_t flags;
/* Take a snapshot of the thread context right now */
flags = enter_critical_section();
up_saveusercontext(g_saveregs);
/* Return only the floating register values */
memcpy(fpusave, &g_saveregs[REG_S0], (4*SW_FPU_REGS));
leave_critical_section(flags);
}
/* Given two arrays of size CONFIG_EXAMPLES_OSTEST_FPUSIZE this function
* will compare them and return true if they are identical.
*/
bool arch_cmpfpu(FAR const uint32_t *fpusave1, FAR const uint32_t *fpusave2)
{
return memcmp(fpusave1, fpusave2, (4*SW_FPU_REGS)) == 0;
}
#endif /* HAVE_FPU */
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,141 @@
/****************************************************************************
* boards/spresense/src/cxd56_pwm.c
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdio.h>
#include <debug.h>
#include <errno.h>
#include <nuttx/board.h>
#include <nuttx/drivers/pwm.h>
#include "cxd56_pwm.h"
#ifdef CONFIG_PWM
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
#if defined(CONFIG_CXD56_PWM0) || defined(CONFIG_CXD56_PWM1) || \
defined(CONFIG_CXD56_PWM2) || defined(CONFIG_CXD56_PWM3)
static int pwm_initialize(uint32_t channel)
{
char devname[16];
struct pwm_lowerhalf_s *pwm = NULL;
int ret;
/* Call cxd56_pwminitialize() to get an instance of the PWM interface */
pwm = cxd56_pwminitialize(channel);
if (!pwm)
{
pwmerr("Failed to get the CXD56 PWM%d lower half\n", channel);
return -ENODEV;
}
/* Register the PWM driver at "/dev/pwmX" */
snprintf(devname, sizeof(devname), "/dev/pwm%d", channel);
ret = pwm_register(devname, pwm);
if (ret < 0)
{
pwmerr("pwm_register(%s) failed: %d\n", devname, ret);
return ret;
}
return 0;
}
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_pwm_setup
*
* Description:
* All CXD56 architectures must provide the following interface to work
* with examples/pwm.
*
****************************************************************************/
int board_pwm_setup(void)
{
static bool initialized = false;
/* Have we already initialized? */
if (!initialized)
{
#ifdef CONFIG_CXD56_PWM0
pwm_initialize(CXD56_PWM_CH0);
#endif
#ifdef CONFIG_CXD56_PWM1
pwm_initialize(CXD56_PWM_CH1);
#endif
#ifdef CONFIG_CXD56_PWM2
pwm_initialize(CXD56_PWM_CH2);
#endif
#ifdef CONFIG_CXD56_PWM3
pwm_initialize(CXD56_PWM_CH3);
#endif
/* Now we are initialized */
initialized = true;
}
return OK;
}
#endif /* CONFIG_PWM */
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,154 @@
/****************************************************************************
* boards/spresense/src/cxd56_spi.c
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
#include <stdbool.h>
#include <errno.h>
#include <debug.h>
#include <nuttx/spi/spi.h>
#include <arch/board/board.h>
#include "up_arch.h"
#include "chip.h"
#include "hardware/cxd56_spi.h"
#include "cxd56_clock.h"
#include "cxd56_gpio.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#define MMCSD_DETECT PIN_AP_CLK
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: cxd56_spi0/3/4/5select and cxd56_spi0/3/4/5status
*
* Description:
* The external functions, cxd56_spi1/2/3select and cxd56_spi1/2/3status must be
* provided by board-specific logic. They are implementations of the select
* and status methods of the SPI interface defined by struct spi_ops_s (see
* include/nuttx/spi/spi.h). All other methods (including cxd56_spibus_initialize())
* are provided by common CXD56 logic. To use this common SPI logic on your
* board:
*
* 1. Provide logic in cxd56_boardinitialize() to configure SPI chip select
* pins.
* 2. Provide cxd56_spi0/3/4/5select() and cxd56_spi0/3/4/5status() functions in your
* board-specific logic. These functions will perform chip selection and
* status operations using GPIOs in the way your board is configured.
* 3. Add a calls to cxd56_spibus_initialize() in your low level application
* initialization logic
* 4. The handle returned by cxd56_spibus_initialize() may then be used to bind the
* SPI driver to higher level logic (e.g., calling
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
* the SPI MMC/SD driver).
*
****************************************************************************/
#ifdef CONFIG_CXD56_SPI0
void cxd56_spi0select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected)
{
spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
}
uint8_t cxd56_spi0status(FAR struct spi_dev_s *dev, uint32_t devid)
{
return 0;
}
#endif
#ifdef CONFIG_CXD56_SPI3
void cxd56_spi3select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected)
{
spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
/* Disable clock gating (clock enable) */
cxd56_spi_clock_gate_disable(3);
if (selected)
{
putreg32(0, CXD56_SPI3_CS);
}
else
{
putreg32(1, CXD56_SPI3_CS);
}
/* Enable clock gating (clock disable) */
cxd56_spi_clock_gate_enable(3);
}
uint8_t cxd56_spi3status(FAR struct spi_dev_s *dev, uint32_t devid)
{
return 0;
}
#endif
#ifdef CONFIG_CXD56_SPI4
void cxd56_spi4select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected)
{
spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
}
uint8_t cxd56_spi4status(FAR struct spi_dev_s *dev, uint32_t devid)
{
return 0;
}
#endif
#ifdef CONFIG_CXD56_SPI5
void cxd56_spi5select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected)
{
spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
}
uint8_t cxd56_spi5status(FAR struct spi_dev_s *dev, uint32_t devid)
{
return 0;
}
#endif

Some files were not shown because too many files have changed in this diff Show More