mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 14:53:47 +08:00
arch/arm: Remove FAR and CODE from board folder(2)
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
committed by
Petro Karashchenko
parent
cd001725b7
commit
a3c9b413d8
@@ -114,7 +114,7 @@
|
||||
int board_app_initialize(uintptr_t arg)
|
||||
{
|
||||
#ifdef NSH_HAVEMMCSD
|
||||
FAR struct spi_dev_s *spi;
|
||||
struct spi_dev_s *spi;
|
||||
int ret;
|
||||
|
||||
/* Get the SPI port */
|
||||
|
||||
@@ -138,10 +138,10 @@
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
static int up_attach(FAR const struct enc_lower_s *lower, xcpt_t handler,
|
||||
FAR void *arg);
|
||||
static void up_enable(FAR const struct enc_lower_s *lower);
|
||||
static void up_disable(FAR const struct enc_lower_s *lower);
|
||||
static int up_attach(const struct enc_lower_s *lower, xcpt_t handler,
|
||||
void *arg);
|
||||
static void up_enable(const struct enc_lower_s *lower);
|
||||
static void up_disable(const struct enc_lower_s *lower);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
@@ -167,18 +167,18 @@ static const struct enc_lower_s g_enclower =
|
||||
* Name: struct enc_lower_s methods
|
||||
****************************************************************************/
|
||||
|
||||
static int up_attach(FAR const struct enc_lower_s *lower, xcpt_t handler,
|
||||
FAR void *arg)
|
||||
static int up_attach(const struct enc_lower_s *lower, xcpt_t handler,
|
||||
void *arg)
|
||||
{
|
||||
return irq_attach(ENC28J60_IRQ, handler, arg);
|
||||
}
|
||||
|
||||
static void up_enable(FAR const struct enc_lower_s *lower)
|
||||
static void up_enable(const struct enc_lower_s *lower)
|
||||
{
|
||||
up_enable_irq(ENC28J60_IRQ);
|
||||
}
|
||||
|
||||
static void up_disable(FAR const struct enc_lower_s *lower)
|
||||
static void up_disable(const struct enc_lower_s *lower)
|
||||
{
|
||||
up_disable_irq(ENC28J60_IRQ);
|
||||
}
|
||||
@@ -193,7 +193,7 @@ static void up_disable(FAR const struct enc_lower_s *lower)
|
||||
|
||||
void arm_netinitialize(void)
|
||||
{
|
||||
FAR struct spi_dev_s *spi;
|
||||
struct spi_dev_s *spi;
|
||||
uint16_t reg16;
|
||||
int ret;
|
||||
|
||||
|
||||
@@ -377,29 +377,29 @@ struct str71x_spidev_s
|
||||
|
||||
/* Helpers */
|
||||
|
||||
static inline uint16_t spi_getreg(FAR struct str71x_spidev_s *priv,
|
||||
static inline uint16_t spi_getreg(struct str71x_spidev_s *priv,
|
||||
uint8_t offset);
|
||||
static inline void spi_putreg(FAR struct str71x_spidev_s *priv,
|
||||
static inline void spi_putreg(struct str71x_spidev_s *priv,
|
||||
uint8_t offset, uint16_t value);
|
||||
static inline void spi_drain(FAR struct str71x_spidev_s *priv);
|
||||
static inline void spi_drain(struct str71x_spidev_s *priv);
|
||||
|
||||
/* SPI methods */
|
||||
|
||||
static int spi_lock(FAR struct spi_dev_s *dev, bool lock);
|
||||
static void spi_select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
static int spi_lock(struct spi_dev_s *dev, bool lock);
|
||||
static void spi_select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected);
|
||||
static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev,
|
||||
uint32_t frequency);
|
||||
static uint8_t spi_status(FAR struct spi_dev_s *dev, uint32_t devid);
|
||||
static uint32_t spi_setfrequency(struct spi_dev_s *dev,
|
||||
uint32_t frequency);
|
||||
static uint8_t spi_status(struct spi_dev_s *dev, uint32_t devid);
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
static int spi_cmddata(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
static int spi_cmddata(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool cmd);
|
||||
#endif
|
||||
static uint32_t spi_send(FAR struct spi_dev_s *dev, uint32_t wd);
|
||||
static void spi_sndblock(FAR struct spi_dev_s *dev,
|
||||
FAR const void *buffer, size_t buflen);
|
||||
static void spi_recvblock(FAR struct spi_dev_s *dev,
|
||||
FAR void *buffer, size_t buflen);
|
||||
static uint32_t spi_send(struct spi_dev_s *dev, uint32_t wd);
|
||||
static void spi_sndblock(struct spi_dev_s *dev,
|
||||
const void *buffer, size_t buflen);
|
||||
static void spi_recvblock(struct spi_dev_s *dev,
|
||||
void *buffer, size_t buflen);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
@@ -469,7 +469,7 @@ static struct str71x_spidev_s g_spidev1 =
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline uint16_t spi_getreg(FAR struct str71x_spidev_s *priv,
|
||||
static inline uint16_t spi_getreg(struct str71x_spidev_s *priv,
|
||||
uint8_t offset)
|
||||
{
|
||||
return getreg16(priv->spibase + offset);
|
||||
@@ -491,7 +491,7 @@ static inline uint16_t spi_getreg(FAR struct str71x_spidev_s *priv,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void spi_putreg(FAR struct str71x_spidev_s *priv,
|
||||
static inline void spi_putreg(struct str71x_spidev_s *priv,
|
||||
uint8_t offset, uint16_t value)
|
||||
{
|
||||
putreg16(value, priv->spibase + offset);
|
||||
@@ -511,7 +511,7 @@ static inline void spi_putreg(FAR struct str71x_spidev_s *priv,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void spi_drain(FAR struct str71x_spidev_s *priv)
|
||||
static inline void spi_drain(struct str71x_spidev_s *priv)
|
||||
{
|
||||
#if CONFIG_STR714X_BSPI0_TXFIFO_DEPTH > 1
|
||||
/* Wait while the TX FIFO is full */
|
||||
@@ -573,9 +573,9 @@ static inline void spi_drain(FAR struct str71x_spidev_s *priv)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int spi_lock(FAR struct spi_dev_s *dev, bool lock)
|
||||
static int spi_lock(struct spi_dev_s *dev, bool lock)
|
||||
{
|
||||
FAR struct str71x_spidev_s *priv = (FAR struct str71x_spidev_s *)dev;
|
||||
struct str71x_spidev_s *priv = (struct str71x_spidev_s *)dev;
|
||||
int ret;
|
||||
|
||||
if (lock)
|
||||
@@ -608,10 +608,10 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void spi_select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
static void spi_select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
FAR struct str71x_spidev_s *priv = (FAR struct str71x_spidev_s *)dev;
|
||||
struct str71x_spidev_s *priv = (struct str71x_spidev_s *)dev;
|
||||
uint16_t reg16;
|
||||
|
||||
DEBUGASSERT(priv && priv->spibase);
|
||||
@@ -652,10 +652,10 @@ static void spi_select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev,
|
||||
static uint32_t spi_setfrequency(struct spi_dev_s *dev,
|
||||
uint32_t frequency)
|
||||
{
|
||||
FAR struct str71x_spidev_s *priv = (FAR struct str71x_spidev_s *)dev;
|
||||
struct str71x_spidev_s *priv = (struct str71x_spidev_s *)dev;
|
||||
uint32_t divisor;
|
||||
uint32_t cr1;
|
||||
|
||||
@@ -715,7 +715,7 @@ static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static uint8_t spi_status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
static uint8_t spi_status(struct spi_dev_s *dev, uint32_t devid)
|
||||
{
|
||||
uint8_t ret = 0;
|
||||
uint16_t reg16 = getreg16(STR71X_GPIO1_PD);
|
||||
@@ -758,7 +758,7 @@ static uint8_t spi_status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
static int spi_cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
static int spi_cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
{
|
||||
# error "spi_cmddata not implemented"
|
||||
return -ENOSYS;
|
||||
@@ -781,9 +781,9 @@ static int spi_cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static uint32_t spi_send(FAR struct spi_dev_s *dev, uint32_t wd)
|
||||
static uint32_t spi_send(struct spi_dev_s *dev, uint32_t wd)
|
||||
{
|
||||
FAR struct str71x_spidev_s *priv = (FAR struct str71x_spidev_s *)dev;
|
||||
struct str71x_spidev_s *priv = (struct str71x_spidev_s *)dev;
|
||||
|
||||
DEBUGASSERT(priv && priv->spibase);
|
||||
|
||||
@@ -836,11 +836,11 @@ static uint32_t spi_send(FAR struct spi_dev_s *dev, uint32_t wd)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void spi_sndblock(FAR struct spi_dev_s *dev,
|
||||
FAR const void *buffer, size_t buflen)
|
||||
static void spi_sndblock(struct spi_dev_s *dev,
|
||||
const void *buffer, size_t buflen)
|
||||
{
|
||||
FAR struct str71x_spidev_s *priv = (FAR struct str71x_spidev_s *)dev;
|
||||
FAR const uint8_t *ptr = (FAR const uint8_t *)buffer;
|
||||
struct str71x_spidev_s *priv = (struct str71x_spidev_s *)dev;
|
||||
const uint8_t *ptr = (const uint8_t *)buffer;
|
||||
uint16_t csr2;
|
||||
|
||||
DEBUGASSERT(priv && priv->spibase);
|
||||
@@ -912,11 +912,11 @@ static void spi_sndblock(FAR struct spi_dev_s *dev,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer,
|
||||
static void spi_recvblock(struct spi_dev_s *dev, void *buffer,
|
||||
size_t buflen)
|
||||
{
|
||||
FAR struct str71x_spidev_s *priv = (FAR struct str71x_spidev_s *)dev;
|
||||
FAR uint8_t *ptr = (FAR uint8_t *)buffer;
|
||||
struct str71x_spidev_s *priv = (struct str71x_spidev_s *)dev;
|
||||
uint8_t *ptr = (uint8_t *)buffer;
|
||||
uint32_t fifobytes = 0;
|
||||
|
||||
DEBUGASSERT(priv && priv->spibase);
|
||||
@@ -971,9 +971,9 @@ static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct spi_dev_s *str71_spibus_initialize(int port)
|
||||
struct spi_dev_s *str71_spibus_initialize(int port)
|
||||
{
|
||||
FAR struct spi_dev_s *ret;
|
||||
struct spi_dev_s *ret;
|
||||
#if defined(CONFIG_STR71X_BSPI0) || defined(CONFIG_STR71X_BSPI1)
|
||||
uint16_t reg16;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user