You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/09/09 04:43:46 UTC
[incubator-nuttx] branch master updated: RP2040 Code Cleanup
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new e8f4d74ad0 RP2040 Code Cleanup
e8f4d74ad0 is described below
commit e8f4d74ad0c33389c1094c3ca6c10a6336d8fbe7
Author: curuvar <58...@users.noreply.github.com>
AuthorDate: Thu Sep 8 21:47:58 2022 -0400
RP2040 Code Cleanup
---
arch/arm/src/rp2040/hardware/rp2040_watchdog.h | 2 +-
boards/arm/rp2040/adafruit-feather-rp2040/Kconfig | 22 ---
.../rp2040/adafruit-feather-rp2040/src/Make.defs | 8 --
.../adafruit-feather-rp2040/src/rp2040_reset.c | 61 ---------
.../adafruit-feather-rp2040/src/rp2040_spi.c | 150 ---------------------
boards/arm/rp2040/adafruit-kb2040/Kconfig | 22 ---
boards/arm/rp2040/adafruit-kb2040/src/Make.defs | 8 --
boards/arm/rp2040/adafruit-qt-py-rp2040/Kconfig | 22 ---
.../arm/rp2040/adafruit-qt-py-rp2040/src/Make.defs | 8 --
.../adafruit-qt-py-rp2040/src/rp2040_reset.c | 61 ---------
.../rp2040/adafruit-qt-py-rp2040/src/rp2040_spi.c | 150 ---------------------
boards/arm/rp2040/common/Kconfig | 30 ++++-
boards/arm/rp2040/common/src/Make.defs | 8 ++
.../{adafruit-kb2040 => common}/src/rp2040_reset.c | 2 +-
.../{adafruit-kb2040 => common}/src/rp2040_spi.c | 2 +-
boards/arm/rp2040/pimoroni-tiny2040/Kconfig | 21 ---
boards/arm/rp2040/pimoroni-tiny2040/src/Make.defs | 8 --
.../rp2040/pimoroni-tiny2040/src/rp2040_reset.c | 61 ---------
.../arm/rp2040/pimoroni-tiny2040/src/rp2040_spi.c | 124 -----------------
boards/arm/rp2040/raspberrypi-pico-w/Kconfig | 22 ---
boards/arm/rp2040/raspberrypi-pico-w/src/Make.defs | 8 --
.../rp2040/raspberrypi-pico-w/src/rp2040_reset.c | 61 ---------
.../arm/rp2040/raspberrypi-pico-w/src/rp2040_spi.c | 150 ---------------------
boards/arm/rp2040/raspberrypi-pico/Kconfig | 22 ---
boards/arm/rp2040/raspberrypi-pico/src/Make.defs | 8 --
.../arm/rp2040/raspberrypi-pico/src/rp2040_reset.c | 61 ---------
.../arm/rp2040/raspberrypi-pico/src/rp2040_spi.c | 150 ---------------------
27 files changed, 39 insertions(+), 1213 deletions(-)
diff --git a/arch/arm/src/rp2040/hardware/rp2040_watchdog.h b/arch/arm/src/rp2040/hardware/rp2040_watchdog.h
index 83cb2ad801..7c197e48ad 100644
--- a/arch/arm/src/rp2040/hardware/rp2040_watchdog.h
+++ b/arch/arm/src/rp2040/hardware/rp2040_watchdog.h
@@ -76,7 +76,7 @@
#define RP2040_WATCHDOG_SCRATCH5 (RP2040_WATCHDOG_BASE + RP2040_WATCHDOG_SCRATCH5_OFFSET)
#define RP2040_WATCHDOG_SCRATCH6 (RP2040_WATCHDOG_BASE + RP2040_WATCHDOG_SCRATCH6_OFFSET)
#define RP2040_WATCHDOG_SCRATCH7 (RP2040_WATCHDOG_BASE + RP2040_WATCHDOG_SCRATCH7_OFFSET)
-#define RP2040_WATCHDOG_SCRATCH(n) (RP2040_WATCHDOG_BASE + RP2040_WATCHDOG_SCRATCH0_OFFSET + 4 * n)
+#define RP2040_WATCHDOG_SCRATCH(n) (RP2040_WATCHDOG_BASE + RP2040_WATCHDOG_SCRATCH0_OFFSET + 4 * (n))
#define RP2040_WATCHDOG_TICK (RP2040_WATCHDOG_BASE + RP2040_WATCHDOG_TICK_OFFSET)
/* Register bit definitions *************************************************/
diff --git a/boards/arm/rp2040/adafruit-feather-rp2040/Kconfig b/boards/arm/rp2040/adafruit-feather-rp2040/Kconfig
index c73c7671a4..45616d3692 100644
--- a/boards/arm/rp2040/adafruit-feather-rp2040/Kconfig
+++ b/boards/arm/rp2040/adafruit-feather-rp2040/Kconfig
@@ -5,28 +5,6 @@
if ARCH_BOARD_ADAFRUIT_FEATHER_RP2040
-config RP2040_FLASH_BOOT
- bool "flash boot"
- default y
- ---help---
- If y, the built binary can be used for flash boot.
- If not, the binary is for SRAM boot.
-
-config RP2040_FLASH_CHIP
- string "Second stage boot loader"
- default "w25q080"
- ---help---
- This is the name of the Pico-SDK second stage boot loader
- to use for this board. This board using a Q64 flash chip
- which is compatible with the w25q080 boot loader.
- Basically this option should not be changed.
-
-config RP2040_UF2_BINARY
- bool "uf2 binary format"
- default y
- ---help---
- Create nuttx.uf2 binary format used on RP2040 based arch.
-
config RP2040_LCD_SPI_CH
int "RP2040 LCD SPI channel number"
default 0
diff --git a/boards/arm/rp2040/adafruit-feather-rp2040/src/Make.defs b/boards/arm/rp2040/adafruit-feather-rp2040/src/Make.defs
index 791a6121d3..dc05fc21f3 100644
--- a/boards/arm/rp2040/adafruit-feather-rp2040/src/Make.defs
+++ b/boards/arm/rp2040/adafruit-feather-rp2040/src/Make.defs
@@ -24,14 +24,6 @@ CSRCS = rp2040_boardinitialize.c
CSRCS += rp2040_appinit.c
CSRCS += rp2040_bringup.c
-ifeq ($(CONFIG_BOARDCTL_RESET),y)
-CSRCS += rp2040_reset.c
-endif
-
-ifeq ($(CONFIG_SPI),y)
-CSRCS += rp2040_spi.c
-endif
-
ifeq ($(CONFIG_DEV_GPIO),y)
CSRCS += rp2040_gpio.c
endif
diff --git a/boards/arm/rp2040/adafruit-feather-rp2040/src/rp2040_reset.c b/boards/arm/rp2040/adafruit-feather-rp2040/src/rp2040_reset.c
deleted file mode 100644
index ec31a0eac8..0000000000
--- a/boards/arm/rp2040/adafruit-feather-rp2040/src/rp2040_reset.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
- * boards/arm/rp2040/adafruit-feather-rp2040/src/rp2040_reset.c
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include <nuttx/config.h>
-#include <nuttx/board.h>
-#include <nuttx/arch.h>
-
-#ifdef CONFIG_BOARDCTL_RESET
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: board_reset
- *
- * Description:
- * Reset board. Support for this function is required by board-level
- * logic if CONFIG_BOARDCTL_RESET is selected.
- *
- * Input Parameters:
- * status - Status information provided with the reset event. This
- * meaning of this status information is board-specific. If not
- * used by a board, the value zero may be provided in calls to
- * board_reset().
- *
- * Returned Value:
- * If this function returns, then it was not possible to power-off the
- * board due to some constraints. The return value int this case is a
- * board-specific reason for the failure to shutdown.
- *
- ****************************************************************************/
-
-int board_reset(int status)
-{
- up_systemreset();
- return 0;
-}
-
-#endif /* CONFIG_BOARDCTL_RESET */
diff --git a/boards/arm/rp2040/adafruit-feather-rp2040/src/rp2040_spi.c b/boards/arm/rp2040/adafruit-feather-rp2040/src/rp2040_spi.c
deleted file mode 100644
index 7fd0ffc754..0000000000
--- a/boards/arm/rp2040/adafruit-feather-rp2040/src/rp2040_spi.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/****************************************************************************
- * boards/arm/rp2040/adafruit-feather-rp2040/src/rp2040_spi.c
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * 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 "arm_internal.h"
-#include "chip.h"
-#include "rp2040_gpio.h"
-#include "hardware/rp2040_spi.h"
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: rp2040_spi0/1select and rp2040_spi0/1status
- *
- * Description:
- * The external functions, rp2040_spi0/1select and rp2040_spi0/1status
- * 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 rp2040_spibus_initialize()) are provided by
- * common RP2040 logic. To use this common SPI logic on your board:
- *
- * 1. Provide logic in rp2040_boardinitialize() to configure SPI chip
- * select pins.
- * 2. Provide rp2040_spi0/1select() and rp2040_spi0/1status()
- * 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 rp2040_spibus_initialize() in your low level
- * application initialization logic
- * 4. The handle returned by rp2040_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_RP2040_SPI0
-void rp2040_spi0select(struct spi_dev_s *dev, uint32_t devid,
- bool selected)
-{
- spiinfo("devid: %d CS: %s\n", (int)devid,
- selected ? "assert" : "de-assert");
-
- rp2040_gpio_put(CONFIG_RP2040_SPI0_CS_GPIO, !selected);
-}
-
-uint8_t rp2040_spi0status(struct spi_dev_s *dev, uint32_t devid)
-{
- uint8_t ret = 0;
-
-# if defined(CONFIG_RP2040_SPISD) && (CONFIG_RP2040_SPISD_SPI_CH == 0)
- ret = board_spisd_status(dev, devid);
-# endif
- return ret;
-}
-
-#ifdef CONFIG_SPI_CMDDATA
-int rp2040_spi0cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
-{
-#ifdef CONFIG_LCD_ST7789
- if (devid == SPIDEV_DISPLAY(0))
- {
- /* This is the Data/Command control pad which determines whether the
- * data bits are data or a command.
- */
-
- rp2040_gpio_put(CONFIG_RP2040_SPI0_RX_GPIO, !cmd);
-
- return OK;
- }
-#endif
-
- return -ENODEV;
-}
-#endif
-#endif
-
-#ifdef CONFIG_RP2040_SPI1
-void rp2040_spi1select(struct spi_dev_s *dev, uint32_t devid,
- bool selected)
-{
- spiinfo("devid: %d CS: %s\n", (int)devid,
- selected ? "assert" : "de-assert");
-
- rp2040_gpio_put(CONFIG_RP2040_SPI1_CS_GPIO, !selected);
-}
-
-uint8_t rp2040_spi1status(struct spi_dev_s *dev, uint32_t devid)
-{
- uint8_t ret = 0;
-
-# if defined(CONFIG_RP2040_SPISD) && (CONFIG_RP2040_SPISD_SPI_CH == 1)
- ret = board_spisd_status(dev, devid);
-# endif
- return ret;
-}
-
-#ifdef CONFIG_SPI_CMDDATA
-int rp2040_spi1cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
-{
-#if defined (CONFIG_LCD_ST7789) || (CONFIG_LCD_ST7735)
- if (devid == SPIDEV_DISPLAY(0))
- {
- /* This is the Data/Command control pad which determines whether the
- * data bits are data or a command.
- */
-
- rp2040_gpio_put(CONFIG_RP2040_SPI1_RX_GPIO, !cmd);
-
- return OK;
- }
-#endif
-
- return -ENODEV;
-}
-#endif
-#endif
diff --git a/boards/arm/rp2040/adafruit-kb2040/Kconfig b/boards/arm/rp2040/adafruit-kb2040/Kconfig
index 6866bf4fa4..0b4e0518b9 100644
--- a/boards/arm/rp2040/adafruit-kb2040/Kconfig
+++ b/boards/arm/rp2040/adafruit-kb2040/Kconfig
@@ -5,28 +5,6 @@
if ARCH_BOARD_ADAFRUIT_KB2040
-config RP2040_FLASH_BOOT
- bool "flash boot"
- default y
- ---help---
- If y, the built binary can be used for flash boot.
- If not, the binary is for SRAM boot.
-
-config RP2040_FLASH_CHIP
- string "Second stage boot loader"
- default "w25q080"
- ---help---
- This is the name of the Pico-SDK second stage boot loader
- to use for this board. This board using a Q64 flash chip
- which is compatible with the w25q080 boot loader.
- Basically this option should not be changed.
-
-config RP2040_UF2_BINARY
- bool "uf2 binary format"
- default y
- ---help---
- Create nuttx.uf2 binary format used on RP2040 based arch.
-
config RP2040_LCD_SPI_CH
int "RP2040 LCD SPI channel number"
default 0
diff --git a/boards/arm/rp2040/adafruit-kb2040/src/Make.defs b/boards/arm/rp2040/adafruit-kb2040/src/Make.defs
index 32bfae6857..1287fe4025 100644
--- a/boards/arm/rp2040/adafruit-kb2040/src/Make.defs
+++ b/boards/arm/rp2040/adafruit-kb2040/src/Make.defs
@@ -24,14 +24,6 @@ CSRCS = rp2040_boardinitialize.c
CSRCS += rp2040_appinit.c
CSRCS += rp2040_bringup.c
-ifeq ($(CONFIG_BOARDCTL_RESET),y)
-CSRCS += rp2040_reset.c
-endif
-
-ifeq ($(CONFIG_SPI),y)
-CSRCS += rp2040_spi.c
-endif
-
ifeq ($(CONFIG_DEV_GPIO),y)
CSRCS += rp2040_gpio.c
endif
diff --git a/boards/arm/rp2040/adafruit-qt-py-rp2040/Kconfig b/boards/arm/rp2040/adafruit-qt-py-rp2040/Kconfig
index 1233c2bb5a..8dcacff2a4 100644
--- a/boards/arm/rp2040/adafruit-qt-py-rp2040/Kconfig
+++ b/boards/arm/rp2040/adafruit-qt-py-rp2040/Kconfig
@@ -5,26 +5,4 @@
if ARCH_BOARD_ADAFRUIT_QT_PY_RP2040
-config RP2040_FLASH_BOOT
- bool "flash boot"
- default y
- ---help---
- If y, the built binary can be used for flash boot.
- If not, the binary is for SRAM boot.
-
-config RP2040_FLASH_CHIP
- string "Second stage boot loader"
- default "w25q080"
- ---help---
- This is the name of the Pico-SDK second stage boot loader
- to use for this board. This board using a Q64 flash chip
- which is compatible with the w25q080 boot loader.
- Basically this option should not be changed.
-
-config RP2040_UF2_BINARY
- bool "uf2 binary format"
- default y
- ---help---
- Create nuttx.uf2 binary format used on RP2040 based arch.
-
endif
diff --git a/boards/arm/rp2040/adafruit-qt-py-rp2040/src/Make.defs b/boards/arm/rp2040/adafruit-qt-py-rp2040/src/Make.defs
index 5a73b36fde..5e47da2214 100644
--- a/boards/arm/rp2040/adafruit-qt-py-rp2040/src/Make.defs
+++ b/boards/arm/rp2040/adafruit-qt-py-rp2040/src/Make.defs
@@ -24,14 +24,6 @@ CSRCS = rp2040_boardinitialize.c
CSRCS += rp2040_appinit.c
CSRCS += rp2040_bringup.c
-ifeq ($(CONFIG_BOARDCTL_RESET),y)
-CSRCS += rp2040_reset.c
-endif
-
-ifeq ($(CONFIG_SPI),y)
-CSRCS += rp2040_spi.c
-endif
-
ifeq ($(CONFIG_DEV_GPIO),y)
CSRCS += rp2040_gpio.c
endif
diff --git a/boards/arm/rp2040/adafruit-qt-py-rp2040/src/rp2040_reset.c b/boards/arm/rp2040/adafruit-qt-py-rp2040/src/rp2040_reset.c
deleted file mode 100644
index 5276cddc84..0000000000
--- a/boards/arm/rp2040/adafruit-qt-py-rp2040/src/rp2040_reset.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
- * boards/arm/rp2040/adafruit-qt-py-rp2040/src/rp2040_reset.c
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include <nuttx/config.h>
-#include <nuttx/board.h>
-#include <nuttx/arch.h>
-
-#ifdef CONFIG_BOARDCTL_RESET
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: board_reset
- *
- * Description:
- * Reset board. Support for this function is required by board-level
- * logic if CONFIG_BOARDCTL_RESET is selected.
- *
- * Input Parameters:
- * status - Status information provided with the reset event. This
- * meaning of this status information is board-specific. If not
- * used by a board, the value zero may be provided in calls to
- * board_reset().
- *
- * Returned Value:
- * If this function returns, then it was not possible to power-off the
- * board due to some constraints. The return value int this case is a
- * board-specific reason for the failure to shutdown.
- *
- ****************************************************************************/
-
-int board_reset(int status)
-{
- up_systemreset();
- return 0;
-}
-
-#endif /* CONFIG_BOARDCTL_RESET */
diff --git a/boards/arm/rp2040/adafruit-qt-py-rp2040/src/rp2040_spi.c b/boards/arm/rp2040/adafruit-qt-py-rp2040/src/rp2040_spi.c
deleted file mode 100644
index 14ce78cc43..0000000000
--- a/boards/arm/rp2040/adafruit-qt-py-rp2040/src/rp2040_spi.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/****************************************************************************
- * boards/arm/rp2040/adafruit-qt-py-rp2040/src/rp2040_spi.c
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * 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 "arm_internal.h"
-#include "chip.h"
-#include "rp2040_gpio.h"
-#include "hardware/rp2040_spi.h"
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: rp2040_spi0/1select and rp2040_spi0/1status
- *
- * Description:
- * The external functions, rp2040_spi0/1select and rp2040_spi0/1status
- * 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 rp2040_spibus_initialize()) are provided by
- * common RP2040 logic. To use this common SPI logic on your board:
- *
- * 1. Provide logic in rp2040_boardinitialize() to configure SPI chip
- * select pins.
- * 2. Provide rp2040_spi0/1select() and rp2040_spi0/1status()
- * 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 rp2040_spibus_initialize() in your low level
- * application initialization logic
- * 4. The handle returned by rp2040_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_RP2040_SPI0
-void rp2040_spi0select(struct spi_dev_s *dev, uint32_t devid,
- bool selected)
-{
- spiinfo("devid: %d CS: %s\n", (int)devid,
- selected ? "assert" : "de-assert");
-
- rp2040_gpio_put(CONFIG_RP2040_SPI0_CS_GPIO, !selected);
-}
-
-uint8_t rp2040_spi0status(struct spi_dev_s *dev, uint32_t devid)
-{
- uint8_t ret = 0;
-
-# if defined(CONFIG_RP2040_SPISD) && (CONFIG_RP2040_SPISD_SPI_CH == 0)
- ret = board_spisd_status(dev, devid);
-# endif
- return ret;
-}
-
-#ifdef CONFIG_SPI_CMDDATA
-int rp2040_spi0cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
-{
-#ifdef CONFIG_LCD_ST7789
- if (devid == SPIDEV_DISPLAY(0))
- {
- /* This is the Data/Command control pad which determines whether the
- * data bits are data or a command.
- */
-
- rp2040_gpio_put(CONFIG_RP2040_SPI0_RX_GPIO, !cmd);
-
- return OK;
- }
-#endif
-
- return -ENODEV;
-}
-#endif
-#endif
-
-#ifdef CONFIG_RP2040_SPI1
-void rp2040_spi1select(struct spi_dev_s *dev, uint32_t devid,
- bool selected)
-{
- spiinfo("devid: %d CS: %s\n", (int)devid,
- selected ? "assert" : "de-assert");
-
- rp2040_gpio_put(CONFIG_RP2040_SPI1_CS_GPIO, !selected);
-}
-
-uint8_t rp2040_spi1status(struct spi_dev_s *dev, uint32_t devid)
-{
- uint8_t ret = 0;
-
-# if defined(CONFIG_RP2040_SPISD) && (CONFIG_RP2040_SPISD_SPI_CH == 1)
- ret = board_spisd_status(dev, devid);
-# endif
- return ret;
-}
-
-#ifdef CONFIG_SPI_CMDDATA
-int rp2040_spi1cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
-{
-#if defined (CONFIG_LCD_ST7789) || (CONFIG_LCD_ST7735)
- if (devid == SPIDEV_DISPLAY(0))
- {
- /* This is the Data/Command control pad which determines whether the
- * data bits are data or a command.
- */
-
- rp2040_gpio_put(CONFIG_RP2040_SPI1_RX_GPIO, !cmd);
-
- return OK;
- }
-#endif
-
- return -ENODEV;
-}
-#endif
-#endif
diff --git a/boards/arm/rp2040/common/Kconfig b/boards/arm/rp2040/common/Kconfig
index aa69c90c1a..954b9c116f 100644
--- a/boards/arm/rp2040/common/Kconfig
+++ b/boards/arm/rp2040/common/Kconfig
@@ -3,6 +3,32 @@
# see the file kconfig-language.txt in the NuttX tools repository.
#
+#####################################################################
+# Build Configuration
+#####################################################################
+
+config RP2040_FLASH_BOOT
+ bool "flash boot"
+ default y
+ ---help---
+ If y, the built binary can be used for flash boot.
+ If not, the binary is for SRAM boot.
+
+config RP2040_FLASH_CHIP
+ string "Second stage boot loader"
+ default "w25q080"
+ ---help---
+ This is the name of the Pico-SDK second stage boot loader
+ to use for this board. This board using a Q16 flash chip
+ which is compatible with the w25q080 boot loader.
+ Basically this option should not be changed.
+
+config RP2040_UF2_BINARY
+ bool "uf2 binary format"
+ default y
+ ---help---
+ Create nuttx.uf2 binary format used on RP2040 based arch.
+
#####################################################################
# UART Configuration
#####################################################################
@@ -212,7 +238,7 @@ endif # RP2040_I2C0 || RP2040_I2C0_SLAVE
#####################################################################
-if RP2040_I2C1 || RP2040_I2C0_SLAVE
+if RP2040_I2C1 || RP2040_I2C1_SLAVE
config RP2040_I2C1_SDA_GPIO
int "GPIO pin for I2C1 SDA (2, 6, 10, 14, 18, 22, or 26)"
@@ -228,7 +254,7 @@ if RP2040_I2C1 || RP2040_I2C0_SLAVE
---help---
Refer to board documentation to see which pins are available.
-endif # RP2040_I2C1 || RP2040_I2C0_SLAVE
+endif # RP2040_I2C1 || RP2040_I2C1_SLAVE
#####################################################################
# PWM Configuration
diff --git a/boards/arm/rp2040/common/src/Make.defs b/boards/arm/rp2040/common/src/Make.defs
index 3c93e2c1f7..d5dc2ca842 100644
--- a/boards/arm/rp2040/common/src/Make.defs
+++ b/boards/arm/rp2040/common/src/Make.defs
@@ -23,6 +23,14 @@ ifeq ($(CONFIG_ARCH_BOARD_COMMON),y)
CSRCS += rp2040_common_bringup.c
CSRCS += rp2040_common_initialize.c
+ifeq ($(CONFIG_BOARDCTL_RESET),y)
+CSRCS += rp2040_reset.c
+endif
+
+ifeq ($(CONFIG_SPI),y)
+CSRCS += rp2040_spi.c
+endif
+
ifeq ($(CONFIG_RP2040_I2C_DRIVER),y)
CSRCS += rp2040_i2cdev.c
endif
diff --git a/boards/arm/rp2040/adafruit-kb2040/src/rp2040_reset.c b/boards/arm/rp2040/common/src/rp2040_reset.c
similarity index 97%
rename from boards/arm/rp2040/adafruit-kb2040/src/rp2040_reset.c
rename to boards/arm/rp2040/common/src/rp2040_reset.c
index 59160ff748..5fca570fae 100644
--- a/boards/arm/rp2040/adafruit-kb2040/src/rp2040_reset.c
+++ b/boards/arm/rp2040/common/src/rp2040_reset.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * boards/arm/rp2040/adafruit-kb2040/src/rp2040_reset.c
+ * boards/arm/rp2040/common/src/rp2040_reset.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
diff --git a/boards/arm/rp2040/adafruit-kb2040/src/rp2040_spi.c b/boards/arm/rp2040/common/src/rp2040_spi.c
similarity index 98%
rename from boards/arm/rp2040/adafruit-kb2040/src/rp2040_spi.c
rename to boards/arm/rp2040/common/src/rp2040_spi.c
index b2cdee6503..d6b39b192c 100644
--- a/boards/arm/rp2040/adafruit-kb2040/src/rp2040_spi.c
+++ b/boards/arm/rp2040/common/src/rp2040_spi.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * boards/arm/rp2040/adafruit-kb2040/src/rp2040_spi.c
+ * boards/arm/rp2040/common/src/rp2040_spi.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
diff --git a/boards/arm/rp2040/pimoroni-tiny2040/Kconfig b/boards/arm/rp2040/pimoroni-tiny2040/Kconfig
index 0af7a58fa7..d3b98e1d69 100644
--- a/boards/arm/rp2040/pimoroni-tiny2040/Kconfig
+++ b/boards/arm/rp2040/pimoroni-tiny2040/Kconfig
@@ -5,26 +5,5 @@
if ARCH_BOARD_PIMORONI_TINY2040
-config RP2040_FLASH_BOOT
- bool "flash boot"
- default y
- ---help---
- If y, the built binary can be used for flash boot.
- If not, the binary is for SRAM boot.
-
-config RP2040_FLASH_CHIP
- string "Second stage boot loader"
- default "w25q080"
- ---help---
- This is the name of the Pico-SDK second stage boot loader
- to use for this board. This board using a Q16 flash chip
- which is compatible with the w25q080 boot loader.
- Basically this option should not be changed.
-
-config RP2040_UF2_BINARY
- bool "uf2 binary format"
- default y
- ---help---
- Create nuttx.uf2 binary format used on RP2040 based arch.
endif
diff --git a/boards/arm/rp2040/pimoroni-tiny2040/src/Make.defs b/boards/arm/rp2040/pimoroni-tiny2040/src/Make.defs
index 5c2b70fc97..3b30b93e03 100644
--- a/boards/arm/rp2040/pimoroni-tiny2040/src/Make.defs
+++ b/boards/arm/rp2040/pimoroni-tiny2040/src/Make.defs
@@ -24,14 +24,6 @@ CSRCS = rp2040_boardinitialize.c
CSRCS += rp2040_appinit.c
CSRCS += rp2040_bringup.c
-ifeq ($(CONFIG_BOARDCTL_RESET),y)
-CSRCS += rp2040_reset.c
-endif
-
-ifeq ($(CONFIG_SPI),y)
-CSRCS += rp2040_spi.c
-endif
-
ifeq ($(CONFIG_DEV_GPIO),y)
CSRCS += rp2040_gpio.c
endif
diff --git a/boards/arm/rp2040/pimoroni-tiny2040/src/rp2040_reset.c b/boards/arm/rp2040/pimoroni-tiny2040/src/rp2040_reset.c
deleted file mode 100644
index 36ccfe89c1..0000000000
--- a/boards/arm/rp2040/pimoroni-tiny2040/src/rp2040_reset.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
- * boards/arm/rp2040/pimoroni-tiny2040/src/rp2040_reset.c
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include <nuttx/config.h>
-#include <nuttx/board.h>
-#include <nuttx/arch.h>
-
-#ifdef CONFIG_BOARDCTL_RESET
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: board_reset
- *
- * Description:
- * Reset board. Support for this function is required by board-level
- * logic if CONFIG_BOARDCTL_RESET is selected.
- *
- * Input Parameters:
- * status - Status information provided with the reset event. This
- * meaning of this status information is board-specific. If not
- * used by a board, the value zero may be provided in calls to
- * board_reset().
- *
- * Returned Value:
- * If this function returns, then it was not possible to power-off the
- * board due to some constraints. The return value int this case is a
- * board-specific reason for the failure to shutdown.
- *
- ****************************************************************************/
-
-int board_reset(int status)
-{
- up_systemreset();
- return 0;
-}
-
-#endif /* CONFIG_BOARDCTL_RESET */
diff --git a/boards/arm/rp2040/pimoroni-tiny2040/src/rp2040_spi.c b/boards/arm/rp2040/pimoroni-tiny2040/src/rp2040_spi.c
deleted file mode 100644
index 111765b392..0000000000
--- a/boards/arm/rp2040/pimoroni-tiny2040/src/rp2040_spi.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/****************************************************************************
- * boards/arm/rp2040/pimoroni-tiny2040/src/rp2040_spi.c
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * 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 "arm_internal.h"
-#include "chip.h"
-#include "rp2040_gpio.h"
-#include "hardware/rp2040_spi.h"
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: rp2040_spi0/1select and rp2040_spi0/1status
- *
- * Description:
- * The external functions, rp2040_spi0/1select and rp2040_spi0/1status
- * 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 rp2040_spibus_initialize()) are provided by
- * common RP2040 logic. To use this common SPI logic on your board:
- *
- * 1. Provide logic in rp2040_boardinitialize() to configure SPI chip
- * select pins.
- * 2. Provide rp2040_spi0/1select() and rp2040_spi0/1status()
- * 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 rp2040_spibus_initialize() in your low level
- * application initialization logic
- * 4. The handle returned by rp2040_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_RP2040_SPI0
-void rp2040_spi0select(struct spi_dev_s *dev, uint32_t devid,
- bool selected)
-{
- spiinfo("devid: %d CS: %s\n", (int)devid,
- selected ? "assert" : "de-assert");
-
- rp2040_gpio_put(CONFIG_RP2040_SPI0_CS_GPIO, !selected);
-}
-
-uint8_t rp2040_spi0status(struct spi_dev_s *dev, uint32_t devid)
-{
- uint8_t ret = 0;
-
-# if defined(CONFIG_RP2040_SPISD) && (CONFIG_RP2040_SPISD_SPI_CH == 0)
- ret = board_spisd_status(dev, devid);
-# endif
- return ret;
-}
-
-#ifdef CONFIG_SPI_CMDDATA
-int rp2040_spi0cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
-{
- return -ENODEV;
-}
-#endif
-#endif
-
-#ifdef CONFIG_RP2040_SPI1
-void rp2040_spi1select(struct spi_dev_s *dev, uint32_t devid,
- bool selected)
-{
- spiinfo("devid: %d CS: %s\n", (int)devid,
- selected ? "assert" : "de-assert");
-
- rp2040_gpio_put(CONFIG_RP2040_SPI1_CS_GPIO, !selected);
-}
-
-uint8_t rp2040_spi1status(struct spi_dev_s *dev, uint32_t devid)
-{
- uint8_t ret = 0;
-
-# if defined(CONFIG_RP2040_SPISD) && (CONFIG_RP2040_SPISD_SPI_CH == 1)
- ret = board_spisd_status(dev, devid);
-# endif
- return ret;
-}
-
-#ifdef CONFIG_SPI_CMDDATA
-int rp2040_spi1cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
-{
- return -ENODEV;
-}
-#endif
-#endif
diff --git a/boards/arm/rp2040/raspberrypi-pico-w/Kconfig b/boards/arm/rp2040/raspberrypi-pico-w/Kconfig
index 47cb9b8013..45927d1ba2 100644
--- a/boards/arm/rp2040/raspberrypi-pico-w/Kconfig
+++ b/boards/arm/rp2040/raspberrypi-pico-w/Kconfig
@@ -5,28 +5,6 @@
if ARCH_BOARD_RASPBERRYPI_PICO_W
-config RP2040_FLASH_BOOT
- bool "flash boot"
- default y
- ---help---
- If y, the built binary can be used for flash boot.
- If not, the binary is for SRAM boot.
-
-config RP2040_FLASH_CHIP
- string "Second stage boot loader"
- default "w25q080"
- ---help---
- This is the name of the Pico-SDK second stage boot loader
- to use for this board. This board using a Q16 flash chip
- which is compatible with the w25q080 boot loader.
- Basically this option should not be changed.
-
-config RP2040_UF2_BINARY
- bool "uf2 binary format"
- default y
- ---help---
- Create nuttx.uf2 binary format used on RP2040 based arch.
-
config RP2040_LCD_SPI_CH
int "RP2040 LCD SPI channel number"
default 0
diff --git a/boards/arm/rp2040/raspberrypi-pico-w/src/Make.defs b/boards/arm/rp2040/raspberrypi-pico-w/src/Make.defs
index ddddef17c2..2423976ceb 100644
--- a/boards/arm/rp2040/raspberrypi-pico-w/src/Make.defs
+++ b/boards/arm/rp2040/raspberrypi-pico-w/src/Make.defs
@@ -24,14 +24,6 @@ CSRCS = rp2040_boardinitialize.c
CSRCS += rp2040_appinit.c
CSRCS += rp2040_bringup.c
-ifeq ($(CONFIG_BOARDCTL_RESET),y)
-CSRCS += rp2040_reset.c
-endif
-
-ifeq ($(CONFIG_SPI),y)
-CSRCS += rp2040_spi.c
-endif
-
ifeq ($(CONFIG_DEV_GPIO),y)
CSRCS += rp2040_gpio.c
endif
diff --git a/boards/arm/rp2040/raspberrypi-pico-w/src/rp2040_reset.c b/boards/arm/rp2040/raspberrypi-pico-w/src/rp2040_reset.c
deleted file mode 100644
index 15bc3779b3..0000000000
--- a/boards/arm/rp2040/raspberrypi-pico-w/src/rp2040_reset.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
- * boards/arm/rp2040/raspberrypi-pico-w/src/rp2040_reset.c
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include <nuttx/config.h>
-#include <nuttx/board.h>
-#include <nuttx/arch.h>
-
-#ifdef CONFIG_BOARDCTL_RESET
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: board_reset
- *
- * Description:
- * Reset board. Support for this function is required by board-level
- * logic if CONFIG_BOARDCTL_RESET is selected.
- *
- * Input Parameters:
- * status - Status information provided with the reset event. This
- * meaning of this status information is board-specific. If not
- * used by a board, the value zero may be provided in calls to
- * board_reset().
- *
- * Returned Value:
- * If this function returns, then it was not possible to power-off the
- * board due to some constraints. The return value int this case is a
- * board-specific reason for the failure to shutdown.
- *
- ****************************************************************************/
-
-int board_reset(int status)
-{
- up_systemreset();
- return 0;
-}
-
-#endif /* CONFIG_BOARDCTL_RESET */
diff --git a/boards/arm/rp2040/raspberrypi-pico-w/src/rp2040_spi.c b/boards/arm/rp2040/raspberrypi-pico-w/src/rp2040_spi.c
deleted file mode 100644
index 36af5597c3..0000000000
--- a/boards/arm/rp2040/raspberrypi-pico-w/src/rp2040_spi.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/****************************************************************************
- * boards/arm/rp2040/raspberrypi-pico-w/src/rp2040_spi.c
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * 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 "arm_internal.h"
-#include "chip.h"
-#include "rp2040_gpio.h"
-#include "hardware/rp2040_spi.h"
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: rp2040_spi0/1select and rp2040_spi0/1status
- *
- * Description:
- * The external functions, rp2040_spi0/1select and rp2040_spi0/1status
- * 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 rp2040_spibus_initialize()) are provided by
- * common RP2040 logic. To use this common SPI logic on your board:
- *
- * 1. Provide logic in rp2040_boardinitialize() to configure SPI chip
- * select pins.
- * 2. Provide rp2040_spi0/1select() and rp2040_spi0/1status()
- * 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 rp2040_spibus_initialize() in your low level
- * application initialization logic
- * 4. The handle returned by rp2040_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_RP2040_SPI0
-void rp2040_spi0select(struct spi_dev_s *dev, uint32_t devid,
- bool selected)
-{
- spiinfo("devid: %d CS: %s\n", (int)devid,
- selected ? "assert" : "de-assert");
-
- rp2040_gpio_put(CONFIG_RP2040_SPI0_CS_GPIO, !selected);
-}
-
-uint8_t rp2040_spi0status(struct spi_dev_s *dev, uint32_t devid)
-{
- uint8_t ret = 0;
-
-# if defined(CONFIG_RP2040_SPISD) && (CONFIG_RP2040_SPISD_SPI_CH == 0)
- ret = board_spisd_status(dev, devid);
-# endif
- return ret;
-}
-
-#ifdef CONFIG_SPI_CMDDATA
-int rp2040_spi0cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
-{
-#ifdef CONFIG_LCD_ST7789
- if (devid == SPIDEV_DISPLAY(0))
- {
- /* This is the Data/Command control pad which determines whether the
- * data bits are data or a command.
- */
-
- rp2040_gpio_put(CONFIG_RP2040_SPI0_RX_GPIO, !cmd);
-
- return OK;
- }
-#endif
-
- return -ENODEV;
-}
-#endif
-#endif
-
-#ifdef CONFIG_RP2040_SPI1
-void rp2040_spi1select(struct spi_dev_s *dev, uint32_t devid,
- bool selected)
-{
- spiinfo("devid: %d CS: %s\n", (int)devid,
- selected ? "assert" : "de-assert");
-
- rp2040_gpio_put(CONFIG_RP2040_SPI1_CS_GPIO, !selected);
-}
-
-uint8_t rp2040_spi1status(struct spi_dev_s *dev, uint32_t devid)
-{
- uint8_t ret = 0;
-
-# if defined(CONFIG_RP2040_SPISD) && (CONFIG_RP2040_SPISD_SPI_CH == 1)
- ret = board_spisd_status(dev, devid);
-# endif
- return ret;
-}
-
-#ifdef CONFIG_SPI_CMDDATA
-int rp2040_spi1cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
-{
-#if defined (CONFIG_LCD_ST7789) || (CONFIG_LCD_ST7735)
- if (devid == SPIDEV_DISPLAY(0))
- {
- /* This is the Data/Command control pad which determines whether the
- * data bits are data or a command.
- */
-
- rp2040_gpio_put(CONFIG_RP2040_SPI1_RX_GPIO, !cmd);
-
- return OK;
- }
-#endif
-
- return -ENODEV;
-}
-#endif
-#endif
diff --git a/boards/arm/rp2040/raspberrypi-pico/Kconfig b/boards/arm/rp2040/raspberrypi-pico/Kconfig
index a1a01a010d..45ebfcb330 100644
--- a/boards/arm/rp2040/raspberrypi-pico/Kconfig
+++ b/boards/arm/rp2040/raspberrypi-pico/Kconfig
@@ -5,28 +5,6 @@
if ARCH_BOARD_RASPBERRYPI_PICO
-config RP2040_FLASH_BOOT
- bool "flash boot"
- default y
- ---help---
- If y, the built binary can be used for flash boot.
- If not, the binary is for SRAM boot.
-
-config RP2040_FLASH_CHIP
- string "Second stage boot loader"
- default "w25q080"
- ---help---
- This is the name of the Pico-SDK second stage boot loader
- to use for this board. This board using a Q16 flash chip
- which is compatible with the w25q080 boot loader.
- Basically this option should not be changed.
-
-config RP2040_UF2_BINARY
- bool "uf2 binary format"
- default y
- ---help---
- Create nuttx.uf2 binary format used on RP2040 based arch.
-
config RP2040_LCD_SPI_CH
int "RP2040 LCD SPI channel number"
default 0
diff --git a/boards/arm/rp2040/raspberrypi-pico/src/Make.defs b/boards/arm/rp2040/raspberrypi-pico/src/Make.defs
index b78129495b..c3c8459ab6 100644
--- a/boards/arm/rp2040/raspberrypi-pico/src/Make.defs
+++ b/boards/arm/rp2040/raspberrypi-pico/src/Make.defs
@@ -24,14 +24,6 @@ CSRCS = rp2040_boardinitialize.c
CSRCS += rp2040_appinit.c
CSRCS += rp2040_bringup.c
-ifeq ($(CONFIG_BOARDCTL_RESET),y)
-CSRCS += rp2040_reset.c
-endif
-
-ifeq ($(CONFIG_SPI),y)
-CSRCS += rp2040_spi.c
-endif
-
ifeq ($(CONFIG_DEV_GPIO),y)
CSRCS += rp2040_gpio.c
endif
diff --git a/boards/arm/rp2040/raspberrypi-pico/src/rp2040_reset.c b/boards/arm/rp2040/raspberrypi-pico/src/rp2040_reset.c
deleted file mode 100644
index b81ca6b591..0000000000
--- a/boards/arm/rp2040/raspberrypi-pico/src/rp2040_reset.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
- * boards/arm/rp2040/raspberrypi-pico/src/rp2040_reset.c
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include <nuttx/config.h>
-#include <nuttx/board.h>
-#include <nuttx/arch.h>
-
-#ifdef CONFIG_BOARDCTL_RESET
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: board_reset
- *
- * Description:
- * Reset board. Support for this function is required by board-level
- * logic if CONFIG_BOARDCTL_RESET is selected.
- *
- * Input Parameters:
- * status - Status information provided with the reset event. This
- * meaning of this status information is board-specific. If not
- * used by a board, the value zero may be provided in calls to
- * board_reset().
- *
- * Returned Value:
- * If this function returns, then it was not possible to power-off the
- * board due to some constraints. The return value int this case is a
- * board-specific reason for the failure to shutdown.
- *
- ****************************************************************************/
-
-int board_reset(int status)
-{
- up_systemreset();
- return 0;
-}
-
-#endif /* CONFIG_BOARDCTL_RESET */
diff --git a/boards/arm/rp2040/raspberrypi-pico/src/rp2040_spi.c b/boards/arm/rp2040/raspberrypi-pico/src/rp2040_spi.c
deleted file mode 100644
index db9b8e4981..0000000000
--- a/boards/arm/rp2040/raspberrypi-pico/src/rp2040_spi.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/****************************************************************************
- * boards/arm/rp2040/raspberrypi-pico/src/rp2040_spi.c
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * 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 "arm_internal.h"
-#include "chip.h"
-#include "rp2040_gpio.h"
-#include "hardware/rp2040_spi.h"
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: rp2040_spi0/1select and rp2040_spi0/1status
- *
- * Description:
- * The external functions, rp2040_spi0/1select and rp2040_spi0/1status
- * 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 rp2040_spibus_initialize()) are provided by
- * common RP2040 logic. To use this common SPI logic on your board:
- *
- * 1. Provide logic in rp2040_boardinitialize() to configure SPI chip
- * select pins.
- * 2. Provide rp2040_spi0/1select() and rp2040_spi0/1status()
- * 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 rp2040_spibus_initialize() in your low level
- * application initialization logic
- * 4. The handle returned by rp2040_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_RP2040_SPI0
-void rp2040_spi0select(struct spi_dev_s *dev, uint32_t devid,
- bool selected)
-{
- spiinfo("devid: %d CS: %s\n", (int)devid,
- selected ? "assert" : "de-assert");
-
- rp2040_gpio_put(CONFIG_RP2040_SPI0_CS_GPIO, !selected);
-}
-
-uint8_t rp2040_spi0status(struct spi_dev_s *dev, uint32_t devid)
-{
- uint8_t ret = 0;
-
-# if defined(CONFIG_RP2040_SPISD) && (CONFIG_RP2040_SPISD_SPI_CH == 0)
- ret = board_spisd_status(dev, devid);
-# endif
- return ret;
-}
-
-#ifdef CONFIG_SPI_CMDDATA
-int rp2040_spi0cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
-{
-#ifdef CONFIG_LCD_ST7789
- if (devid == SPIDEV_DISPLAY(0))
- {
- /* This is the Data/Command control pad which determines whether the
- * data bits are data or a command.
- */
-
- rp2040_gpio_put(CONFIG_RP2040_SPI0_RX_GPIO, !cmd);
-
- return OK;
- }
-#endif
-
- return -ENODEV;
-}
-#endif
-#endif
-
-#ifdef CONFIG_RP2040_SPI1
-void rp2040_spi1select(struct spi_dev_s *dev, uint32_t devid,
- bool selected)
-{
- spiinfo("devid: %d CS: %s\n", (int)devid,
- selected ? "assert" : "de-assert");
-
- rp2040_gpio_put(CONFIG_RP2040_SPI1_CS_GPIO, !selected);
-}
-
-uint8_t rp2040_spi1status(struct spi_dev_s *dev, uint32_t devid)
-{
- uint8_t ret = 0;
-
-# if defined(CONFIG_RP2040_SPISD) && (CONFIG_RP2040_SPISD_SPI_CH == 1)
- ret = board_spisd_status(dev, devid);
-# endif
- return ret;
-}
-
-#ifdef CONFIG_SPI_CMDDATA
-int rp2040_spi1cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
-{
-#if defined (CONFIG_LCD_ST7789) || (CONFIG_LCD_ST7735)
- if (devid == SPIDEV_DISPLAY(0))
- {
- /* This is the Data/Command control pad which determines whether the
- * data bits are data or a command.
- */
-
- rp2040_gpio_put(CONFIG_RP2040_SPI1_RX_GPIO, !cmd);
-
- return OK;
- }
-#endif
-
- return -ENODEV;
-}
-#endif
-#endif