fix pxa255_idp board
PATCH 1/1 fix pxa255_idp board
The pxa255_idp being an old unmaintained board showed several issues:
1. CONFIG_INIT_CRITICAL was still defined.
2. Neither CONFIG_MAC_PARTITION nor CONFIG_DOS_PARTITION was defined.
3. Symbol flash_addr was undeclared.
4. The boards lowlevel_init function was still called memsetup.
5. The TEXT_BASE was still 0xa3000000 rather than 0xa3080000.
6. Using -march=armv5 instead of -march=armv5te resulted in lots of 'target CPU does not support interworking' warnings on recent compilers.
7. The PXA's serial driver redefined FFUART, BTUART and STUART used as indexes rather than the register definitions from the pxa-regs header file. Renamed them to FFUART_INDEX, BTUART_INDEX and STUART_INDEX to avoid any ambiguities.
8. There were several redefinition warnings concerning ICMR, OSMR3, OSCR, OWER, OIER, RCSR and CCCR in the PXA's assembly start file.
9. The board configuration file was rather outdated.
10. The part header file defined the vendor, product and revision arrays as unsigned chars instead of just chars in the block_dev_desc_t structure.
---
board/pxa255_idp/Makefile | 2 +-
board/pxa255_idp/config.mk | 2 +-
board/pxa255_idp/{memsetup.S => lowlevel_init.S} | 10 ++--
board/pxa255_idp/u-boot.lds | 1 +
cpu/pxa/config.mk | 3 +-
cpu/pxa/serial.c | 72 +++++++++++-----------
cpu/pxa/start.S | 6 ++-
include/configs/pxa255_idp.h | 13 ++--
include/part.h | 6 +-
9 files changed, 60 insertions(+), 55 deletions(-)
rename board/pxa255_idp/{memsetup.S => lowlevel_init.S} (99%)board/pxa255_idp/Makefile +1 -1
@@ -27,7 +27,7 @@ include $(TOPDIR)/config.mk LIB = $(obj)lib$(BOARD).a COBJS := pxa_idp.o -SOBJS := memsetup.o +SOBJS := lowlevel_init.o SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS))
board/pxa255_idp/config.mk +1 -1
@@ -1,3 +1,3 @@ #TEXT_BASE = 0xa1700000 -TEXT_BASE = 0xa3000000 +TEXT_BASE = 0xa3080000 #TEXT_BASE = 0
board/pxa255_idp/lowlevel_init.S renamed from board/pxa255_idp/memsetup.S +5 -5
@@ -3,7 +3,7 @@ * * NOTE: I haven't clean this up considerably, just enough to get it * running. See hal_platform_setup.h for the source. See - * board/cradle/memsetup.S for another PXA250 setup that is + * board/cradle/lowlevel_init.S for another PXA250 setup that is * much cleaner. * * See file CREDITS for list of people who contributed to this
@@ -41,8 +41,8 @@ DRAM_SIZE: .long CFG_DRAM_SIZE /* * Memory setup */ -.globl memsetup -memsetup: +.globl lowlevel_init +lowlevel_init: mov r10, lr
@@ -395,7 +395,7 @@ initclks: /* Save SDRAM size */ ldr r1, =DRAM_SIZE - str r8, [r1] + str r8, [r1] /* Interrupt init: Mask all interrupts */ ldr r0, =ICMR /* enable no sources */
@@ -426,7 +426,7 @@ initclks: bl blink #endif -endmemsetup: +endlowlevel_init: mov pc, r10
board/pxa255_idp/u-boot.lds +1 -0
@@ -44,6 +44,7 @@ SECTIONS . = ALIGN(4); .got : { *(.got) } + . = .; __u_boot_cmd_start = .; .u_boot_cmd : { *(.u_boot_cmd) } __u_boot_cmd_end = .;
cpu/pxa/config.mk +1 -2
@@ -25,8 +25,7 @@ PLATFORM_RELFLAGS += -fno-strict-aliasing -fno-common -ffixed-r8 \ -msoft-float -#PLATFORM_CPPFLAGS += -mapcs-32 -march=armv4 -mtune=strongarm1100 -PLATFORM_CPPFLAGS += -march=armv5 -mtune=xscale +PLATFORM_CPPFLAGS += -march=armv5te -mtune=xscale # ========================================================================= # # Supply options according to compiler version
cpu/pxa/serial.c +36 -36
217 lines not on this page · raw message
cpu/pxa/start.S +5 -1
@@ -166,13 +166,17 @@ _start_armboot: .word start_armboot /* */ /****************************************************************************/ /* mk at tbd: Fix this! */ -#ifdef CONFIG_CPU_MONAHANS +#if defined(CONFIG_PXA250) || defined(CONFIG_CPU_MONAHANS) #undef ICMR #undef OSMR3 #undef OSCR #undef OWER #undef OIER #endif +#ifdef CONFIG_PXA250 +#undef RCSR +#undef CCCR +#endif /* Interrupt-Controller base address */ IC_BASE: .word 0x40d00000
include/configs/pxa255_idp.h +7 -6
@@ -38,10 +38,11 @@#include <asm/arch/pxa-regs.h> /* -* If we are developing, we might want to start armboot from ram +* If we are developing, we might want to start U-Boot from RAM * so we MUST NOT initialize critical regs like mem-timing ... */ -#define CONFIG_INIT_CRITICAL /* undef for developing */ +#undef CONFIG_SKIP_LOWLEVEL_INIT/* define for developing */ +#undef CONFIG_SKIP_RELOCATE_UBOOT/* define for developing */ /* * define the following to enable debug blinks. A debug blink function
@@ -62,6 +63,7 @@#endif #define CONFIG_MMC 1 +#define CONFIG_DOS_PARTITION 1#define BOARD_LATE_INIT 1#undef CONFIG_USE_IRQ/* we don't need IRQ/FIQ stuff */
@@ -121,7 +123,6 @@#define CONFIG_CMD_FAT #define CONFIG_CMD_DHCP -#define CONFIG_BOOTDELAY 3#define CONFIG_BOOTCOMMAND "bootm 40000"#define CONFIG_BOOTARGS "root=/dev/mtdblock2 rootfstype=cramfs console=ttyS0,115200"
@@ -332,7 +333,7 @@#define CFG_FLASH_CFI_DRIVER 1#define CFG_MONITOR_BASE 0 -#define CFG_MONITOR_LEN 0x40000 +#define CFG_MONITOR_LEN PHYS_FLASH_SECT_SIZE#define CFG_MAX_FLASH_BANKS 1/* max number of memory banks */ #define CFG_MAX_FLASH_SECT 128/* max number of sectors on one chip */
@@ -347,7 +348,7 @@#define CFG_ENV_IS_IN_FLASH 1/* Addr of Environment Sector */ #define CFG_ENV_ADDR (PHYS_FLASH_1 + PHYS_FLASH_SIZE - 0x40000) -#define CFG_ENV_SIZE 0x40000/* Total Size of Environment Sector */ -#define CFG_ENV_SECT_SIZE 0x40000 +#define CFG_ENV_SIZE PHYS_FLASH_SECT_SIZE/* Total Size of Environment Sector */ +#define CFG_ENV_SECT_SIZE (PHYS_FLASH_SECT_SIZE / 16)#endif /* __CONFIG_H */
include/part.h +3 -3
@@ -38,9 +38,9 @@ typedef struct block_dev_desc {#endif lbaint_t lba;/* number of blocks */ unsigned long blksz;/* block size */ -unsigned char vendor [40 +1 ];/* IDE model, SCSI Vendor */ -unsigned char product[20 +1 ];/* IDE Serial no, SCSI product */ -unsigned char revision[8 +1 ];/* firmware revision */ +char vendor [40 +1 ];/* IDE model, SCSI Vendor */ +char product[20 +1 ];/* IDE Serial no, SCSI product */ +char revision[8 +1 ];/* firmware revision */ unsigned long (*block_read)(int dev, unsigned long start, lbaint_t blkcnt,
Signature · 1 line
1.5.2.4
Wolfgang Denk
AppliedPATCH 1/1 fix pxa255_idp board
Quoted 19 lines · In message <[email protected]> you wrote:
The
pxa255_idpbeing an old unmaintained board showed several issues:
1.CONFIG_INIT_CRITICALwas still defined.
2. NeitherCONFIG_MAC_PARTITIONnorCONFIG_DOS_PARTITIONwas defined.
3. Symbolflash_addrwas undeclared.
4. The boardslowlevel_initfunction was still called memsetup.
5. TheTEXT_BASEwas still0xa3000000rather than0xa3080000.
6. Using -march=armv5 instead of -march=armv5te resulted in lots of 'target CPU does not support interworking' warnings on recent compilers.
7. The PXA's serial driver redefined FFUART, BTUART and STUART used as indexes rather than the register definitions from the pxa-regs header file. Renamed them toFFUART_INDEX,BTUART_INDEXandSTUART_INDEXto avoid any ambiguities.
8. There were several redefinition warnings concerning ICMR, OSMR3, OSCR, OWER, OIER, RCSR and CCCR in the PXA's assembly start file.
9. The board configuration file was rather outdated.
10. The part header file defined the vendor, product and revision arrays as unsigned chars instead of just chars in theblock_dev_desc_tstructure.
Quoted 1 line
Signed-off-by Marcel Ziswiler <[email protected]>
Applied, thanks.
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
If the facts don't fit the theory, change the facts.
-- Albert Einstein