at91: add support for PM9263 board
RFC PATCH 1/1 at91: add support for PM9263 board
From: Ilko Iliev <[email protected]>
This patch adds support for the PM9263 board of Ronetix GmbH (www.ronetix.at) With the necessary to boot the board from NOR
--- MAINTAINERS | 4 + MAKEALL | 1 + Makefile | 3 + board/ronetix/pm9263/Makefile | 62 +++ board/ronetix/pm9263/config.mk | 1 + .../lowlevel_init.S => board/ronetix/pm9263/led.c | 51 ++- board/ronetix/pm9263/lowlevel_init.S | 277 +++++++++++ board/ronetix/pm9263/nand.c | 79 ++++ board/ronetix/pm9263/partition.c | 47 ++ board/ronetix/pm9263/pm9263.c | 493 ++++++++++++++++++++ .../ronetix/pm9263/u-boot.lds | 49 ++- cpu/arm926ejs/at91/config.mk | 2 + cpu/arm926ejs/at91/lowlevel_init.S | 2 + include/asm-arm/arch-at91/at91sam9263.h | 1 + include/asm-arm/arch-at91/at91sam9_sdramc.h | 87 ++++ include/asm-arm/arch-at91/hardware.h | 17 + include/configs/pm9263.h | 350 ++++++++++++++ tools/Makefile | 3 + tools/logos/ronetix.bmp | Bin 0 -> 5638 bytes 19 files changed, 1498 insertions(+), 31 deletions(-) create mode 100644 board/ronetix/pm9263/Makefile create mode 100644 board/ronetix/pm9263/config.mk copy cpu/arm926ejs/at91/lowlevel_init.S => board/ronetix/pm9263/led.c (52%) create mode 100644 board/ronetix/pm9263/lowlevel_init.S create mode 100644 board/ronetix/pm9263/nand.c create mode 100644 board/ronetix/pm9263/partition.c create mode 100644 board/ronetix/pm9263/pm9263.c copy cpu/arm926ejs/at91/lowlevel_init.S => board/ronetix/pm9263/u-boot.lds (54%) create mode 100644 include/asm-arm/arch-at91/at91sam9_sdramc.h create mode 100644 include/configs/pm9263.h create mode 100644 tools/logos/ronetix.bmp
MAINTAINERS +4 -0
@@ -204,6 +204,10 @@ Klaus Heydeck <[email protected]> KUP4K MPC855 KUP4X MPC859 +Ilko Iliev <[email protected]> + + PM9263 AT91SAM9263 + Gary Jennejohn <[email protected]> quad100hd PPC405EP
MAKEALL +1 -0
@@ -561,6 +561,7 @@ LIST_at91=" \ kb9202 \ mp2usb \ m501sk \ + pm9263 \ " #########################################################################
Makefile +3 -0
@@ -2710,6 +2710,9 @@ at91sam9rlek_config : unconfig fi; @$(MKCONFIG) -a at91sam9rlek arm arm926ejs at91sam9rlek atmel at91 +pm9263_config : unconfig + @$(MKCONFIG) $(@:_config=) arm arm926ejs pm9263 ronetix at91 + ######################################################################## ## ARM Integrator boards - see doc/README-integrator for more info. integratorap_config \
board/ronetix/pm9263/Makefile new file +62 -0
62 lines not on this page · raw message
board/ronetix/pm9263/config.mk new file +1 -0
@@ -0,0 +1 @@ +TEXT_BASE = 0x23f00000
board/ronetix/pm9263/led.c renamed from cpu/arm926ejs/at91/lowlevel_init.S +37 -14
66 lines not on this page · raw message
board/ronetix/pm9263/lowlevel_init.S new file +277 -0
277 lines not on this page · raw message
board/ronetix/pm9263/nand.c new file +79 -0
79 lines not on this page · raw message
board/ronetix/pm9263/partition.c new file +47 -0
47 lines not on this page · raw message
board/ronetix/pm9263/pm9263.c new file +493 -0
493 lines not on this page · raw message
board/ronetix/pm9263/u-boot.lds renamed from cpu/arm926ejs/at91/lowlevel_init.S +32 -17
61 lines not on this page · raw message
cpu/arm926ejs/at91/config.mk +2 -0
@@ -1,2 +1,4 @@ PLATFORM_CPPFLAGS += $(call cc-option,-mtune=arm926ejs,) +ifdef CONFIG_SKIP_LOWLEVEL_INIT LDSCRIPT := $(SRCTREE)/cpu/arm926ejs/at91/u-boot.lds +endif
cpu/arm926ejs/at91/lowlevel_init.S +2 -0
@@ -30,6 +30,8 @@ #ifndef CONFIG_SKIP_LOWLEVEL_INIT .globl lowlevel_init +.weak lowlevel_init +.set lowlevel_init,function lowlevel_init: /*
include/asm-arm/arch-at91/at91sam9263.h +1 -0
@@ -106,6 +106,7 @@#define AT91_USART2 AT91SAM9263_BASE_US2#define AT91_SMC AT91_SMC0 +#define AT91_SDRAMC AT91_SDRAMC0/* * Internal Memory.
include/asm-arm/arch-at91/at91sam9_sdramc.h new file +87 -0
87 lines not on this page · raw message
include/asm-arm/arch-at91/hardware.h +17 -0
@@ -48,4 +48,21 @@#error "Unsupported AT91 processor"#endif +/* External Memory Map */ +#define AT91_CHIPSELECT_0 0x10000000 +#define AT91_CHIPSELECT_1 0x20000000 +#define AT91_CHIPSELECT_2 0x30000000 +#define AT91_CHIPSELECT_3 0x40000000 +#define AT91_CHIPSELECT_4 0x50000000 +#define AT91_CHIPSELECT_5 0x60000000 +#define AT91_CHIPSELECT_6 0x70000000 +#define AT91_CHIPSELECT_7 0x80000000 + +/* SDRAM */ +#ifdef CONFIG_DRAM_BASE +#define AT91_SDRAM_BASE CONFIG_DRAM_BASE +#else +#define AT91_SDRAM_BASE AT91_CHIPSELECT_1 +#endif +#endif
include/configs/pm9263.h new file +350 -0
350 lines not on this page · raw message
tools/Makefile +3 -0
@@ -47,6 +47,9 @@ endif ifeq ($(VENDOR),atmel) LOGO_BMP= logos/atmel.bmp endif +ifeq ($(VENDOR),ronetix) +LOGO_BMP= logos/ronetix.bmp +endif #-------------------------------------------------------------------------
tools/logos/ronetix.bmp new file binary +0 -0
zBg8l!!DvjQg$o3*_l?ET0j9J)fMJnal at 1Z4oNCOcq#mc1o7j|EZaZXgJTSMW>2r zF*WC?mXqaxC-x|(WTDI=l$tk#FWHN38kTYnrx&8wI4+oux-1(qjL;>&<CJcNMwvtO zgR-IiDztQ?ZSWkr2*r{q-Vo<55|DVZ=fWNm9!14aK2VR=QEQiF;dSW7~UTjVl1*n zc!87JBXl3TAAa_3F`;l)3^>T-EQs-Uxs4I;w?ycg<Up88$U*F%9Oo{G2$}8M@<Nb z5~s)1PR$WECwuD}ZO!B{zH-$24xf+cIADT}+b8ll>{YMqiL(-*l2GFlJjrW#{3tc< zD!kQh56>87Y(nzsfPxjx@%dIhw@>sUb{Hl@$Ir5Z63w3!KZl1>0OGJ%f-Ai$BACt# zB*|x9m3&UGhlk;d*|;3{&XSfNZBB^0Tlq$1vuL*=f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v53DTIHDQb4hBanA}5YvFMFJDVvW$TJ^DhxkHL12El1TJx^ zC~7NGR{W!!v1+CA>Xi<sTRuyk!)ImHOaMFl>o$m(t*rCcY;s7<-sf1#TRb%oShY z&4(XJPFCeOzCeD1H8Va0S99b)R0Tbl$NB<FCU+e=SjG0>K_;S^IzW3dt~sMt{VyI z1g&pj)STBZKbnO+Df3F}2;L_4PJgAn=fLA?jMx+VulJm8casoIK}x6A#|-s;d4^ zBSD7)dChC|;S2e~i9XdP4)8IjOC7u-dgso6-?C^=^zsoa?}<GU9}5iOJn`i>=YOSR NZ2eYzcz8HI_77a#1d{*&
literal 0
HcmV?d00001
Signature · 1 line
1.5.6.5
Wolfgang Denk
NAKRFC PATCH 1/1 at91: add support for PM9263 board
Dear Jean-Christophe PLAGNIOL-VILLARD,
Quoted 4 lines · In message <[email protected]> you wrote:
From: Ilko Iliev <[email protected]>
This patch adds support for the PM9263 board of Ronetix GmbH (www.ronetix.at) With the necessary to boot the board from NOR
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I cannot parse this. What do you want to express?
board/ronetix/pm9263/led.c
Quoted 3 lines
index ec6ad5d..122e23a 100644
board/ronetix/pm9263/led.c renamed from cpu/arm926ejs/at91/lowlevel_init.S +0
-0
NAK.
I will not accept yet another copy of this file. Please create common code that can be configured as needed.
board/ronetix/pm9263/partition.c
Quoted 5 lines
board/ronetix/pm9263/partition.c new file +0
-0
NAK.
I will not accept yet another copy of this file. We have already 7 of these, most of them identical, and the remaining differences minimal. Please create common code that can be configured as needed.
Quoted 3 lines
board/ronetix/pm9263/pm9263.c new file +0
-0
...
Quoted 21 lines
board/ronetix/pm9263/pm9263.c new file +21
-0+/* ------------------------------------------------------------------------- */ +/* +* Miscelaneous platform dependent initialisations +*/ + +static void pm9263_serial_hw_init (void ) +{ +#ifdef CONFIG_USART0 +at91_set_A_periph (AT91_PIN_PA26 ,1 );/* TXD0 */ +at91_set_A_periph (AT91_PIN_PA27 ,0 );/* RXD0 */ +at91_sys_write (AT91_PMC_PCER ,1 <<AT91_ID_US0 ); +#endif + +#ifdef CONFIG_USART1 +at91_set_A_periph (AT91_PIN_PD0 ,1 );/* TXD1 */ +at91_set_A_periph (AT91_PIN_PD1 ,0 );/* RXD1 */ +at91_sys_write (AT91_PMC_PCER ,1 <<AT91_ID_US1 ); +#endif + +#ifdef CONFIG_USART2 +at91_set_A_periph (AT91_PIN_PD2 ,1 );/* TXD2 */
board/ronetix/pm9263/pm9263.c line 76
Quoted 10 lines
board/ronetix/pm9263/pm9263.c new file +10
-0+at91_set_A_periph (AT91_PIN_PD3 ,0 );/* RXD2 */ +at91_sys_write (AT91_PMC_PCER ,1 <<AT91_ID_US2 ); +#endif + +#ifdef CONFIG_USART3 /* DBGU */ +at91_set_A_periph (AT91_PIN_PC30 ,0 );/* DRXD */ +at91_set_A_periph (AT91_PIN_PC31 ,1 );/* DTXD */ +at91_sys_write (AT91_PMC_PCER ,1 <<AT91_ID_SYS ); +#endif +}
I think I've seent his code a couple of times before, too. Last time in another patch earlier today. Seems there are at least 8 files in U-Boot that contain such a sequence, with no or just minimal differences.
Should we not clean this up, too?
Quoted 2 lines
board/ronetix/pm9263/pm9263.c new file +2
-0+static int pm9263_lcd_hw_psram_init (void ) +{
...
board/ronetix/pm9263/pm9263.c
Quoted 2 lines
board/ronetix/pm9263/pm9263.c new file +2
-0+if ((readw (PHYS_PSRAM ) !=0x1234 ) || (readw (PHYS_PSRAM +2 ) !=0x5678 )) + {
Incorrect brace style.
board/ronetix/pm9263/pm9263.c line 273
Quoted 4 lines
board/ronetix/pm9263/pm9263.c new file +4
-0+writew (0x5678 ,PHYS_PSRAM +2 ); +if ((readw (PHYS_PSRAM ) !=0x1234 ) + || (readw (PHYS_PSRAM +2 ) !=0x5678 )) +return 1 ;
I recommend to use curly braces because of the multi-line "if".
Also, please put the "||" at the end of line 1.
board/ronetix/pm9263/pm9263.c line 417
Quoted 6 lines
board/ronetix/pm9263/pm9263.c new file +6
-0+int dram_init (void ) +{ + gd->bd->bi_dram[0 ].start =PHYS_SDRAM ; + gd->bd->bi_dram[0 ].size =PHYS_SDRAM_SIZE ; +return 0 ; +}
You should not hard-wire the memory size. You should auto-size it.
board/ronetix/pm9263/pm9263.c line 428
Quoted 10 lines
board/ronetix/pm9263/pm9263.c new file +10
-0+#ifdef CONFIG_RESET_PHY_R +void reset_phy (void ) +{ +#ifdef CONFIG_MACB +/* +* Initialize ethernet HW addr prior to starting Linux, +* needed for nfsroot +*/ +eth_init (gd->bd); +#endif
Be careful. You mustnot initialize the ehternet port unless a U-Boot network command is being used. And you must shut it down after that.
Quoted 6 lines
board/ronetix/pm9263/pm9263.c new file +6
-0+#ifdef CONFIG_DISPLAY_BOARDINFO +int checkboard (void ) +{ +char *ss; + +uint32_t reg, diva, mula;
board/ronetix/pm9263/pm9263.c line 456
Quoted 10 lines
board/ronetix/pm9263/pm9263.c new file +10
-0+uint32_t val, mdiv, pres, crystal; +char buf[32 ]; + + reg =at91_sys_read (AT91_CKGR_PLLAR ); + mula = ((reg >>16 ) &0x7FF ) +1 ; + diva = reg &0xFF ; + + reg =at91_sys_read (AT91_PMC_MCKR ); + mdiv = (reg >>8 ) &3 ; + pres = (reg >>2 ) &7 ;
Maybe a comment would help to explain what this code is doing?
board/ronetix/pm9263/pm9263.c line 488
Quoted 1 line
board/ronetix/pm9263/pm9263.c new file +1
-0+printf ("Video memory : 0x%08lX %s\n" , gd->fb_base, ss );
No space before the paren.
board/ronetix/pm9263/pm9263.c line 490
Quoted 1 line
board/ronetix/pm9263/pm9263.c new file +1
-0+printf ("\n" );
Please use consistent style: either
printf(...); or printf (...);
bot on;t mix these (this applies to all function calls).
board/ronetix/pm9263/u-boot.lds
Quoted 7 lines
board/ronetix/pm9263/u-boot.lds renamed from cpu/arm926ejs/at91/lowlevel_init.S +0
-0
That's a pretty funny diff, isn't it? lowlevel_init.S versus u-boot.lds ...
Quoted 5 lines
include/configs/pm9263.h new file +0
-0
...
Quoted 1 line
+#define
AT91_MAIN_CLOCK(PM9263_CRYSTAL/MASTER_PLL_DIV*MASTER_PLL_MUL)
Maximum line lenght exceeded. Check all files, there are more places like this one!
include/configs/pm9263.h line 44
Quoted 3 lines
include/configs/pm9263.h new file +3
-0+#define AT91_MASTER_CLOCK (AT91_MAIN_CLOCK / MAIN_PLL_DIV) +#define CONFIG_SYS_AT91_PLLB 0x10483E0E/* PLLB settings for USB */ +#define CONFIG_SYS_HZ 1000000
NAK.
CONFIG_SYS_HZ must be 1000.
include/configs/pm9263.h line 247
Quoted 5 lines
include/configs/pm9263.h new file +5
-0+#define CFG_MONITOR_BASE (CFG_DATAFLASH_LOGIC_ADDR_CS0 + 0x8400) +#define CONFIG_ENV_OFFSET 0x4200 +#define CONFIG_ENV_ADDR (CFG_DATAFLASH_LOGIC_ADDR_CS0 + CONFIG_ENV_OFFSET) +#define CONFIG_ENV_SIZE 0x4200 +#define CONFIG_BOOTCOMMAND "cp.b 0xC0042000 0x22000000 0x210000; bootm"
No need for 0x in U-Boot commands. This is just wasting environment memory.
Quoted 1 line
+#define
CONFIG_BOOTCOMMAND"nand read0x220000000xA00000x200000; bootm"
Ditto.
Quoted 1 line
+#define
ROUND(A, B)(((A) + (B)) & ~((B) - 1))
Do we really need this redefined in each and every include/configs/at91*.h file?
Quoted 3 lines
+ * Size of
malloc()pool
+ */
+#defineCONFIG_SYS_MALLOC_LENROUND(3 * CONFIG_ENV_SIZE + 128*1024, 0x1000)
Same here?
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de A supercomputer is a machine that runs an endless loop in 2 seconds.
RFC PATCH 1/1 at91: add support for PM9263 board
Quoted 10 lines · Wolfgang Denk
Dear Jean-Christophe PLAGNIOL-VILLARD,
Quoted 4 lines · In message <[email protected]> you wrote:
From: Ilko Iliev <[email protected]>
This patch adds support for the PM9263 board of Ronetix GmbH (www.ronetix.at) With the necessary to boot the board from NOR
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I cannot parse this. What do you want to express?
I've not finish to clean the patch. I've send it for the update done in the at91 in order to implement boot from NOR
Quoted 18 lines
board/ronetix/pm9263/led.c
Quoted 4 lines
index ec6ad5d..122e23a 100644
board/ronetix/pm9263/led.c renamed from cpu/arm926ejs/at91/lowlevel_init.S +0
-0NAK.
I will not accept yet another copy of this file. Please create common code that can be configured as needed.
board/ronetix/pm9263/partition.c
Quoted 5 lines
board/ronetix/pm9263/partition.c new file +0
-0NAK.
Quoted 3 lines
I will not accept yet another copy of this file. We have already 7 of these, most of them identical, and the remaining differences minimal. Please create common code that can be configured as needed.
It's plan to create it but I'll not have the time for this release and this board wait until December IIRC
Quoted 33 lines
Quoted 5 lines
board/ronetix/pm9263/pm9263.c new file +0
-0...
Quoted 2 lines
board/ronetix/pm9263/pm9263.c new file +2
-0+static int pm9263_lcd_hw_psram_init (void ) +{...
board/ronetix/pm9263/pm9263.c
Quoted 2 lines
board/ronetix/pm9263/pm9263.c new file +2
-0+if ((readw (PHYS_PSRAM ) !=0x1234 ) || (readw (PHYS_PSRAM +2 ) !=0x5678 )) + {Incorrect brace style.
board/ronetix/pm9263/pm9263.c line 273
Quoted 4 lines
board/ronetix/pm9263/pm9263.c new file +4
-0+writew (0x5678 ,PHYS_PSRAM +2 ); +if ((readw (PHYS_PSRAM ) !=0x1234 ) + || (readw (PHYS_PSRAM +2 ) !=0x5678 )) +return 1 ;I recommend to use curly braces because of the multi-line "if".
Also, please put the "||" at the end of line 1.
board/ronetix/pm9263/pm9263.c line 417
Quoted 6 lines
board/ronetix/pm9263/pm9263.c new file +6
-0+int dram_init (void ) +{ + gd->bd->bi_dram[0 ].start =PHYS_SDRAM ; + gd->bd->bi_dram[0 ].size =PHYS_SDRAM_SIZE ; +return 0 ; +}You should not hard-wire the memory size. You should auto-size it.
Quoted 13 lines
board/ronetix/pm9263/pm9263.c line 428
Quoted 10 lines
board/ronetix/pm9263/pm9263.c new file +10
-0+#ifdef CONFIG_RESET_PHY_R +void reset_phy (void ) +{ +#ifdef CONFIG_MACB +/* +* Initialize ethernet HW addr prior to starting Linux, +* needed for nfsroot +*/ +eth_init (gd->bd); +#endif Be careful. You mustnot initialize the ehternet port unless a U-Boot network command is being used. And you must shut it down after that.
I known this will be fix in the final version
Quoted 11 lines
board/ronetix/pm9263/u-boot.lds
Quoted 8 lines
board/ronetix/pm9263/u-boot.lds renamed from cpu/arm926ejs/at91/lowlevel_init.S +0
-0That's a pretty funny diff, isn't it?
lowlevel_init.Sversusu-boot.lds...
yes do not known why
Best Regards,
J.