ppc4xx: HCU5 board: add register dump
PATCH 1/1 ppc4xx: HCU5 board: add register dump
Adds a HCU5 board specific cmd reghcu5 to dump about 140 internal register which define the HW configuration. Needed for documentation purposes and to compare different settings.
--- board/netstal/hcu5/Makefile | 2 +- board/netstal/hcu5/cmd_reghcu5.c | 283 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 284 insertions(+), 1 deletions(-) create mode 100644 board/netstal/hcu5/cmd_reghcu5.c
board/netstal/hcu5/Makefile +1 -1
@@ -25,7 +25,7 @@ LIB = $(obj)lib$(BOARD).a # NOBJS : Netstal common objects NOBJS = nm_bsp.o -COBJS = $(BOARD).o sdram.o +COBJS = $(BOARD).o sdram.o cmd_reghcu5.o SOBJS = init.o SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) $(addprefix ../common/,$(NOBJS:.o=.c))
board/netstal/hcu5/cmd_reghcu5.c new file +283 -0
283 lines not on this page · raw message
Signature · 1 line
1.6.3.3
PATCH 1/1 ppc4xx: Update Netstal configs
- CONFIG_SYS_BOOTMAPSZ for 16 instead of 8 MB, moved to common
- baudrate back to 9600 for backward compatibility
- HCU4: CONFIG_SYS_ICACHE_SACR_VALUE defined
- CONFIG_VXWORKS_PREBOOT for HCU4 and MCU25
- HCU5: Add CPU and OCM POST
--- include/configs/hcu4.h | 9 ++------- include/configs/hcu5.h | 38 +++++++++++++++++++++++--------------- include/configs/mcu25.h | 8 ++------ include/configs/netstal-common.h | 9 ++++++--- 4 files changed, 33 insertions(+), 31 deletions(-)
include/configs/hcu4.h +2 -7
@@ -64,6 +64,7 @@#define CONFIG_SYS_OCM_DATA_SIZE 0x00001000/* Do not set up locked dcache as init ram. */ #undef CONFIG_SYS_INIT_DCACHE_CS +#define CONFIG_SYS_ICACHE_SACR_VALUE 0x80000001/* Use the On-Chip-Memory (OCM) as a temporary stack for the startup code. */ #define CONFIG_SYS_TEMP_STACK_OCM 1
@@ -200,6 +201,7 @@/*----------------------------------------------------------------------- * Miscellaneous configurable options *----------------------------------------------------------------------*/ +#define CONFIG_VXWORKS_PREBOOT 1#define CONFIG_SYS_LONGHELP /* undef to save memory */ #define CONFIG_SYS_PROMPT "=> "/* Monitor Command Prompt */ #if defined(CONFIG_CMD_KGDB )
@@ -243,13 +245,6 @@#define CONFIG_SYS_GPIO0_TCR 0x7FFE0000/* GPIO value */ #define CONFIG_SYS_GPIO0_ODR 0x00E897FC/* GPIO value */ -/* -* For booting Linux, the board info and command line data -* have to be in the first 8 MB of memory, since this is -* the maximum mapped by the Linux kernel during initialization. -*/ -#define CONFIG_SYS_BOOTMAPSZ (8 << 20)/* Initial Memory map for Linux */ -/* Init Memory Controller: * * BR0/1 and OR0/1 (FLASH)
include/configs/hcu5.h +23 -15
@@ -92,7 +92,7 @@* Serial Port *----------------------------------------------------------------------*/ #undef CONFIG_SYS_EXT_SERIAL_CLOCK/* external serial clock */ -#define CONFIG_BAUDRATE 115200 +#define CONFIG_BAUDRATE 9600#undef CONFIG_SERIAL_SOFTWARE_FIFO#undef CONFIG_UART1_CONSOLE
@@ -131,7 +131,9 @@#define CONFIG_SYS_MBYTES_SDRAM (128)/* 128 MB or 256 MB */ #define CONFIG_SYS_DDR_CACHED_ADDR 0x50000000/* setup 2nd TLB cached here */ #undef CONFIG_DDR_DATA_EYE/* Do not use DDR2 optimization */ -#define CONFIG_DDR_ECC 1/* enable ECC */ +/* warum gibt es Fehler mit #undef CONFIG_DDR_ECC (Hub) */ +#define CONFIG_DDR_ECC +#undef DISABLE_DDR_ECC_AFTER_POST/* disable ECC after POST tests */ /* Following two definitions must be kept in sync with config.h of vxWorks */ #define USER_RESERVED_MEM ( 0)/* in kB */
@@ -155,11 +157,12 @@CONFIG_NETSTAL_DEF_ENV_POWERPC \"" -#define CONFIG_M88E1111_PHY 1 +/* HCU5 has a SMII for 10/100Mbps Micrel KS8001 */ +#define CONFIG_MICREL_KS8001_PHY 1#define CONFIG_IBM_EMAC4_V4 1 - -#define CONFIG_HAS_ETH1 1/* add support for "eth1addr" */ -#define CONFIG_PHY1_ADDR 2 +#define CONFIG_PHY_DYNAMIC_ANEG 1 +#define CONFIG_PHY_RESET 1 +#define CONFIG_PHY_ADDR 1/* PHY address */ /* USB */ #define CONFIG_USB_OHCI
@@ -205,18 +208,30 @@#define CONFIG_CMD_USB /* POST support */ -#define CONFIG_POST (CONFIG_SYS_POST_MEMORY | \ - CONFIG_SYS_POST_UART | \ +#define CONFIG_POST (CONFIG_SYS_POST_UART | \ CONFIG_SYS_POST_I2C | \ CONFIG_SYS_POST_CACHE | \ CONFIG_SYS_POST_FPU | \ + CONFIG_SYS_POST_CPU | \ + CONFIG_SYS_POST_OCM | \ CONFIG_SYS_POST_ETHER | \ CONFIG_SYS_POST_SPR) +#define CONFIG_SYS_POST_MEMORY_EXTENDED /* 1 * in case of memory error execute extended test */ #define CONFIG_SYS_POST_UART_TABLE {UART0_BASE} +#define CONFIG_SYS_OCM_SIZE (16 << 10) +#define CONFIG_SYS_OCM_STATUS_OK 0x00009A00 +#define CONFIG_SYS_OCM_STATUS_FAIL 0x0000A300 +#define CONFIG_SYS_OCM_STATUS_MASK 0x0000FF00 +#define CONFIG_SYS_OCM_STATUS_ADDR (CONFIG_SYS_PERIPHERAL_BASE + GPT0_MASK1) +#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)#define CONFIG_SYS_POST_CACHE_ADDR 0x7fff0000/* free virtual address */ #define CONFIG_SYS_CONSOLE_IS_IN_ENV /* Otherwise it catches logbuffer as output */ +/* defining CONFIG_4xx_DCACHE leads to erros in memory_extended_tests */ +#undef CONFIG_WATCHDOG +/* Watchdog cannot be enabled, as it would be still enabled booting vxWorks */ +#undef CONFIG_4xx_DCACHE#define CONFIG_SUPPORT_VFAT
@@ -255,13 +270,6 @@#define CONFIG_SYS_PCI_SUBSYS_VENDORID 0x10e8/* AMCC */ #define CONFIG_SYS_PCI_SUBSYS_ID 0xcafe/* Whatever */ -/* -* For booting Linux, the board info and command line data -* have to be in the first 8 MB of memory, since this is -* the maximum mapped by the Linux kernel during initialization. -*/ -#define CONFIG_SYS_BOOTMAPSZ (8 << 20)/* Initial Memory map for Linux */ -/*----------------------------------------------------------------------- * Flash *----------------------------------------------------------------------*/
include/configs/mcu25.h +2 -6
@@ -64,6 +64,7 @@#define CONFIG_SYS_OCM_DATA_SIZE 0x00001000/* Do not set up locked dcache as init ram. */ #undef CONFIG_SYS_INIT_DCACHE_CS +#define CONFIG_SYS_ICACHE_SACR_VALUE 0x80000001/* Use the On-Chip-Memory (OCM) as a temporary stack for the startup code. */ #define CONFIG_SYS_TEMP_STACK_OCM 1
@@ -208,6 +209,7 @@/*----------------------------------------------------------------------- * Miscellaneous configurable options *----------------------------------------------------------------------*/ +#define CONFIG_VXWORKS_PREBOOT 1#define CONFIG_SYS_LONGHELP /* undef to save memory */ #define CONFIG_SYS_PROMPT "=> "/* Monitor Command Prompt */ #if defined(CONFIG_CMD_KGDB )
@@ -256,12 +258,6 @@#define CONFIG_SYS_GPIO0_OR 0x087FFFFF/* GPIO value */ #define CONFIG_SYS_GPIO0_TCR 0x7FFF8000/* GPIO value */ #define CONFIG_SYS_GPIO0_ODR 0xFFFF0000/* GPIO value */ -/* -* For booting Linux, the board info and command line data -* have to be in the first 8 MB of memory, since this is -* the maximum mapped by the Linux kernel during initialization. -*/ -#define CONFIG_SYS_BOOTMAPSZ (8 << 20)/* Initial Memory map for Linux */ /* Init Memory Controller: *
include/configs/netstal-common.h +6 -3
@@ -92,6 +92,8 @@#define CONFIG_CMD_REGINFO #define CONFIG_BOOT_RETRY_TIME 30#define CONFIG_RESET_TO_RETRY +#define CONFIG_SHOW_ACTIVITY +/* * Miscellaneous configurable options */
@@ -142,10 +144,11 @@/* * For booting Linux, the board info and command line data -* have to be in the first 8 MB of memory, since this is -* the maximum mapped by the Linux kernel during initialization. +* have to be in the first 16 MB of memory, since this is +* the maximum mapped by the 40x Linux kernel during initialization. */ -#define CONFIG_SYS_BOOTMAPSZ (8 << 20)/* Initial Memory map for Linux */ +#define CONFIG_SYS_BOOTMAPSZ (16 << 20)/* Initial Memory map for Linux */ +#define CONFIG_SYS_BOOTM_LEN (16 << 20)/* Increase max gunzip size */ /* * Internal Definitions
Signature · 1 line
1.6.3.3
PATCH 1/1 ppc4xx: Netstal boards: various cleanups
Various cleanups for our boards:
- vxworks_preboot to get clock input right for HCU4/MCU25
- reboot if SW-install-input is activated
- clear vxWorks exception msg
- HCU5: various HW-registers updated
- HCU5: 2nd Ethernet = SMII, Ethernet PLL Config. = recommended values
- HCU5: PATCH HAB: WRITE PIPELINING OFF
- HCU5: no pci_init if board has no PCI
- MCU25: corrected address to read slot id
- Lindent -pcs for hcu5.c
--- board/netstal/common/nm.h | 3 + board/netstal/common/nm_bsp.c | 14 ++++ board/netstal/hcu4/hcu4.c | 9 +++ board/netstal/hcu5/hcu5.c | 150 ++++++++++++++++++++++++++++------------- board/netstal/hcu5/sdram.c | 128 +++++++++++++++++++++++------------ board/netstal/mcu25/mcu25.c | 5 +- 6 files changed, 216 insertions(+), 93 deletions(-)
board/netstal/common/nm.h +3 -0
@@ -18,12 +18,15 @@* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ +#include <exports.h> +extern void hcu_led_set (u32 value);extern u32 get_serial_number (void );extern u32 hcu_get_slot (void );extern int board_with_pci (void );extern void nm_show_print (int generation,int index,int hw_capabilities);extern void set_params_for_sw_install (int install_requested,char *board_name ); +extern int sys_install_requested (void );extern void common_misc_init_r (void );enum {
board/netstal/common/nm_bsp.c +14 -0
@@ -37,6 +37,7 @@ generation_info generations[6] = { {HW_GENERATION_MCU20, "MCU20"}, {HW_GENERATION_MCU25, "MCU25"}, }; +static int installRequested;void nm_show_print (int generation,int index,int hw_capabilities) {
@@ -60,6 +61,7 @@ void nm_show_print(int generation, int index, int hw_capabilities)void set_params_for_sw_install (int install_requested,char *board_name ) { +memset ((void *)0x4300 ,0 ,0x100 );/* clear vxWorks exception msg */ if (install_requested) {char string[128 ];
@@ -115,3 +117,15 @@ void common_misc_init_r(void)saveenv (); } } + +void show_activity (int arg) +{ +hcu_led_set (arg); +if (sys_install_requested () !=installRequested ) + { +printf ("%s: installRequested 0x%x 0x%x\n" , __FUNCTION__, + installRequested, +sys_install_requested ()); +do_reset (); + } +}
board/netstal/hcu4/hcu4.c +9 -0
@@ -48,6 +48,7 @@ DECLARE_GLOBAL_DATA_PTR;*/ #define CPC0_CR0_VALUE 0x0030103c#define CPC0_CR1_VALUE 0x00004051 +#define CPCO_CR1_USE_EXTERNAL 0x00804051int board_early_init_f (void ) {
@@ -154,6 +155,14 @@ int misc_init_r(void)return 0 ; } +int vxworks_preboot (void ) { +if (sys_install_requested ()) + { +mtdcr (CPC0_CR1 ,CPCO_CR1_USE_EXTERNAL ); + } +return 0 ; +} +phys_size_t initdram (int board_type) {long dram_size =0 ;
board/netstal/hcu5/hcu5.c +102 -48
302 lines not on this page · raw message
board/netstal/hcu5/sdram.c +85 -43
223 lines not on this page · raw message
board/netstal/mcu25/mcu25.c +3 -2
@@ -27,9 +27,9 @@DECLARE_GLOBAL_DATA_PTR ; -#define MCU25_SLOT_ADDRESS (0x7A000000 + 0x0A)#define MCU25_DIGITAL_IO_REGISTER (0x7A000000 + 0xc0) +#define MCU25_SLOT_ADDRESS (0x7C000000 + 0x0A)#define MCU25_LED_REGISTER_ADDRESS (0x7C000000 + 0x10)#define MCU25_VERSIONS_REGISTER (0x7C000000 + 0x0C)#define MCU25_IO_CONFIGURATION (0x7C000000 + 0x0e)
@@ -49,7 +49,8 @@ DECLARE_GLOBAL_DATA_PTR;/* Attention: If you want 1 microsecs times from the external oscillator * 0x00004051 is okay for u-boot/linux, but different from old vxworks values -* 0x00804051 causes problems with u-boot and linux! +* 0x00804051 causes problems with u-boot and linux, but must be set if we +* want to boot old vxWorks installation */ #define CPC0_CR0_VALUE 0x0007F03C#define CPC0_CR1_VALUE 0x00004051
Signature · 1 line
1.6.3.3
PATCH 1/1 ppc4xx: Netstal boards: various cleanups
Hi Niklaus,
Quoted 10 lines · On Wednesday 23 September 2009 17:22:49 Niklaus Giger wrote:
Various cleanups for our boards:
-vxworks_prebootto get clock input right for HCU4/MCU25
- reboot if SW-install-input is activated
- clear vxWorks exception msg
- HCU5: various HW-registers updated
- HCU5: 2nd Ethernet = SMII, Ethernet PLL Config. = recommended values
- HCU5: PATCH HAB: WRITE PIPELINING OFF
- HCU5: nopci_initif board has no PCI
- MCU25: corrected address to read slot id
- Lindent -pcs forhcu5.c
Please find some comments below.
Quoted 53 lines
Signed-off-by Niklaus Giger <[email protected]>--- board/netstal/common/nm.h | 3 + board/netstal/common/nm_bsp.c | 14 ++++ board/netstal/hcu4/hcu4.c | 9 +++ board/netstal/hcu5/hcu5.c | 150 ++++++++++++++++++++++++++++------------- board/netstal/hcu5/sdram.c | 128 +++++++++++++++++++++++------------ board/netstal/mcu25/mcu25.c | 5 +- 6 files changed, 216 insertions(+), 93 deletions(-)board/netstal/common/nm.h +2
-0@@ -18,12 +18,15 @@* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ +#include <exports.h> +extern void hcu_led_set (u32 value);extern u32 get_serial_number (void );extern u32 hcu_get_slot (void );extern int board_with_pci (void );extern void nm_show_print (int generation,int index,int hw_capabilities);extern void set_params_for_sw_install (int install_requested,char *board_name ); +extern int sys_install_requested(void);extern void common_misc_init_r (void );enum {board/netstal/common/nm_bsp.c +2
-0@@ -37,6 +37,7 @@ generation_info generations[6] = { {HW_GENERATION_MCU20, "MCU20"}, {HW_GENERATION_MCU25, "MCU25"}, }; +static int installRequested;void nm_show_print (int generation,int index,int hw_capabilities) {@@ -60,6 +61,7 @@ void nm_show_print(int generation, int index, int hw_capabilities)void set_params_for_sw_install (int install_requested,char *board_name ) { +memset ((void *)0x4300 ,0 ,0x100 );/* clear vxWorks exception msg */ if (install_requested) {char string[128 ];
board/netstal/common/nm_bsp.c void common_misc_init_r(void) · line 125
Quoted 9 lines
board/netstal/common/nm_bsp.c +6
-0@@ -115,3 +117,15 @@ void common_misc_init_r(void)saveenv (); } } + +void show_activity (int arg) +{ +hcu_led_set (arg); +if (sys_install_requested () !=installRequested ) + {
if (sys_install_requested() != installRequested ) {board/netstal/common/nm_bsp.c void common_misc_init_r(void) · line 129
Quoted 4 lines
board/netstal/common/nm_bsp.c +4
-0+printf ("%s: installRequested 0x%x 0x%x\n" , __FUNCTION__, + installRequested, +sys_install_requested ()); +do_reset ();
do_reset();
Quoted 15 lines
board/netstal/common/nm_bsp.c +2
-0+ } +}board/netstal/hcu4/hcu4.c +1
-0@@ -48,6 +48,7 @@ DECLARE_GLOBAL_DATA_PTR;*/ #define CPC0_CR0_VALUE 0x0030103c#define CPC0_CR1_VALUE 0x00004051 +#define CPCO_CR1_USE_EXTERNAL 0x00804051int board_early_init_f (void ) {
board/netstal/hcu4/hcu4.c int misc_init_r(void) · line 162
Quoted 8 lines
board/netstal/hcu4/hcu4.c +5
-0@@ -154,6 +155,14 @@ int misc_init_r(void)return 0 ; } +int vxworks_preboot (void ) { +if (sys_install_requested ()) + { +mtdcr (CPC0_CR1 ,CPCO_CR1_USE_EXTERNAL ); + }
if (sys_install_requested()) mtdcr(CPC0_CR1, CPCO_CR1_USE_EXTERNAL);
Quoted 227 lines
board/netstal/hcu4/hcu4.c +3
-0+return 0 ; +} +phys_size_t initdram (int board_type) {long dram_size =0 ;board/netstal/hcu5/hcu5.c +3
-0@@ -45,6 +45,9 @@ extern flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS ];#define HCU_DIGITAL_IO_REGISTER (CONFIG_SYS_CPLD + 0x0500000)#define HCU_SW_INSTALL_REQUESTED 0x10 +#define OPB2PLB40_BCTRL 0x350 +#define P4P3BO0_CFG 0x026 +/* * This function is run very early, out of flash, and before devices are * initialized. It is called by lib_ppc/board.c:board_init_f by virtue
board/netstal/hcu5/hcu5.c +81
-36@@ -74,17 +77,17 @@ int board_early_init_f(void)mfcpr (CPR0_ICFG , cpr0icfg);if (!(cpr0icfg &CPR0_ICFG_RLI_MASK )) { -mtcpr (CPR0_MALD ,0x02000000 ); -mtcpr (CPR0_OPBD ,0x02000000 ); -mtcpr (CPR0_PERD ,0x05000000 );/* 1:5 */ -mtcpr (CPR0_PLLC ,0x40000238 ); -mtcpr (CPR0_PLLD ,0x01010414 ); +mtcpr (CPR0_MALD ,0x02000000 ); +mtcpr (CPR0_OPBD ,0x02000000 ); +mtcpr (CPR0_PERD ,0x05000000 );/* 1:5 */ +mtcpr (CPR0_PLLC ,0x40000238 ); +mtcpr (CPR0_PLLD ,0x01010414 );mtcpr (CPR0_PRIMAD ,0x01000000 );mtcpr (CPR0_PRIMBD ,0x01000000 ); -mtcpr (CPR0_SPCID ,0x03000000 ); -mtsdr (SDR0_PFC0 ,0x00003E00 );/* [CTE] = 0 */ -mtsdr (SDR0_CP440 ,0x0EAAEA02 );/* [Nto1] = 1*/ -mtcpr (CPR0_ICFG , cpr0icfg |CPR0_ICFG_RLI_MASK ); +mtcpr (CPR0_SPCID ,0x03000000 ); +mtsdr (SDR0_PFC0 ,0x00003E00 );/* [CTE] = 0 */ +mtsdr (SDR0_CP440 ,0x0EAAEA02 );/* [Nto1] = 1 */ +mtcpr (CPR0_ICFG , cpr0icfg |CPR0_ICFG_RLI_MASK );/* * Initiate system reset in debug control register DBCR @@ -92,7 +95,7 @@ int board_early_init_f(void) dbcr =mfspr (SPRN_DBCR0 ); mtspr(SPRN_DBCR0, dbcr | CHIP_RESET); } -mtsdr (SDR0_CP440 ,0x0EAAEA02 );/* [Nto1] = 1*/ +mtsdr (SDR0_CP440 ,0x0EAAEA02 );/* [Nto1] = 1 */ #endif mtdcr (EBC0_CFGADDR ,EBC0_CFG );mtdcr (EBC0_CFGDATA ,0xb8400000 );@@ -155,6 +158,9 @@ int board_early_init_f(void)mtsdr (SDR0_PFC0 ,0x00003E00 );/* Pin function: */ mtsdr (SDR0_PFC1 ,0x00848000 );/* Pin function: UART0 has 4 pins */ +/* 2nd Ethernet = SMII, Ethernet PLL Config. = recommended values */ +mtsdr (SDR0_PFC2 ,0x4642DB00 ); +/* setup BOOT FLASH */ mtsdr (SDR0_CUST0 ,0xC0082350 );@@ -220,7 +226,6 @@ u32 get_serial_number(void)return in_be32 (serial); } -/* * hcu_get_slot */ @@ -230,7 +235,6 @@ u32 hcu_get_slot(void)return in_be16 (slot) &0x7f ; } -/* * misc_init_r. */ @@ -239,6 +243,7 @@ int misc_init_r(void)unsigned long usb2d0cr =0 ;unsigned long usb2phy0cr, usb2h0cr =0 ;unsigned long sdr0_pfc1; +unsigned long addr;#ifdef CONFIG_ENV_IS_IN_FLASH /* Monitor protection ON by default */ @@ -251,7 +256,8 @@ int misc_init_r(void)/* Env protection ON by default */ (void )flash_protect (FLAG_PROTECT_SET ,CONFIG_ENV_ADDR_REDUND , -CONFIG_ENV_ADDR_REDUND +2 *CONFIG_ENV_SECT_SIZE -1 , +CONFIG_ENV_ADDR_REDUND + +2 *CONFIG_ENV_SECT_SIZE -1 , &flash_info[0 ]);#endif #endif @@ -266,59 +272,101 @@ int misc_init_r(void)mfsdr (SDR0_USB2PHY0CR , usb2phy0cr);mfsdr (SDR0_USB2H0CR , usb2h0cr); - usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_XOCLK_MASK ; - usb2phy0cr = usb2phy0cr |SDR0_USB2PHY0CR_XOCLK_EXTERNAL ;/*0*/ - usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_WDINT_MASK ; - usb2phy0cr = usb2phy0cr |SDR0_USB2PHY0CR_WDINT_16BIT_30MHZ ;/*1*/ - usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_DVBUS_MASK ; - usb2phy0cr = usb2phy0cr |SDR0_USB2PHY0CR_DVBUS_PURDIS ;/*0*/ - usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_DWNSTR_MASK ; - usb2phy0cr = usb2phy0cr |SDR0_USB2PHY0CR_DWNSTR_HOST ;/*1*/ - usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_UTMICN_MASK ; - usb2phy0cr = usb2phy0cr |SDR0_USB2PHY0CR_UTMICN_HOST ;/*1*/ + usb2phy0cr = usb2phy0cr & ~SDR0_USB2PHY0CR_XOCLK_MASK ; + usb2phy0cr = usb2phy0cr |SDR0_USB2PHY0CR_XOCLK_EXTERNAL ;/*0 */ + usb2phy0cr = usb2phy0cr & ~SDR0_USB2PHY0CR_WDINT_MASK ; + usb2phy0cr = usb2phy0cr |SDR0_USB2PHY0CR_WDINT_16BIT_30MHZ ;/*1 */ + usb2phy0cr = usb2phy0cr & ~SDR0_USB2PHY0CR_DVBUS_MASK ; + usb2phy0cr = usb2phy0cr |SDR0_USB2PHY0CR_DVBUS_PURDIS ;/*0 */ + usb2phy0cr = usb2phy0cr & ~SDR0_USB2PHY0CR_DWNSTR_MASK ; + usb2phy0cr = usb2phy0cr |SDR0_USB2PHY0CR_DWNSTR_HOST ;/*1 */ + usb2phy0cr = usb2phy0cr & ~SDR0_USB2PHY0CR_UTMICN_MASK ; + usb2phy0cr = usb2phy0cr |SDR0_USB2PHY0CR_UTMICN_HOST ;/*1 */ /* An 8-bit/60MHz interface is the only possible alternative * when connecting the Device to the PHY */ - usb2h0cr = usb2h0cr &~SDR0_USB2H0CR_WDINT_MASK ; - usb2h0cr = usb2h0cr |SDR0_USB2H0CR_WDINT_16BIT_30MHZ ;/*1*/ + usb2h0cr = usb2h0cr & ~SDR0_USB2H0CR_WDINT_MASK ; + usb2h0cr = usb2h0cr |SDR0_USB2H0CR_WDINT_16BIT_30MHZ ;/*1 */ /* To enable the USB 2.0 Device function through the UTMI interface */ - usb2d0cr = usb2d0cr &~SDR0_USB2D0CR_USB2DEV_EBC_SEL_MASK ; - usb2d0cr = usb2d0cr |SDR0_USB2D0CR_USB2DEV_SELECTION ;/*1*/ + usb2d0cr = usb2d0cr & ~SDR0_USB2D0CR_USB2DEV_EBC_SEL_MASK ; + usb2d0cr = usb2d0cr |SDR0_USB2D0CR_USB2DEV_SELECTION ;/*1 */ - sdr0_pfc1 = sdr0_pfc1 &~SDR0_PFC1_UES_MASK ; - sdr0_pfc1 = sdr0_pfc1 |SDR0_PFC1_UES_USB2D_SEL ;/*0*/ + sdr0_pfc1 = sdr0_pfc1 & ~SDR0_PFC1_UES_MASK ; + sdr0_pfc1 = sdr0_pfc1 |SDR0_PFC1_UES_USB2D_SEL ;/*0 */ mtsdr (SDR0_PFC1 , sdr0_pfc1);mtsdr (SDR0_USB2D0CR , usb2d0cr);mtsdr (SDR0_USB2PHY0CR , usb2phy0cr);mtsdr (SDR0_USB2H0CR , usb2h0cr); -/*clear resets*/ +/*clear resets */ udelay (1000 );mtsdr (SDR0_SRST1 ,0x00000000 );udelay (1000 );mtsdr (SDR0_SRST0 ,0x00000000 );printf ("USB: Host(int phy) Device(ext phy)\n" ); +/* Set priority for all PLB3 devices to 2. */ +mfsdr (SD0_AMP1 , addr); +mtsdr (SD0_AMP1 , (addr &0xCF30B400 ) |0x8A20B400 ); + +/* Set PLB3 arbiter to fair mode. */ + addr =mfdcr (PLB3_ACR ); +mtdcr (PLB3_ACR , addr |0x80000000 );/* Sequoia */ + +/* +* Set priority for all PLB4 devices to 2. +*/ +mfsdr (SD0_AMP0 , addr); +mtsdr (SD0_AMP0 , (addr &0xFFF3FD00 ) |0xAAA2FD00 ); + +/* +* Set PLB4 arbiter to: +* fair mode, High Bus Utilisation Enabled, +* 2 Deep read pipe, Write pipeline disabled. +*/ + addr = (mfdcr (PLB4_ACR &0xFF000000 ) |0xDA000000 ); +mtdcr (PLB4_ACR , addr); + +/* +* As of errata version 0.4, CHIP_8: Incorrect Write to DDR SDRAM. +* Workaround: Disable write pipelining to DDR SDRAM by setting +* PLB0_ACR[WRP] = 0. +*/ +mtdcr (PLB0_ACR , + (mfdcr (PLB0_ACR ) & ~PLB0_ACR_WRP_MASK ) |PLB0_ACR_WRP_DISABLED ); + +/* Segment1 */ +mtdcr (PLB1_ACR , + (mfdcr (PLB1_ACR ) & ~PLB1_ACR_WRP_MASK ) |PLB1_ACR_WRP_DISABLED ); + +/* Set priority of OPB-to-PLB4 Bridge */ +mtdcr (OPB2PLB40_BCTRL , + (mfdcr (OPB2PLB40_BCTRL ) & ~0xC0000000 ) |0x80000000 ); + +/* Set priority of PLB4 to PLB3 Bridge */ +mtdcr (P4P3BO0_CFG , (mfdcr (P4P3BO0_CFG ) & ~0x00C00000 ) |0x00800000 ); +common_misc_init_r (); -set_params_for_sw_install (sys_install_requested (),"hcu5" ); +set_params_for_sw_install (sys_install_requested (),"hcu5" );/* We cannot easily enable trace before, as there are other * routines messing around with sdr0_pfc1. And I do not need it. */ if (mfspr (SPRN_DBCR0 ) &0x80000000 ) {/* External debugger alive * enable trace facilty for Lauterbach -* CCR0[DTB]=0 Enable broadcast of trace information -* SDR0_PFC0[TRE] Trace signals are enabled instead of -* GPIO49-63 +* CCR0[DTB]=0 Enable broadcast of trace information +* SDR0_PFC0[TRE] Trace signals are enabled instead of +* GPIO49-63 */ -mtspr (SPRN_CCR0 ,mfspr (SPRN_CCR0 ) &~ (CCR0_DTB )); -mtsdr (SDR0_PFC0 , sdr0_pfc1 |SDR0_PFC0_TRE_ENABLE ); +mtspr (SPRN_CCR0 ,mfspr (SPRN_CCR0 ) & ~(CCR0_DTB )); +mtsdr (SDR0_PFC0 ,SDR0_PFC1 |SDR0_PFC0_TRE_ENABLE ); }return 0 ; } +#ifdef CONFIG_PCI int board_with_pci (void ) {
board/netstal/hcu5/hcu5.c int pci_pre_init(struct pci_controller *hose) · line 397
Quoted 7 lines
board/netstal/hcu5/hcu5.c +3
-1@@ -344,7 +392,9 @@ int pci_pre_init(struct pci_controller *hose) {unsigned long addr; -if (!board_with_pci ()) {return 0 ; } +if (!board_with_pci ()) { +return 0 ; + }
if (!board_with_pci()) return 0;
Quoted 34 lines
board/netstal/hcu5/hcu5.c +4
-4/* * Set priority for all PLB3 devices to 0. @@ -353,7 +403,7 @@ int pci_pre_init(struct pci_controller *hose)mfsdr (SD0_AMP1 , addr);mtsdr (SD0_AMP1 , (addr &0x000000FF ) |0x0000FF00 ); addr =mfdcr (PLB3_ACR ); -mtdcr (PLB3_ACR , addr |0x80000000 );/* Sequoia */ +mtdcr (PLB3_ACR , addr |0x80000000 );/* Sequoia */ /* * Set priority for all PLB4 devices to 0. @@ -361,17 +411,17 @@ int pci_pre_init(struct pci_controller *hose)mfsdr (SD0_AMP0 , addr);mtsdr (SD0_AMP0 , (addr &0x000000FF ) |0x0000FF00 ); addr =mfdcr (PLB4_ACR ) |0xa0000000 ;/* Was 0x8---- */ -mtdcr (PLB4_ACR , addr);/* Sequoia */ +mtdcr (PLB4_ACR , addr);/* Sequoia */ /* * As of errata version 0.4, CHIP_8: Incorrect Write to DDR SDRAM. * Workaround: Disable write pipelining to DDR SDRAM by setting * PLB0_ACR[WRP] = 0. */ -mtdcr (PLB0_ACR ,0 );/* PATCH HAB: WRITE PIPELINING OFF */ +mtdcr (PLB0_ACR ,0 );/* PATCH HAB: WRITE PIPELINING OFF */ /* Segment1 */ -mtdcr (PLB1_ACR ,0 );/* PATCH HAB: WRITE PIPELINING OFF */ +mtdcr (PLB1_ACR ,0 );/* PATCH HAB: WRITE PIPELINING OFF */ return board_with_pci (); }
board/netstal/hcu5/hcu5.c int pci_pre_init(struct pci_controller *hose) · line 441
Quoted 7 lines
board/netstal/hcu5/hcu5.c +3
-1@@ -386,14 +436,16 @@ int pci_pre_init(struct pci_controller *hose)*/ void pci_target_init (struct pci_controller *hose) { -if (!board_with_pci ()) {return ; } +if (!board_with_pci ()) { +return ; + }
if (!board_with_pci()) return;
Quoted 12 lines
board/netstal/hcu5/hcu5.c +1
-1/* * Set up Direct MMIO registers * * PowerPC440EPX PCI Master configuration. * Map one 1Gig range of PLB/processor addresses to PCI memory space. * PLB address 0xA0000000-0xDFFFFFFF ==> PCI address -* 0xA0000000-0xDFFFFFFF +* 0xA0000000-0xDFFFFFFF * Use byte reversed out routines to handle endianess. * Make this region non-prefetchable. */
board/netstal/hcu5/hcu5.c void pci_target_init(struct pci_controller *hose) · line 505
Quoted 7 lines
board/netstal/hcu5/hcu5.c +3
-1@@ -448,7 +500,9 @@ void pci_target_init(struct pci_controller *hose)void pci_master_init (struct pci_controller *hose) {unsigned short temp_short; -if (!board_with_pci ()) {return ; } +if (!board_with_pci ()) { +return ; + }
Again.
Quoted 54 lines
board/netstal/hcu5/hcu5.c +3
-4/*--------------------------------------------------------------- * Write the PowerPC440 EP PCI Configuration regs. @@ -479,7 +533,7 @@ int is_pci_host(struct pci_controller *hose) {return 1 ; } -#endif /* defined(CONFIG_PCI) */ +#endif /* defined(CONFIG_PCI) */ #if defined(CONFIG_POST )/* @@ -488,12 +542,12 @@ int is_pci_host(struct pci_controller *hose)*/ int post_hotkeys_pressed (void ) { -return 0 ;/* No hotkeys supported */ +return 0 ;/* No hotkeys supported */ }#endif /* CONFIG_POST */ #if defined(CONFIG_OF_LIBFDT ) && defined(CONFIG_OF_BOARD_SETUP ) -void ft_board_setup (void *blob,bd_t *bd) +void ft_board_setup (void *blob,bd_t * bd) {ft_cpu_setup (blob, bd);@@ -504,7 +558,7 @@ void ft_board_setup(void *blob, bd_t *bd)* Hardcoded flash setup: * Flash 0 is a non-CFI AMD AM29F040 flash, 8 bit flash / 8 bit bus. */ -ulong board_flash_get_legacy (ulong base,int banknum,flash_info_t * info) +ulong board_flash_get_legacy(ulong base, int banknum, flash_info_t * info) {if (banknum ==0 ) {/* non-CFI boot flash */ info->portwidth =1 ;board/netstal/hcu5/sdram.c +2
-0@@ -36,9 +36,11 @@#include <asm/mmu.h> #include <asm/cache.h> #include <ppc440.h> +#include <post.h> void hcu_led_set (u32 value);void dcbz_area (u32 start_address,u32 num_bytes); +void zero_all_memory (unsigned long start_address,unsigned long num_bytes);#define ECC_RAM 0x03267F0B#define
NO_ECC_RAM0x00267F0B
board/netstal/hcu5/sdram.c void dcbz_area(u32 start_address, u32 num_bytes); · line 56
Quoted 7 lines
board/netstal/hcu5/sdram.c +4
-0@@ -48,6 +50,11 @@ void dcbz_area(u32 start_address, u32 num_bytes);#define MY_TLB_WORD2_I_ENABLE TLB_WORD2_I_ENABLE/* disable caching on DDR2 */ +/* PPC440EPx Erratum CHIP_11: End of memory range area restricted access. +* -> no access to last 256 Bytes!!! +*/ +#define NO_TOUCH_BYTES_AT_END 256
Please take a look at this define in sequoia.h:
#define CONFIG_SYS_MEM_TOP_HIDE (4 << 10) /* don't use last 4kbytes */
/* 440EPx errata CHIP 11 */Doesn't this work for you as well?
Cheers,
Stefan
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: [email protected]
PATCH 1/1 ppc4xx: Netstal boards: various cleanups
In reply to Niklaus GigerDear Niklaus Giger,
Quoted 10 lines · In message <[email protected]> you…
Various cleanups for our boards:
-vxworks_prebootto get clock input right for HCU4/MCU25
- reboot if SW-install-input is activated
- clear vxWorks exception msg
- HCU5: various HW-registers updated
- HCU5: 2nd Ethernet = SMII, Ethernet PLL Config. = recommended values
- HCU5: PATCH HAB: WRITE PIPELINING OFF
- HCU5: nopci_initif board has no PCI
- MCU25: corrected address to read slot id
- Lindent -pcs forhcu5.c
Please don't mix white space cleanup / formatting changes with changes of real content.
board/netstal/common/nm_bsp.c void common_misc_init_r(void) · line 130
Quoted 10 lines
board/netstal/common/nm_bsp.c +10
-0+void show_activity (int arg) +{ +hcu_led_set (arg); +if (sys_install_requested () !=installRequested ) + { +printf ("%s: installRequested 0x%x 0x%x\n" , __FUNCTION__, + installRequested, +sys_install_requested ()); +do_reset (); + }
Incorrect brace style. Please fix globally.
...
Quoted 17 lines
board/netstal/hcu5/sdram.c +2
-0@@ -36,9 +36,11 @@#include <asm/mmu.h> #include <asm/cache.h> #include <ppc440.h> +#include <post.h> void hcu_led_set (u32 value);void dcbz_area (u32 start_address,u32 num_bytes); +void zero_all_memory (unsigned long start_address,unsigned long num_bytes);#define ECC_RAM 0x03267F0B#define NO_ECC_RAM 0x00267F0B
board/netstal/hcu5/sdram.c void dcbz_area(u32 start_address, u32 num_bytes); · line 55
Quoted 6 lines
board/netstal/hcu5/sdram.c +3
-0@@ -48,6 +50,11 @@ void dcbz_area(u32 start_address, u32 num_bytes);#define MY_TLB_WORD2_I_ENABLE TLB_WORD2_I_ENABLE/* disable caching on DDR2 */ +/* PPC440EPx Erratum CHIP_11: End of memory range area restricted access. +* -> no access to last 256 Bytes!!! +*/
Incorrect multiline comment style. Please fix globally.
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 "The one charm of marriage is that it makes a life of deception a neccessity." - Oscar Wilde
PATCH 1/1 ppc4xx: Update Netstal configs
In reply to Niklaus GigerDear Niklaus Giger,
Quoted 5 lines · In message <[email protected]> you…
-
CONFIG_SYS_BOOTMAPSZfor 16 instead of 8 MB, moved to common
- baudrate back to 9600 for backward compatibility
- HCU4:CONFIG_SYS_ICACHE_SACR_VALUEdefined
-CONFIG_VXWORKS_PREBOOTfor HCU4 and MCU25
- HCU5: Add CPU and OCM POST
...
include/configs/hcu5.h line 136
Quoted 4 lines
include/configs/hcu5.h +3
-1-#define CONFIG_DDR_ECC 1/* enable ECC */ +/* warum gibt es Fehler mit #undef CONFIG_DDR_ECC (Hub) */ +#define CONFIG_DDR_ECC +#undef DISABLE_DDR_ECC_AFTER_POST/* disable ECC after POST tests */
I recommend to use comments in one language only.
...
include/configs/hcu5.h line 234
Quoted 4 lines
include/configs/hcu5.h +4
-0+/* defining CONFIG_4xx_DCACHE leads to erros in memory_extended_tests */ +#undef CONFIG_WATCHDOG +/* Watchdog cannot be enabled, as it would be still enabled booting vxWorks */ +#undef CONFIG_4xx_DCACHE
It seems comments and code are mixed pretty randomly. I guess this is not intentional?
...
include/configs/netstal-common.h line 151
Quoted 3 lines
include/configs/netstal-common.h +2
-1-#define CONFIG_SYS_BOOTMAPSZ (8 << 20)/* Initial Memory map for Linux */ +#define CONFIG_SYS_BOOTMAPSZ (16 << 20)/* Initial Memory map for Linux */ +#define CONFIG_SYS_BOOTM_LEN (16 << 20)/* Increase max gunzip size */
Hm.. "Increase" is more suitable for the change log, but as a comment? Assume you read this in two years from now. What is being increased?
Best regards,
Wolfgang Denk
--
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: [email protected] I have the simplest tastes. I am always satisfied with the best.
-- Oscar Wilde
PATCH 1/1 ppc4xx: HCU5 board: add register dump
In reply to Niklaus GigerHi Niklaus,
board/netstal/hcu5/cmd_reghcu5.c line 38
Quoted 10 lines
board/netstal/hcu5/cmd_reghcu5.c new file +10
-0+enum REGISTER_TYPE { +DCR ,/* Directly Accessed DCR's */ +IDCR1 ,/* Indirectly Accessed DCR to SDRAM0_CFGADDR and SDRAM0_CFGDATA */ +IDCR2 ,/* Indirectly Accessed DCR to EBC0_CFGADDR and EBC0_CFGDATA */ +IDCR3 ,/* Indirectly Accessed DCR to EBM0_CFGADDR and EBM0_CFGDATA */ +IDCR4 ,/* Indirectly Accessed DCR to PPM0_CFGADDR and PPM0_CFGDATA */ +IDCR5 ,/* Indirectly Accessed DCR to CPR0_CFGADDR and CPR0_CFGDATA */ +IDCR6 ,/* Indirectly Accessed DCR to SDR0_CFGADDR and SDR0_CFGDATA */ +MM /* Directly Accessed MMIO Register */ +};
The lines above are well over 80 lines.
Quoted 11 lines
board/netstal/hcu5/cmd_reghcu5.c new file +11
-0+struct cpu_register { +char *name; +enum REGISTER_TYPE type; +unsigned long address; +}; + +/* PPC440EPx registers ordered for output +* name type addr size +* ------------------------------------------- +*/ +const struct cpu_register ppc440epx_reg[] = {
board/netstal/hcu5/cmd_reghcu5.c line 60
Quoted 10 lines
board/netstal/hcu5/cmd_reghcu5.c new file +10
-0+ {"EBC0_B0CR ", IDCR2, PB0CR}, + {"EBC0_B1CR ", IDCR2, PB1CR}, + {"EBC0_B2CR ", IDCR2, PB2CR}, + {"EBC0_B3CR ", IDCR2, PB3CR}, + {"EBC0_B4CR ", IDCR2, PB4CR}, + {"EBC0_B5CR ", IDCR2, PB5CR}, + {"EBC0_B0AP ", IDCR2, PB0AP}, + {"EBC0_B1AP ", IDCR2, PB1AP}, + {"EBC0_B2AP ", IDCR2, PB2AP}, + {"EBC0_B3AP ", IDCR2, PB3AP},
You should be able to remove all those empty spaces in the strings above and use a fancy printf format to get your alignment right.
<snip>
Quoted 35 lines
board/netstal/hcu5/cmd_reghcu5.c new file +35
-0+/* +* CPU Register dump of PPC440EPx +* Output in order of struct ppc440epx_reg +*/ +int do_reghcu5 (cmd_tbl_t * cmdtp,int flag,int argc,char *argv[]) +{ +unsigned int i; +unsigned int n; +unsigned long value; +enum REGISTER_TYPE type; + +printf + ("\nRegister Dump PPC440EPx for comparison with document A0001492\n\n" ); + n =sizeof (ppc440epx_reg) /sizeof (ppc440epx_reg[0 ]); +for (i =0 ; i < n; i++) { + value =0 ; + type = ppc440epx_reg[i].type; +switch (type) { +case DCR :/* Directly Accessed DCR's */ +switch (ppc440epx_reg[i].address) { +/* following list includes only registers included in struct */ +case 0x0b0 : + value =mfdcr (0x0b0 ); +break ; +case 0x0f0 : + value =mfdcr (0x0f0 ); +break ; +case 0x0180 : + value =mfdcr (0x0180 ); +break ; +case 0x081 : + value =mfdcr (0x081 ); +break ; +case 0x089 : + value =mfdcr (0x089 );
board/netstal/hcu5/cmd_reghcu5.c line 241
Quoted 10 lines
board/netstal/hcu5/cmd_reghcu5.c new file +10
-0+break ; +case 0x077 : + value =mfdcr (0x077 ); +break ; +case 0x350 : + value =mfdcr (0x350 ); +break ; +case 0x026 : + value =mfdcr (0x026 ); +break ;
Replace all the above "value = ...; break;" with 1 "value = mfdcr(ppc440epx_reg[i].address); break;"?
<snip>
board/netstal/hcu5/cmd_reghcu5.c line 283
Quoted 4 lines
board/netstal/hcu5/cmd_reghcu5.c new file +4
-0+ +/* define do_reghcu5 as u-boot command */ +U_BOOT_CMD (reghcu5,2 ,1 , do_reghcu5, + "reghcu5 - print register information for HCU5\n",);
This command's help message won't be printed correctly.
Best,
Peter
PATCH 1/1 ppc4xx: HCU5 board: add register dump
Hi Peter
Thanks for your feedback, but ..
Am Mittwoch 23 September 2009 17:59:10 schrieb Peter Tyser:
Quoted 2 lines
Hi Niklaus,
<snip>
Quoted 9 lines
board/netstal/hcu5/cmd_reghcu5.c line 241
Quoted 6 lines
board/netstal/hcu5/cmd_reghcu5.c new file +6
-0+case 0x350 : + value =mfdcr (0x350 ); +break ; +case 0x026 : + value =mfdcr (0x026 ); +break ;Replace all the above "value = ...; break;" with 1 "value =
mfdcr(ppc440epx_reg[i].address); break;"?
This cannot be done, as mfdcr is assembler mfdcr register, ID_OF_DCR ID_OF_DCR cannot be a variable.
Quoted 10 lines
<snip>
board/netstal/hcu5/cmd_reghcu5.c line 283
Quoted 4 lines
board/netstal/hcu5/cmd_reghcu5.c new file +4
-0+ +/* define do_reghcu5 as u-boot command */ +U_BOOT_CMD (reghcu5,2 ,1 , do_reghcu5, + "reghcu5 - print register information for HCU5\n",);This command's help message won't be printed correctly.
Quoted 2 lines
Best,
Peter
All the rest will show up in the coming next patch.
Best regards
Signature · 3 lines
Niklaus Giger Netstal Maschinen AG CH-8752 Naefels
PATCH 1/1 ppc4xx: HCU5 board: add register dump
In reply to Niklaus GigerHi Niklaus,
Quoted 3 lines · On Wednesday 23 September 2009 17:22:47 Niklaus Giger wrote:
Adds a HCU5 board specific cmd reghcu5 to dump about 140 internal register which define the HW configuration. Needed for documentation purposes and to compare different settings.
Apart from Peter's comments, I also have a more general comment. Please correct me if I'm wring, but this register dump doesn't seem to be HCU5 specific, but PPC440EPx specific. If this is the case, we (you) should probably move this code into the cpu/ppc4xx directory. Perhaps something like:
cpu/ppc4xx/440epx_regdump.c
What do you think?
Cheers,
Stefan
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de
PATCH 1/1 ppc4xx: HCU5 board: add register dump
Am Mittwoch 23 September 2009 18:49:34 schrieb Stefan Roese:
Quoted 13 lines
Hi Niklaus,
Quoted 3 lines · On Wednesday 23 September 2009 17:22:47 Niklaus Giger wrote:
Adds a HCU5 board specific cmd reghcu5 to dump about 140 internal register which define the HW configuration. Needed for documentation purposes and to compare different settings.
Apart from Peter's comments, I also have a more general comment. Please correct me if I'm wring, but this register dump doesn't seem to be HCU5 specific, but PPC440EPx specific. If this is the case, we (you) should probably move this code into the cpu/ppc4xx directory. Perhaps something
like:
Quoted 3 lines
cpu/ppc4xx/440epx_regdump.cWhat do you think?
I feel honoured if you consider this patch useful for other boards, too. I will rename the cmd to "440epx_regdump" unless you have a better idea.
Patch will follow tomorrow from my office.
Will remove the reference to our internal documentation, too.
Best regards
Quoted 3 lines
Cheers,
Stefan
Signature · 5 lines
Niklaus Giger Wieshoschet 6 CH-8753 Mollis +41 (0)55 612 20 54 P +41 (0)55 618 64 68 G
PATCH 1/1 ppc4xx: HCU5 board: add register dump
Quoted 10 lines · On Wednesday 23 September 2009 19:51:24 Niklaus Giger wrote:
Quoted 10 lines
Quoted 3 lines
Adds a HCU5 board specific cmd reghcu5 to dump about 140 internal register which define the HW configuration. Needed for documentation purposes and to compare different settings.
Apart from Peter's comments, I also have a more general comment. Please correct me if I'm wring, but this register dump doesn't seem to be HCU5 specific, but PPC440EPx specific. If this is the case, we (you) should probably move this code into the cpu/ppc4xx directory. Perhaps something
like:
Quoted 6 lines
Quoted 3 lines
cpu/ppc4xx/440epx_regdump.cWhat do you think?
I feel honoured if you consider this patch useful for other boards, too. I will rename the cmd to "440epx_regdump" unless you have a better idea.
Thinking a bit more about it, we should probably choose a more generic name, so that other 4xx variants may use this command as well. How about just using "regdump"?
And please base you patch against the "4xx-register-cleanup" branch of my u- boot-ppc4xx repo.
Cheers,
Stefan
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de
PATCH 1/1 ppc4xx: HCU5 board: add register dump
Quoted 18 lines · Stefan Roese
Quoted 10 lines · On Wednesday 23 September 2009 19:51:24 Niklaus Giger wrote:
Quoted 10 lines
Quoted 3 lines
Adds a HCU5 board specific cmd reghcu5 to dump about 140 internal register which define the HW configuration. Needed for documentation purposes and to compare different settings.
Apart from Peter's comments, I also have a more general comment. Please correct me if I'm wring, but this register dump doesn't seem to be HCU5 specific, but PPC440EPx specific. If this is the case, we (you) should probably move this code into the cpu/ppc4xx directory. Perhaps something
like:Quoted 6 lines
Quoted 3 lines
cpu/ppc4xx/440epx_regdump.cWhat do you think?
I feel honoured if you consider this patch useful for other boards, too. I will rename the cmd to "440epx_regdump" unless you have a better idea.
Quoted 6 lines
Thinking a bit more about it, we should probably choose a more generic name, so that other 4xx variants may use this command as well. How about just using "regdump"?
And please base you patch against the "4xx-register-cleanup" branch of my u- boot-ppc4xx repo.
What about adding a common 4xx_reginfo() function instead, then calling it from common/cmd_reginfo.c? Some of the 4xx dumping already in cmd_reginfo.c could also be moved to cpu/ppc4xx/[reginfo.c|cpu.c] to clean it up. Unless there's a good reason to have both "regdump" and "reginfo" commands...
Best,
Peter
PATCH 1/1 ppc4xx: HCU5 board: add register dump
Quoted 11 lines · On Thursday 24 September 2009 12:04:53 Peter Tyser wrote:
Quoted 6 lines
Thinking a bit more about it, we should probably choose a more generic name, so that other 4xx variants may use this command as well. How about just using "regdump"?
And please base you patch against the "4xx-register-cleanup" branch of my u- boot-ppc4xx repo.
What about adding a common 4xx_reginfo() function instead, then calling it from
common/cmd_reginfo.c? Some of the 4xx dumping already incmd_reginfo.ccould also be moved to cpu/ppc4xx/[reginfo.c|cpu.c] to clean it up.
Good idea. I totally forgot about this code. At least the 4xx part is stone age and can be dropper or replaced by the new concept introduced by Niklaus.
Quoted 2 lines
Unless there's a good reason to have both "regdump" and "reginfo" commands...
I can't think of any. Niklaus, is this ok with you too?
If yes, then please create a patch as suggested by Peter, calling ppc4xx_reginfo() function in common/cmd_reginfo.c (analog to mpc86xx_reginfo()). And add cpu/ppc4xx/reginfo.c with this function.
I (or somebody else?) will then, if time permits, add some other 4xx variants to this ppc4xx reginfo command as well.
Cheers,
Stefan
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de
PATCH 1/1 ppc4xx: HCU5 board: add register dump
In reply to Niklaus GigerDear Niklaus Giger,
Quoted 16 lines · In message <[email protected]> you…
Adds a HCU5 board specific cmd reghcu5 to dump about 140 internal register which define the HW configuration. Needed for documentation purposes and to compare different settings.
Signed-off-by Niklaus Giger <[email protected]>--- board/netstal/hcu5/Makefile | 2 +- board/netstal/hcu5/cmd_reghcu5.c | 283 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 284 insertions(+), 1 deletions(-) create mode 100644 board/netstal/hcu5/cmd_reghcu5.cboard/netstal/hcu5/Makefile +0
-0
board/netstal/hcu5/Makefile LIB = $(obj)lib$(BOARD).a · line 28
Quoted 5 lines
board/netstal/hcu5/Makefile +1
-1@@ -25,7 +25,7 @@ LIB = $(obj)lib$(BOARD).a # NOBJS : Netstal common objects NOBJS = nm_bsp.o -COBJS = $(BOARD).o sdram.o +COBJS = $(BOARD).o sdram.o cmd_reghcu5.o
Please keep lists sorted. Consider using only one file entry per line.
Quoted 6 lines
board/netstal/hcu5/Makefile +0
-0SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) $(addprefix ../common/,$(NOBJS:.o=.c))board/netstal/hcu5/cmd_reghcu5.c new file +0
-0
...
Quoted 3 lines
+/************************************************************************
+ *cmd_reghcu5.c- CPU Register Dump for HCU5 board with PPC440EPx
+ ***********************************************************************/
Incorrect multiline comment style.
board/netstal/hcu5/cmd_reghcu5.c line 37
Quoted 13 lines
board/netstal/hcu5/cmd_reghcu5.c new file +13
-0+#include <common.h> +#include <command.h> +#include <asm/processor.h> + +enum REGISTER_TYPE { +DCR ,/* Directly Accessed DCR's */ +IDCR1 ,/* Indirectly Accessed DCR to SDRAM0_CFGADDR and SDRAM0_CFGDATA */ +IDCR2 ,/* Indirectly Accessed DCR to EBC0_CFGADDR and EBC0_CFGDATA */ +IDCR3 ,/* Indirectly Accessed DCR to EBM0_CFGADDR and EBM0_CFGDATA */ +IDCR4 ,/* Indirectly Accessed DCR to PPM0_CFGADDR and PPM0_CFGDATA */ +IDCR5 ,/* Indirectly Accessed DCR to CPR0_CFGADDR and CPR0_CFGDATA */ +IDCR6 ,/* Indirectly Accessed DCR to SDR0_CFGADDR and SDR0_CFGDATA */ +MM /* Directly Accessed MMIO Register */
Lines too long. Please fix globally.
Quoted 4 lines
+/* PPC440EPx registers ordered for output
+ * name type addr size
+ * -------------------------------------------
+ */
Incorrect multiline comment style. Please fix globally.
board/netstal/hcu5/cmd_reghcu5.c line 58
Quoted 9 lines
board/netstal/hcu5/cmd_reghcu5.c new file +9
-0+const struct cpu_register ppc440epx_reg[] = { + {"EBC0_B0CR " ,IDCR2 ,PB0CR }, + {"EBC0_B1CR " ,IDCR2 ,PB1CR }, + {"EBC0_B2CR " ,IDCR2 ,PB2CR }, + {"EBC0_B3CR " ,IDCR2 ,PB3CR }, + {"EBC0_B4CR " ,IDCR2 ,PB4CR }, + {"EBC0_B5CR " ,IDCR2 ,PB5CR }, + {"EBC0_B0AP " ,IDCR2 ,PB0AP }, + {"EBC0_B1AP " ,IDCR2 ,PB1AP },
...
Instead of wasting memory for white space padded strings...
...
board/netstal/hcu5/cmd_reghcu5.c line 276
Quoted 2 lines
board/netstal/hcu5/cmd_reghcu5.c new file +2
-0+printf ("0x%08lx %16s: 0x%08lx\n" , ppc440epx_reg[i].address, + ppc440epx_reg[i].name, value);
... you shoudl change this into
printf("0x%08lx %-16s: 0x%08lx\n", ...which will give you the same left-aligned output.
Best regards,
Wolfgang Denk
Signature · 8 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 "Science makes godlike -- it is all over with priests and gods when man becomes scientific. Moral: science is the forbidden as such -- it alone is forbidden. Science is the *first* sin, the *original* sin. *This alone is morality.* ``Thou shalt not know'' -- the rest follows." - Friedrich Nietzsche