From 15fda8888a400dfa96e9357890db483873659e3f Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Sun, 15 Jul 2012 05:35:14 +0000 Subject: [PATCH] Use the pin number rather than the hybrid pin number + name. --- sys/boot/arm/at91/bootspi/ee.c | 8 +++--- sys/boot/arm/at91/libat91/at91rm9200.h | 2 +- .../arm/at91/libat91/at91rm9200_lowlevel.c | 4 +-- sys/boot/arm/at91/libat91/eeprom.c | 8 +++--- sys/boot/arm/at91/libat91/emac_init.c | 28 +++++++++---------- sys/boot/arm/at91/libat91/lib_AT91RM9200.h | 12 ++++---- sys/boot/arm/at91/libat91/spi_flash.c | 8 +++--- 7 files changed, 35 insertions(+), 35 deletions(-) diff --git a/sys/boot/arm/at91/bootspi/ee.c b/sys/boot/arm/at91/bootspi/ee.c index 62a02d98edfd..ef0571924b6c 100644 --- a/sys/boot/arm/at91/bootspi/ee.c +++ b/sys/boot/arm/at91/bootspi/ee.c @@ -59,11 +59,11 @@ EEInit(void) AT91PS_PIO pPio = (AT91PS_PIO)AT91C_BASE_PIOA; AT91PS_PMC pPMC = (AT91PS_PMC)AT91C_BASE_PMC; - pPio->PIO_ASR = AT91C_PA25_TWD | AT91C_PA26_TWCK; - pPio->PIO_PDR = AT91C_PA25_TWD | AT91C_PA26_TWCK; + pPio->PIO_ASR = AT91C_PIO_PA25 | AT91C_PIO_PA26; + pPio->PIO_PDR = AT91C_PIO_PA25 | AT91C_PIO_PA26; - pPio->PIO_MDDR = ~AT91C_PA25_TWD; - pPio->PIO_MDER = AT91C_PA25_TWD; + pPio->PIO_MDDR = ~AT91C_PIO_PA25; + pPio->PIO_MDER = AT91C_PIO_PA25; pPMC->PMC_PCER = 1u << AT91C_ID_TWI; diff --git a/sys/boot/arm/at91/libat91/at91rm9200.h b/sys/boot/arm/at91/libat91/at91rm9200.h index db767089dedc..80d44c82430e 100644 --- a/sys/boot/arm/at91/libat91/at91rm9200.h +++ b/sys/boot/arm/at91/libat91/at91rm9200.h @@ -2311,7 +2311,7 @@ typedef struct _AT91S_BFC { // ========== Register definition for BFC peripheral ========== #define AT91C_BFC_MR ((AT91_REG *) 0xFFFFFFC0) // (BFC) BFC Mode Register -#include +#include // ***************************************************************************** // PERIPHERAL ID DEFINITIONS FOR AT91RM9200 diff --git a/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.c b/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.c index fb9d9c6b232f..1d54cfdad483 100644 --- a/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.c +++ b/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.c @@ -188,8 +188,8 @@ _init(void) AT91C_BASE_PIOC->PIO_PDR = 0xffff0000; #endif // Configure DBGU -use local routine optimized for space - AT91C_BASE_PIOA->PIO_ASR = AT91C_PA31_DTXD | AT91C_PA30_DRXD; - AT91C_BASE_PIOA->PIO_PDR = AT91C_PA31_DTXD | AT91C_PA30_DRXD; + AT91C_BASE_PIOA->PIO_ASR = AT91C_PIO_PA31 | AT91C_PIO_PA30; + AT91C_BASE_PIOA->PIO_PDR = AT91C_PIO_PA31 | AT91C_PIO_PA30; pUSART->US_IDR = (unsigned int) -1; pUSART->US_CR = AT91C_US_RSTRX | AT91C_US_RSTTX | AT91C_US_RXDIS | AT91C_US_TXDIS; diff --git a/sys/boot/arm/at91/libat91/eeprom.c b/sys/boot/arm/at91/libat91/eeprom.c index f5fc52bf1a86..e08996bed8e6 100644 --- a/sys/boot/arm/at91/libat91/eeprom.c +++ b/sys/boot/arm/at91/libat91/eeprom.c @@ -58,11 +58,11 @@ InitEEPROM(void) AT91PS_PIO pPio = (AT91PS_PIO)AT91C_BASE_PIOA; AT91PS_PMC pPMC = (AT91PS_PMC)AT91C_BASE_PMC; - pPio->PIO_ASR = AT91C_PA25_TWD | AT91C_PA26_TWCK; - pPio->PIO_PDR = AT91C_PA25_TWD | AT91C_PA26_TWCK; + pPio->PIO_ASR = AT91C_PIO_PA25 | AT91C_PIO_PA26; + pPio->PIO_PDR = AT91C_PIO_PA25 | AT91C_PIO_PA26; - pPio->PIO_MDDR = ~AT91C_PA25_TWD; - pPio->PIO_MDER = AT91C_PA25_TWD; + pPio->PIO_MDDR = ~AT91C_PIO_PA25; + pPio->PIO_MDER = AT91C_PIO_PA25; pPMC->PMC_PCER = 1u << AT91C_ID_TWI; diff --git a/sys/boot/arm/at91/libat91/emac_init.c b/sys/boot/arm/at91/libat91/emac_init.c index 30246226d617..a3869b67de91 100644 --- a/sys/boot/arm/at91/libat91/emac_init.c +++ b/sys/boot/arm/at91/libat91/emac_init.c @@ -85,24 +85,24 @@ EMAC_SetMACAddress(unsigned char mac[6]) AT91C_BASE_PMC->PMC_PCER = 1u << AT91C_ID_EMAC; AT91C_BASE_PIOA->PIO_ASR = - AT91C_PA14_ERXER | AT91C_PA12_ERX0 | AT91C_PA13_ERX1 | - AT91C_PA8_ETXEN | AT91C_PA16_EMDIO | AT91C_PA9_ETX0 | - AT91C_PA10_ETX1 | AT91C_PA11_ECRS_ECRSDV | AT91C_PA15_EMDC | - AT91C_PA7_ETXCK_EREFCK; + AT91C_PIO_PA14 | AT91C_PIO_PA12 | AT91C_PIO_PA13 | + AT91C_PIO_PA8 | AT91C_PIO_PA16 | AT91C_PIO_PA9 | + AT91C_PIO_PA10 | AT91C_PIO_PA11 | AT91C_PIO_PA15 | + AT91C_PIO_PA7; AT91C_BASE_PIOA->PIO_PDR = - AT91C_PA14_ERXER | AT91C_PA12_ERX0 | AT91C_PA13_ERX1 | - AT91C_PA8_ETXEN | AT91C_PA16_EMDIO | AT91C_PA9_ETX0 | - AT91C_PA10_ETX1 | AT91C_PA11_ECRS_ECRSDV | AT91C_PA15_EMDC | - AT91C_PA7_ETXCK_EREFCK; + AT91C_PIO_PA14 | AT91C_PIO_PA12 | AT91C_PIO_PA13 | + AT91C_PIO_PA8 | AT91C_PIO_PA16 | AT91C_PIO_PA9 | + AT91C_PIO_PA10 | AT91C_PIO_PA11 | AT91C_PIO_PA15 | + AT91C_PIO_PA7; #if defined(BOOT_KB920X) | defined(BOOT_BWCT) /* Really !RMII */ AT91C_BASE_PIOB->PIO_BSR = - AT91C_PB12_ETX2 | AT91C_PB13_ETX3 | AT91C_PB14_ETXER | - AT91C_PB15_ERX2 | AT91C_PB16_ERX3 | AT91C_PB17_ERXDV | - AT91C_PB18_ECOL | AT91C_PB19_ERXCK; + AT91C_PIO_PB12 | AT91C_PIO_PB13 | AT91C_PIO_PB14 | + AT91C_PIO_PB15 | AT91C_PIO_PB16 | AT91C_PIO_PB17 | + AT91C_PIO_PB18 | AT91C_PIO_PB19; AT91C_BASE_PIOB->PIO_PDR = - AT91C_PB12_ETX2 | AT91C_PB13_ETX3 | AT91C_PB14_ETXER | - AT91C_PB15_ERX2 | AT91C_PB16_ERX3 | AT91C_PB17_ERXDV | - AT91C_PB18_ECOL | AT91C_PB19_ERXCK; + AT91C_PIO_PB12 | AT91C_PIO_PB13 | AT91C_PIO_PB14 | + AT91C_PIO_PB15 | AT91C_PIO_PB16 | AT91C_PIO_PB17 | + AT91C_PIO_PB18 | AT91C_PIO_PB19; #endif pEmac->EMAC_CTL = 0; diff --git a/sys/boot/arm/at91/libat91/lib_AT91RM9200.h b/sys/boot/arm/at91/libat91/lib_AT91RM9200.h index d5a5b67255ab..c87512f9b017 100644 --- a/sys/boot/arm/at91/libat91/lib_AT91RM9200.h +++ b/sys/boot/arm/at91/libat91/lib_AT91RM9200.h @@ -134,17 +134,17 @@ AT91F_MCI_CfgPIO(void) // Configure PIO controllers to periph mode AT91F_PIO_CfgPeriph( AT91C_BASE_PIOA, // PIO controller base address - ((unsigned int) AT91C_PA28_MCCDA ) | - ((unsigned int) AT91C_PA29_MCDA0 ) | - ((unsigned int) AT91C_PA27_MCCK ), // Peripheral A + ((unsigned int) AT91C_PIO_PA28 ) | + ((unsigned int) AT91C_PIO_PA29 ) | + ((unsigned int) AT91C_PIO_PA27 ), // Peripheral A 0); // Peripheral B // Configure PIO controllers to periph mode AT91F_PIO_CfgPeriph( AT91C_BASE_PIOB, // PIO controller base address 0, // Peripheral A - ((unsigned int) AT91C_PB5_MCDA3 ) | - ((unsigned int) AT91C_PB3_MCDA1 ) | - ((unsigned int) AT91C_PB4_MCDA2 )); // Peripheral B + ((unsigned int) AT91C_PIO_PB5 ) | + ((unsigned int) AT91C_PIO_PB3 ) | + ((unsigned int) AT91C_PIO_PB4 )); // Peripheral B } diff --git a/sys/boot/arm/at91/libat91/spi_flash.c b/sys/boot/arm/at91/libat91/spi_flash.c index 591b9ebfe002..388e64e2021f 100644 --- a/sys/boot/arm/at91/libat91/spi_flash.c +++ b/sys/boot/arm/at91/libat91/spi_flash.c @@ -223,10 +223,10 @@ SPI_InitFlash(void) // enable CS0, CLK, MOSI, MISO pPio = (AT91PS_PIO)AT91C_BASE_PIOA; - pPio->PIO_ASR = AT91C_PA3_NPCS0 | AT91C_PA1_MOSI | AT91C_PA0_MISO | - AT91C_PA2_SPCK; - pPio->PIO_PDR = AT91C_PA3_NPCS0 | AT91C_PA1_MOSI | AT91C_PA0_MISO | - AT91C_PA2_SPCK; + pPio->PIO_ASR = AT91C_PIO_PA3 | AT91C_PIO_PA1 | AT91C_PIO_PA0 | + AT91C_PIO_PA2; + pPio->PIO_PDR = AT91C_PIO_PA3 | AT91C_PIO_PA1 | AT91C_PIO_PA0 | + AT91C_PIO_PA2; // enable clocks to SPI AT91C_BASE_PMC->PMC_PCER = 1u << AT91C_ID_SPI;