mirror of
https://github.com/apache/nuttx.git
synced 2026-10-13 17:20:20 +00:00
configs/lpcxpresso-lp54629: Add logic to configure EMC pins. arch/arm/src/lpc54xx: Correct GPIO read/write logic. Update pin configuration for EMC pins. All should have the input file offset and fast slew rate.
This commit is contained in:
parent
df3404da09
commit
0508048291
5 changed files with 175 additions and 90 deletions
|
|
@ -242,91 +242,91 @@
|
|||
|
||||
/* External Memory Controller (EMC) */
|
||||
|
||||
#define GPIO_EMC_A0 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT0 | GPIO_PIN18)
|
||||
#define GPIO_EMC_A1 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT0 | GPIO_PIN19)
|
||||
#define GPIO_EMC_A2 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT0 | GPIO_PIN20)
|
||||
#define GPIO_EMC_A3 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT0 | GPIO_PIN21)
|
||||
#define GPIO_EMC_A4 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT1 | GPIO_PIN5)
|
||||
#define GPIO_EMC_A5 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT1 | GPIO_PIN6)
|
||||
#define GPIO_EMC_A6 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT1 | GPIO_PIN7)
|
||||
#define GPIO_EMC_A7 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT1 | GPIO_PIN8)
|
||||
#define GPIO_EMC_A8 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT1 | GPIO_PIN26)
|
||||
#define GPIO_EMC_A9 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT1 | GPIO_PIN27)
|
||||
#define GPIO_EMC_A10 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT1 | GPIO_PIN16)
|
||||
#define GPIO_EMC_A11 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT1 | GPIO_PIN23)
|
||||
#define GPIO_EMC_A12 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT1 | GPIO_PIN24)
|
||||
#define GPIO_EMC_A13 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT1 | GPIO_PIN25)
|
||||
#define GPIO_EMC_A14 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT3 | GPIO_PIN25)
|
||||
#define GPIO_EMC_A15 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT3 | GPIO_PIN26)
|
||||
#define GPIO_EMC_A16 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT3 | GPIO_PIN27)
|
||||
#define GPIO_EMC_A17 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT3 | GPIO_PIN28)
|
||||
#define GPIO_EMC_A18 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT3 | GPIO_PIN29)
|
||||
#define GPIO_EMC_A19 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT3 | GPIO_PIN30)
|
||||
#define GPIO_EMC_A20 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT3 | GPIO_PIN31)
|
||||
#define GPIO_EMC_A21 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT5 | GPIO_PIN5)
|
||||
#define GPIO_EMC_A22 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT5 | GPIO_PIN6)
|
||||
#define GPIO_EMC_A23 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT5 | GPIO_PIN7)
|
||||
#define GPIO_EMC_A24 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT5 | GPIO_PIN8)
|
||||
#define GPIO_EMC_A25 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT5 | GPIO_PIN9)
|
||||
#define GPIO_EMC_BLSN0 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT1 | GPIO_PIN17)
|
||||
#define GPIO_EMC_BLSN1 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT1 | GPIO_PIN18)
|
||||
#define GPIO_EMC_BLSN2 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT4 | GPIO_PIN17)
|
||||
#define GPIO_EMC_BLSN3 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT4 | GPIO_PIN18)
|
||||
#define GPIO_EMC_CASN (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT1 | GPIO_PIN9)
|
||||
#define GPIO_EMC_CKE0 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT1 | GPIO_PIN15)
|
||||
#define GPIO_EMC_CKE1 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT1 | GPIO_PIN22)
|
||||
#define GPIO_EMC_CKE2 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT4 | GPIO_PIN5)
|
||||
#define GPIO_EMC_CKE3 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT4 | GPIO_PIN6)
|
||||
#define GPIO_EMC_CLK0 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT1 | GPIO_PIN11)
|
||||
#define GPIO_EMC_CLK1 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT3 | GPIO_PIN12)
|
||||
#define GPIO_EMC_CSN0 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT0 | GPIO_PIN16) /* Type A */
|
||||
#define GPIO_EMC_CSN1 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT4 | GPIO_PIN0)
|
||||
#define GPIO_EMC_CSN2 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT4 | GPIO_PIN1)
|
||||
#define GPIO_EMC_CSN3 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT4 | GPIO_PIN2)
|
||||
#define GPIO_EMC_D0 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT0 | GPIO_PIN2)
|
||||
#define GPIO_EMC_D1 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT0 | GPIO_PIN3)
|
||||
#define GPIO_EMC_D2 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT0 | GPIO_PIN4)
|
||||
#define GPIO_EMC_D3 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT0 | GPIO_PIN5)
|
||||
#define GPIO_EMC_D4 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT0 | GPIO_PIN6)
|
||||
#define GPIO_EMC_D5 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT0 | GPIO_PIN7)
|
||||
#define GPIO_EMC_D6 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT0 | GPIO_PIN8)
|
||||
#define GPIO_EMC_D7 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT0 | GPIO_PIN9)
|
||||
#define GPIO_EMC_D8 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT1 | GPIO_PIN19)
|
||||
#define GPIO_EMC_D9 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT1 | GPIO_PIN20)
|
||||
#define GPIO_EMC_D10 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT1 | GPIO_PIN21)
|
||||
#define GPIO_EMC_D11 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT1 | GPIO_PIN4)
|
||||
#define GPIO_EMC_D12 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT1 | GPIO_PIN28)
|
||||
#define GPIO_EMC_D13 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT1 | GPIO_PIN29)
|
||||
#define GPIO_EMC_D14 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT1 | GPIO_PIN30)
|
||||
#define GPIO_EMC_D15 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT1 | GPIO_PIN31)
|
||||
#define GPIO_EMC_D16 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT4 | GPIO_PIN21)
|
||||
#define GPIO_EMC_D17 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT4 | GPIO_PIN22)
|
||||
#define GPIO_EMC_D18 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT4 | GPIO_PIN23)
|
||||
#define GPIO_EMC_D19 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT4 | GPIO_PIN24)
|
||||
#define GPIO_EMC_D20 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT4 | GPIO_PIN25)
|
||||
#define GPIO_EMC_D21 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT4 | GPIO_PIN26)
|
||||
#define GPIO_EMC_D22 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT4 | GPIO_PIN27)
|
||||
#define GPIO_EMC_D23 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT4 | GPIO_PIN28)
|
||||
#define GPIO_EMC_D24 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT4 | GPIO_PIN29)
|
||||
#define GPIO_EMC_D25 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT4 | GPIO_PIN30)
|
||||
#define GPIO_EMC_D26 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT4 | GPIO_PIN31)
|
||||
#define GPIO_EMC_D27 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT5 | GPIO_PIN0)
|
||||
#define GPIO_EMC_D28 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT5 | GPIO_PIN1)
|
||||
#define GPIO_EMC_D29 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT5 | GPIO_PIN2)
|
||||
#define GPIO_EMC_D30 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT5 | GPIO_PIN3)
|
||||
#define GPIO_EMC_D31 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT5 | GPIO_PIN4)
|
||||
#define GPIO_EMC_DQM0 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT1 | GPIO_PIN13)
|
||||
#define GPIO_EMC_DQM1 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT1 | GPIO_PIN14)
|
||||
#define GPIO_EMC_DQM2 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT4 | GPIO_PIN19)
|
||||
#define GPIO_EMC_DQM3 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT4 | GPIO_PIN20)
|
||||
#define GPIO_EMC_DYCSN0 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT1 | GPIO_PIN12)
|
||||
#define GPIO_EMC_DYCSN1 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT3 | GPIO_PIN10)
|
||||
#define GPIO_EMC_DYCSN2 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT4 | GPIO_PIN3)
|
||||
#define GPIO_EMC_DYCSN3 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT4 | GPIO_PIN4)
|
||||
#define GPIO_EMC_FBCK (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT3 | GPIO_PIN13)
|
||||
#define GPIO_EMC_OEN (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT0 | GPIO_PIN17)
|
||||
#define GPIO_EMC_RASN (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT1 | GPIO_PIN10)
|
||||
#define GPIO_EMC_WEN (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_PORT0 | GPIO_PIN15) /* Type A */
|
||||
#define GPIO_EMC_A0 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT0 | GPIO_PIN18)
|
||||
#define GPIO_EMC_A1 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT0 | GPIO_PIN19)
|
||||
#define GPIO_EMC_A2 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT0 | GPIO_PIN20)
|
||||
#define GPIO_EMC_A3 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT0 | GPIO_PIN21)
|
||||
#define GPIO_EMC_A4 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT1 | GPIO_PIN5)
|
||||
#define GPIO_EMC_A5 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT1 | GPIO_PIN6)
|
||||
#define GPIO_EMC_A6 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT1 | GPIO_PIN7)
|
||||
#define GPIO_EMC_A7 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT1 | GPIO_PIN8)
|
||||
#define GPIO_EMC_A8 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT1 | GPIO_PIN26)
|
||||
#define GPIO_EMC_A9 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT1 | GPIO_PIN27)
|
||||
#define GPIO_EMC_A10 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT1 | GPIO_PIN16)
|
||||
#define GPIO_EMC_A11 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT1 | GPIO_PIN23)
|
||||
#define GPIO_EMC_A12 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT1 | GPIO_PIN24)
|
||||
#define GPIO_EMC_A13 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT1 | GPIO_PIN25)
|
||||
#define GPIO_EMC_A14 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT3 | GPIO_PIN25)
|
||||
#define GPIO_EMC_A15 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT3 | GPIO_PIN26)
|
||||
#define GPIO_EMC_A16 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT3 | GPIO_PIN27)
|
||||
#define GPIO_EMC_A17 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT3 | GPIO_PIN28)
|
||||
#define GPIO_EMC_A18 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT3 | GPIO_PIN29)
|
||||
#define GPIO_EMC_A19 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT3 | GPIO_PIN30)
|
||||
#define GPIO_EMC_A20 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT3 | GPIO_PIN31)
|
||||
#define GPIO_EMC_A21 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT5 | GPIO_PIN5)
|
||||
#define GPIO_EMC_A22 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT5 | GPIO_PIN6)
|
||||
#define GPIO_EMC_A23 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT5 | GPIO_PIN7)
|
||||
#define GPIO_EMC_A24 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT5 | GPIO_PIN8)
|
||||
#define GPIO_EMC_A25 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT5 | GPIO_PIN9)
|
||||
#define GPIO_EMC_BLSN0 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT1 | GPIO_PIN17)
|
||||
#define GPIO_EMC_BLSN1 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT1 | GPIO_PIN18)
|
||||
#define GPIO_EMC_BLSN2 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT4 | GPIO_PIN17)
|
||||
#define GPIO_EMC_BLSN3 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT4 | GPIO_PIN18)
|
||||
#define GPIO_EMC_CASN (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT1 | GPIO_PIN9)
|
||||
#define GPIO_EMC_CKE0 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT1 | GPIO_PIN15)
|
||||
#define GPIO_EMC_CKE1 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT1 | GPIO_PIN22)
|
||||
#define GPIO_EMC_CKE2 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT4 | GPIO_PIN5)
|
||||
#define GPIO_EMC_CKE3 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT4 | GPIO_PIN6)
|
||||
#define GPIO_EMC_CLK0 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT1 | GPIO_PIN11)
|
||||
#define GPIO_EMC_CLK1 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT3 | GPIO_PIN12)
|
||||
#define GPIO_EMC_CSN0 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_PORT0 | GPIO_PIN16) /* Type A */
|
||||
#define GPIO_EMC_CSN1 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT4 | GPIO_PIN0)
|
||||
#define GPIO_EMC_CSN2 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT4 | GPIO_PIN1)
|
||||
#define GPIO_EMC_CSN3 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT4 | GPIO_PIN2)
|
||||
#define GPIO_EMC_D0 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT0 | GPIO_PIN2)
|
||||
#define GPIO_EMC_D1 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT0 | GPIO_PIN3)
|
||||
#define GPIO_EMC_D2 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT0 | GPIO_PIN4)
|
||||
#define GPIO_EMC_D3 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT0 | GPIO_PIN5)
|
||||
#define GPIO_EMC_D4 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT0 | GPIO_PIN6)
|
||||
#define GPIO_EMC_D5 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT0 | GPIO_PIN7)
|
||||
#define GPIO_EMC_D6 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT0 | GPIO_PIN8)
|
||||
#define GPIO_EMC_D7 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT0 | GPIO_PIN9)
|
||||
#define GPIO_EMC_D8 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT1 | GPIO_PIN19)
|
||||
#define GPIO_EMC_D9 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT1 | GPIO_PIN20)
|
||||
#define GPIO_EMC_D10 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT1 | GPIO_PIN21)
|
||||
#define GPIO_EMC_D11 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT1 | GPIO_PIN4)
|
||||
#define GPIO_EMC_D12 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT1 | GPIO_PIN28)
|
||||
#define GPIO_EMC_D13 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT1 | GPIO_PIN29)
|
||||
#define GPIO_EMC_D14 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT1 | GPIO_PIN30)
|
||||
#define GPIO_EMC_D15 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT1 | GPIO_PIN31)
|
||||
#define GPIO_EMC_D16 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT4 | GPIO_PIN21)
|
||||
#define GPIO_EMC_D17 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT4 | GPIO_PIN22)
|
||||
#define GPIO_EMC_D18 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT4 | GPIO_PIN23)
|
||||
#define GPIO_EMC_D19 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT4 | GPIO_PIN24)
|
||||
#define GPIO_EMC_D20 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT4 | GPIO_PIN25)
|
||||
#define GPIO_EMC_D21 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT4 | GPIO_PIN26)
|
||||
#define GPIO_EMC_D22 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT4 | GPIO_PIN27)
|
||||
#define GPIO_EMC_D23 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT4 | GPIO_PIN28)
|
||||
#define GPIO_EMC_D24 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT4 | GPIO_PIN29)
|
||||
#define GPIO_EMC_D25 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT4 | GPIO_PIN30)
|
||||
#define GPIO_EMC_D26 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT4 | GPIO_PIN31)
|
||||
#define GPIO_EMC_D27 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT5 | GPIO_PIN0)
|
||||
#define GPIO_EMC_D28 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT5 | GPIO_PIN1)
|
||||
#define GPIO_EMC_D29 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT5 | GPIO_PIN2)
|
||||
#define GPIO_EMC_D30 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT5 | GPIO_PIN3)
|
||||
#define GPIO_EMC_D31 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT5 | GPIO_PIN4)
|
||||
#define GPIO_EMC_DQM0 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT1 | GPIO_PIN13)
|
||||
#define GPIO_EMC_DQM1 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT1 | GPIO_PIN14)
|
||||
#define GPIO_EMC_DQM2 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT4 | GPIO_PIN19)
|
||||
#define GPIO_EMC_DQM3 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT4 | GPIO_PIN20)
|
||||
#define GPIO_EMC_DYCSN0 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT1 | GPIO_PIN12)
|
||||
#define GPIO_EMC_DYCSN1 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT3 | GPIO_PIN10)
|
||||
#define GPIO_EMC_DYCSN2 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT4 | GPIO_PIN3)
|
||||
#define GPIO_EMC_DYCSN3 (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT4 | GPIO_PIN4)
|
||||
#define GPIO_EMC_FBCK (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT3 | GPIO_PIN13)
|
||||
#define GPIO_EMC_OEN (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT0 | GPIO_PIN17)
|
||||
#define GPIO_EMC_RASN (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_SLEW_FAST | GPIO_PORT1 | GPIO_PIN10)
|
||||
#define GPIO_EMC_WEN (GPIO_ALT6 | GPIO_MODE_DIGITAL | GPIO_FILTER_OFF | GPIO_PORT0 | GPIO_PIN15) /* Type A */
|
||||
|
||||
/* Ethernet (ENET) */
|
||||
|
||||
|
|
|
|||
|
|
@ -213,7 +213,10 @@ static inline void lpc54_gpio_output(lpc54_pinset_t cfgset,
|
|||
regval |= (1 << pin);
|
||||
putreg32(regval, regaddr);
|
||||
|
||||
/* Set the initial value of the output */
|
||||
/* Set the initial value of the output. Apparently this cannot be done
|
||||
* before cofiguring the pin as an output. I don't see anyway to avoid
|
||||
* glitch.
|
||||
*/
|
||||
|
||||
lpc54_gpio_write(cfgset, ((cfgset & GPIO_VALUE) != GPIO_VALUE_ZERO));
|
||||
}
|
||||
|
|
@ -438,7 +441,7 @@ int lpc54_gpio_config(lpc54_pinset_t cfgset)
|
|||
|
||||
void lpc54_gpio_write(lpc54_pinset_t pinset, bool value)
|
||||
{
|
||||
unsigned int portpin = pinset & GPIO_PIN_MASK;
|
||||
unsigned int portpin = pinset & PORTPIN_MASK;
|
||||
putreg8((uint32_t)value, LPC54_GPIO_B(portpin));
|
||||
}
|
||||
|
||||
|
|
@ -452,6 +455,6 @@ void lpc54_gpio_write(lpc54_pinset_t pinset, bool value)
|
|||
|
||||
bool lpc54_gpio_read(lpc54_pinset_t pinset)
|
||||
{
|
||||
unsigned int portpin = pinset & GPIO_PIN_MASK;
|
||||
unsigned int portpin = pinset & PORTPIN_MASK;
|
||||
return (bool)getreg8(LPC54_GPIO_B(portpin));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,12 +57,11 @@
|
|||
************************************************************************************/
|
||||
/* Bit-encoded input to lpc54_gpio_config() ******************************************/
|
||||
|
||||
/* 32-Bit Encoding: .... .... TTTT TTTT FFFF ...V PPPN NNNN
|
||||
/* 32-Bit Encoding: .... .... TTTT TTTT FFFF MM.V PPPN NNNN
|
||||
*
|
||||
* Special Pin Functions: TTTT TTTT
|
||||
* Pin Function: FFFF
|
||||
* Pin Mode bits: MM
|
||||
* Open drain: O (output pins)
|
||||
* Initial value: V (output pins)
|
||||
* Port number: PPP (0-5)
|
||||
* Pin number: NNNNN (0-31)
|
||||
|
|
|
|||
|
|
@ -30,6 +30,35 @@ STATUS
|
|||
2017-12-10: The basic NSH configuration is functional at 220MHz with a
|
||||
Serial console, timer and LED support. Added support for the external
|
||||
SDRAM and for the RAM test utility -- UNTESTED!
|
||||
2017-12-11: Fixed an error in board LEDs. SDRAM is marginally functional:
|
||||
|
||||
nsh> mw a0000000=55555555
|
||||
a0000000 = 0x00000000 -> 0x55555555
|
||||
nsh> mw a0000000
|
||||
a0000000 = 0x55555555
|
||||
|
||||
But does not pass the ramtest. These tests all pass:
|
||||
|
||||
nsh> ramtest a0000000 16
|
||||
nsh> ramtest a0000000 32
|
||||
nsh> ramtest a0000000 64
|
||||
nsh> ramtest a0000000 126
|
||||
|
||||
But this fails the marching one's test (only):
|
||||
|
||||
nsh> ramtest a0000000 128
|
||||
RAMTest: Marching ones: a0000000 128
|
||||
RAMTest: ERROR: Address a0000006 Found: 0002 Expected 0001
|
||||
RAMTest: ERROR: Address a0000008 Found: 0002 Expected 0001
|
||||
...
|
||||
RAMTest: ERROR: Address a000007e Found: d47e Expected 0001
|
||||
RAMTest: Marching zeroes: a0000000 128
|
||||
RAMTest: Pattern test: a0000000 128 55555555 aaaaaaaa
|
||||
RAMTest: Pattern test: a0000000 128 66666666 99999999
|
||||
RAMTest: Pattern test: a0000000 128 33333333 cccccccc
|
||||
RAMTest: Address-in-address test: a0000000 128
|
||||
|
||||
Additional test fail as the size of the test increases.
|
||||
|
||||
Configurations
|
||||
==============
|
||||
|
|
@ -110,3 +139,21 @@ Configurations
|
|||
2. SDRAM support is enabled, but the SDRAM is *not* added to the system
|
||||
heap. The apps/system/ramtest utility is include in the build as an
|
||||
NSH builtin function that can be used to verify the SDRAM.
|
||||
|
||||
nsh> ramtest -h
|
||||
RAMTest: Missing required arguments
|
||||
|
||||
Usage: <noname> [-w|h|b] <hex-address> <decimal-size>
|
||||
|
||||
Where:
|
||||
<hex-address> starting address of the test.
|
||||
<decimal-size> number of memory locations (in bytes).
|
||||
-w Sets the width of a memory location to 32-bits.
|
||||
-h Sets the width of a memory location to 16-bits (default).
|
||||
-b Sets the width of a memory location to 8-bits.
|
||||
|
||||
The MTL48LC8M16A2B4-6A SDRAM is on CS0 which corresponds to address
|
||||
0xa0000000, the size of the memory is 128Mbits or 16Mb. So the DRAM
|
||||
may be tested with this command:
|
||||
|
||||
nsh> ramtest a0000000 16777216
|
||||
|
|
|
|||
|
|
@ -39,6 +39,8 @@
|
|||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include "chip/lpc54_pinmux.h"
|
||||
#include "lpc54_gpio.h"
|
||||
#include "lpc54_emc.h"
|
||||
#include "lpcxpresso-lpc54628.h"
|
||||
|
||||
|
|
@ -69,6 +71,31 @@ static const struct emc_config_s g_emc_config =
|
|||
#endif
|
||||
};
|
||||
|
||||
/* Pin configuration */
|
||||
|
||||
static const lpc54_pinset_t g_emc_pinset[] =
|
||||
{
|
||||
/* Control signals */
|
||||
|
||||
GPIO_EMC_CASN, GPIO_EMC_RASN, GPIO_EMC_WEN, GPIO_EMC_CLK0,
|
||||
GPIO_EMC_CKE0, GPIO_EMC_DYCSN0, GPIO_EMC_DQM0, GPIO_EMC_DQM1,
|
||||
|
||||
/* Address lines */
|
||||
|
||||
GPIO_EMC_A0, GPIO_EMC_A1, GPIO_EMC_A2, GPIO_EMC_A3, GPIO_EMC_A4,
|
||||
GPIO_EMC_A5, GPIO_EMC_A6, GPIO_EMC_A7, GPIO_EMC_A8, GPIO_EMC_A9,
|
||||
GPIO_EMC_A10, GPIO_EMC_A11, GPIO_EMC_A12, GPIO_EMC_A13, GPIO_EMC_A14,
|
||||
|
||||
/* Data lines */
|
||||
|
||||
GPIO_EMC_D0, GPIO_EMC_D1, GPIO_EMC_D2, GPIO_EMC_D3, GPIO_EMC_D4,
|
||||
GPIO_EMC_D5, GPIO_EMC_D6, GPIO_EMC_D7, GPIO_EMC_D8, GPIO_EMC_D9,
|
||||
GPIO_EMC_D10, GPIO_EMC_D11, GPIO_EMC_D12, GPIO_EMC_D13, GPIO_EMC_D14,
|
||||
GPIO_EMC_D15
|
||||
};
|
||||
|
||||
#define EMC_NPINS (sizeof(g_emc_pinset) / sizeof(lpc54_pinset_t))
|
||||
|
||||
/* Dynamic memory timing configuration. */
|
||||
|
||||
static const struct emc_dynamic_timing_config_s g_emc_dynconfig =
|
||||
|
|
@ -114,10 +141,19 @@ static const struct emc_dynamic_chip_config_s g_emc_dynchipconfig =
|
|||
|
||||
void lpc54_sdram_initialize(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* EMC Basic configuration. */
|
||||
|
||||
lpc54_emc_initialize(&g_emc_config);
|
||||
|
||||
/* Configured pins used on the board */
|
||||
|
||||
for (i = 0; i < EMC_NPINS; i++)
|
||||
{
|
||||
lpc54_gpio_config(g_emc_pinset[i]);
|
||||
}
|
||||
|
||||
/* EMC Dynamc memory configuration. */
|
||||
|
||||
lpc54_emc_sdram_initialize(&g_emc_dynconfig, &g_emc_dynchipconfig, 1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue