Apollon BSP support
PATCH 1/3 Apollon BSP support
Apollon BSP support
The Apollon based on OMAP2420 is designed for OneNAND development. It's similar with OMAP2420 H4 except some peripherals.
Now this board is maintained at mainline kernel.
---
Makefile +4 -1
@@ -2356,9 +2356,12 @@ zylonite_config : ######################################################################### ## ARM1136 Systems ######################################################################### -omap2420h4_config : unconfig +omap2420h4_config : unconfig @$(MKCONFIG) $(@:_config=) arm arm1136 omap2420h4 +apollon_config : unconfig + @$(MKCONFIG) $(@:_config=) arm arm1136 apollon + #======================================================================== # i386 #========================================================================
board/apollon/Makefile new file +50 -0
50 lines not on this page · raw message
board/apollon/apollon.c new file +607 -0
607 lines not on this page · raw message
board/apollon/config.mk new file +28 -0
@@ -0,0 +1,28 @@ +# +# (C) Copyright 2005-2007 +# Samsung Electronics +# +# Samsung December board with OMAP2420 (ARM1136) cpu +# see http://www.ti.com/ for more information on Texas Instruments +# +# December has 1 bank of 128MB mDDR-SDRAM on CS0 +# December has 1 bank of 00MB mDDR-SDRAM on CS1 +# Physical Address: +# 8000'0000 (bank0) +# A000/0000 (bank1) ES2 will be configurable +# Linux-Kernel is expected to be at 8000'8000, entry 8000'8000 +# (mem base + reserved) + +# For use with external or internal boots. +TEXT_BASE = 0x80e80000 + +# Used with full SRAM boot. +# This is either with a GP system or a signed boot image. +# easiest, and safest way to go if you can. +#TEXT_BASE = 0x40270000 + + +# Handy to get symbols to debug ROM version. +#TEXT_BASE = 0x0 +#TEXT_BASE = 0x08000000 +#TEXT_BASE = 0x04000000
PATCH 1/3 Apollon BSP support
Quoted 4 lines · In message <20070914005131.GA14660@party> you wrote:
Apollon BSP support
The Apollon based on OMAP2420 is designed for OneNAND development. It's similar with OMAP2420 H4 except some peripherals.
...
...
Quoted 10 lines
board/apollon/apollon.c new file +10
-0+ MuxConfigReg = (volatile uint8 *)CONTROL_PADCONF_USB0_PUEN ; + *MuxConfigReg &= (uint8) (~0x1F ); + + MuxConfigReg = (volatile uint8 *)CONTROL_PADCONF_USB0_VP ; + *MuxConfigReg &= (uint8) (~0x1F ); + + MuxConfigReg = (volatile uint8 *)CONTROL_PADCONF_USB0_VM ; + *MuxConfigReg &= (uint8) (~0x1F ); + + MuxConfigReg = (volatile uint8 *)CONTROL_PADCONF_USB0_RCV ;
board/apollon/apollon.c line 293
Quoted 10 lines
board/apollon/apollon.c new file +10
-0+ *MuxConfigReg &= (uint8) (~0x1F ); + + MuxConfigReg = (volatile uint8 *)CONTROL_PADCONF_USB0_TXEN ; + *MuxConfigReg &= (uint8) (~0x1F ); + + MuxConfigReg = (volatile uint8 *)CONTROL_PADCONF_USB0_SE0 ; + *MuxConfigReg &= (uint8) (~0x1F ); + + MuxConfigReg = (volatile uint8 *)CONTROL_PADCONF_USB0_DAT ; + *MuxConfigReg &= (uint8) (~0x1F );
...
You use this sequence extensively. In the current form, it's extremly lengthy, difficult to read and difficult to maintain.
Please define an (inline?) fintion which performs the actions and allows you to change (for example)
board/apollon/apollon.c line 324
Quoted 12 lines
board/apollon/apollon.c new file +12
-0+/* V19 */ + MuxConfigReg = (volatile uint8 *)CONTROL_PADCONF_USB1_RCV ; + *MuxConfigReg =1 ; +/* W20 */ + MuxConfigReg = (volatile uint8 *)CONTROL_PADCONF_USB1_TXEN ; + *MuxConfigReg =1 ; +/* N14 */ + MuxConfigReg = (volatile uint8 *)CONTROL_PADCONF_GPIO69 ; + *MuxConfigReg =3 ; +/* P15 */ + MuxConfigReg = (volatile uint8 *)CONTROL_PADCONF_GPIO70 ; + *MuxConfigReg =3 ;
into
write_config_reg (CONTROL_PADCONF_USB1_RCV, 1); /* V19 */ write_config_reg (CONTROL_PADCONF_USB1_TXEN, 1); /* W20 */ write_config_reg (CONTROL_PADCONF_GPIO69, 3); /* N14 */ write_config_reg (CONTROL_PADCONF_GPIO70, 3); /* P15 */
This is IMO *much* easier to read and understand.
Please also note that identifiers like "MuxConfigReg" are in
violation with the Coding Style:
C is a Spartan language, and so should your naming be. Unlike Modula-2 and Pascal programmers, C programmers do not use cute names like ThisVariableIsATemporaryCounter. A C programmer would call that variable "tmp", which is much easier to write, and not the least more difficult to understand.
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 "Virtual" means never knowing where your next byte is coming from.
PATCH 1/3 Apollon BSP support
Resend it I clicked the reply button instead of reply-all
Quoted 48 lines · Wolfgang Denk
Quoted 4 lines · In message <20070914005131.GA14660@party> you wrote:
Apollon BSP support
The Apollon based on OMAP2420 is designed for OneNAND development. It's similar with OMAP2420 H4 except some peripherals.
...
...Quoted 10 lines
board/apollon/apollon.c new file +10
-0+ MuxConfigReg = (volatile uint8 *)CONTROL_PADCONF_USB0_PUEN ; + *MuxConfigReg &= (uint8) (~0x1F ); + + MuxConfigReg = (volatile uint8 *)CONTROL_PADCONF_USB0_VP ; + *MuxConfigReg &= (uint8) (~0x1F ); + + MuxConfigReg = (volatile uint8 *)CONTROL_PADCONF_USB0_VM ; + *MuxConfigReg &= (uint8) (~0x1F ); + + MuxConfigReg = (volatile uint8 *)CONTROL_PADCONF_USB0_RCV ;board/apollon/apollon.c line 293
Quoted 10 lines
board/apollon/apollon.c new file +10
-0+ *MuxConfigReg &= (uint8) (~0x1F ); + + MuxConfigReg = (volatile uint8 *)CONTROL_PADCONF_USB0_TXEN ; + *MuxConfigReg &= (uint8) (~0x1F ); + + MuxConfigReg = (volatile uint8 *)CONTROL_PADCONF_USB0_SE0 ; + *MuxConfigReg &= (uint8) (~0x1F ); + + MuxConfigReg = (volatile uint8 *)CONTROL_PADCONF_USB0_DAT ; + *MuxConfigReg &= (uint8) (~0x1F );...
You use this sequence extensively. In the current form, it's extremly lengthy, difficult to read and difficult to maintain.
Please define an (inline?) fintion which performs the actions and allows you to change (for example)
board/apollon/apollon.c line 324
Quoted 12 lines
board/apollon/apollon.c new file +12
-0+/* V19 */ + MuxConfigReg = (volatile uint8 *)CONTROL_PADCONF_USB1_RCV ; + *MuxConfigReg =1 ; +/* W20 */ + MuxConfigReg = (volatile uint8 *)CONTROL_PADCONF_USB1_TXEN ; + *MuxConfigReg =1 ; +/* N14 */ + MuxConfigReg = (volatile uint8 *)CONTROL_PADCONF_GPIO69 ; + *MuxConfigReg =3 ; +/* P15 */ + MuxConfigReg = (volatile uint8 *)CONTROL_PADCONF_GPIO70 ; + *MuxConfigReg =3 ;
Quoted 9 lines
into
write_config_reg (CONTROL_PADCONF_USB1_RCV, 1); /* V19 */ write_config_reg (CONTROL_PADCONF_USB1_TXEN, 1); /* W20 */ write_config_reg (CONTROL_PADCONF_GPIO69, 3); /* N14 */ write_config_reg (CONTROL_PADCONF_GPIO70, 3); /* P15 */This is IMO *much* easier to read and understand.
Oh, it's better.
Actually I borrowed it from omap2420 and modified for apollon board. I will modify it as you suggested
Thank you,
Kyungmin Park
PATCH 1/3 Apollon BSP support
Quoted 6 lines · In message <[email protected]> you…
Quoted 2 lines
This is IMO *much* easier to read and understand.
Oh, it's better.
Actually I borrowed it from omap2420 and modified for apollon board. I will modify it as you suggested
Thanks a lot. If you have some spare cycles it would be great if your patch could clean up the omap2420 code, too :-)
Best regards,
Wolfgang Denk
Signature · 5 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 I have made mistakes, but have never made the mistake of claiming I never made one. - James G. Bennet