powerpc: add support for the Freescale P1022DS reference board
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
Add basic suport for the Freescale P1022DS reference board.
---
This patch requires the following two patches to be applied first:
fsl/85xx: add clkdvdr and pmuxcr2 to global utilities structure definition
fsl: rename 'dma' to 'brdcfg1' in the ngPIXIS structure
Makefile | 3 + arch/powerpc/cpu/mpc8xxx/pci_cfg.c | 26 ++ board/freescale/p1022ds/Makefile | 40 +++ board/freescale/p1022ds/config.mk | 14 + board/freescale/p1022ds/ddr.c | 108 +++++++ board/freescale/p1022ds/law.c | 27 ++ board/freescale/p1022ds/p1022ds.c | 369 ++++++++++++++++++++++++ board/freescale/p1022ds/p1022ds_diu.c | 151 ++++++++++ board/freescale/p1022ds/tlb.c | 76 +++++ include/configs/P1022DS.h | 505 +++++++++++++++++++++++++++++++++ 10 files changed, 1319 insertions(+), 0 deletions(-) create mode 100644 board/freescale/p1022ds/Makefile create mode 100644 board/freescale/p1022ds/config.mk create mode 100644 board/freescale/p1022ds/ddr.c create mode 100644 board/freescale/p1022ds/law.c create mode 100644 board/freescale/p1022ds/p1022ds.c create mode 100644 board/freescale/p1022ds/p1022ds_diu.c create mode 100644 board/freescale/p1022ds/tlb.c create mode 100644 include/configs/P1022DS.h
Makefile +3 -0
@@ -2493,6 +2493,9 @@ P2020DS_36BIT_config \ P2020DS_config: unconfig @$(MKCONFIG) -t $(@:_config=) P2020DS powerpc mpc85xx p2020ds freescale +P1022DS_config: unconfig + @$(MKCONFIG) -t $(@:_config=) P1022DS powerpc mpc85xx p1022ds freescale + P1011RDB_config \ P1011RDB_NAND_config \ P1011RDB_SDCARD_config \
arch/powerpc/cpu/mpc8xxx/pci_cfg.c +26 -0
@@ -186,6 +186,32 @@ static struct pci_info pci_config_info[] = (1 << 0x16) | (1 << 0x17) | (1 << 0x18) | (1 << 0x1c), }, }; +#elif defined(CONFIG_P1022 ) +static struct pci_info pci_config_info[] = +{ + [LAW_TRGT_IF_PCIE_1 ] = { + .agent = (1 <<0 ) | (1 <<1 ), + .cfg = (1 <<6 ) | (1 <<7 ) | (1 <<9 ) | (1 <<0xa ) | + (1 <<0xb ) | (1 <<0xd ) | (1 <<0xe ) | + (1 <<0xf ) | (1 <<0x15 ) | (1 <<0x16 ) | + (1 <<0x17 ) | (1 <<0x18 ) | (1 <<0x19 ) | + (1 <<0x1a ) | (1 <<0x1b ) | (1 <<0x1c ) | + (1 <<0x1d ) | (1 <<0x1e ) | (1 <<0x1f ), + }, + [LAW_TRGT_IF_PCIE_2 ] = { + .agent = (1 <<0 ) | (1 <<2 ), + .cfg = (1 <<0 ) | (1 <<1 ) | (1 <<6 ) | (1 <<7 ) | + (1 <<9 ) | (1 <<0xa ) | (1 <<0xb ) | (1 <<0xd ) | + (1 <<0x15 ) | (1 <<0x16 ) | (1 <<0x17 ) | + (1 <<0x18 ) | (1 <<0x1c ), + }, + [LAW_TRGT_IF_PCIE_3 ] = { + .agent = (1 <<0 ) | (1 <<3 ), + .cfg = (1 <<6 ) | (1 <<7 ) | (1 <<9 ) | (1 <<0xd ) | + (1 <<0x15 ) | (1 <<0x16 ) | (1 <<0x17 ) | (1 <<0x18 ) | + (1 <<0x19 ) | (1 <<0x1a ) | (1 <<0x1b ), + }, +};#elif defined(CONFIG_P2010 ) || defined(CONFIG_P2020 )static struct pci_info pci_config_info[] = {
board/freescale/p1022ds/Makefile new file +40 -0
@@ -0,0 +1,40 @@ +# +# Copyright 2010 Freescale Semiconductor, Inc. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the Free +# Software Foundation; either version 2 of the License, or (at your option) +# any later version. +# + +include $(TOPDIR)/config.mk + +LIB = $(obj)lib$(BOARD).a + +COBJS-y += $(BOARD).o +COBJS-y += ddr.o +COBJS-y += law.o +COBJS-y += tlb.o +COBJS-${CONFIG_FSL_DIU_FB} += p1022ds_diu.o + +SRCS := $(SOBJS:.o=.S) $(COBJS-y:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS-y)) +SOBJS := $(addprefix $(obj),$(SOBJS)) + +$(LIB): $(obj).depend $(OBJS) $(SOBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) + +clean: + rm -f $(OBJS) $(SOBJS) + +distclean: clean + rm -f $(LIB) core *.bak .depend + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +#########################################################################
board/freescale/p1022ds/config.mk new file +14 -0
@@ -0,0 +1,14 @@ +# +# Copyright 2010 Freescale Semiconductor, Inc. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the Free +# Software Foundation; either version 2 of the License, or (at your option) +# any later version. +# + +ifndef TEXT_BASE +TEXT_BASE = 0xeff80000 +endif + +RESET_VECTOR_ADDRESS = 0xeffffffc
board/freescale/p1022ds/ddr.c new file +108 -0
108 lines not on this page · raw message
board/freescale/p1022ds/law.c new file +27 -0
@@ -0,0 +1,27 @@ +/* +* Copyright 2010 Freescale Semiconductor, Inc. +* Authors: Srikanth Srinivasan <[email protected]> +* Timur Tabi <[email protected]> +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License as published by the Free +* Software Foundation; either version 2 of the License, or (at your option) +* any later version. +*/ + +#include <common.h> +#include <asm/fsl_law.h> +#include <asm/mmu.h> + +struct law_entry law_table[] = { +SET_LAW (CONFIG_SYS_FLASH_BASE_PHYS ,LAW_SIZE_256M ,LAW_TRGT_IF_LBC ), +SET_LAW (CONFIG_SYS_PCIE1_MEM_PHYS ,LAW_SIZE_512M ,LAW_TRGT_IF_PCIE_1 ), +SET_LAW (CONFIG_SYS_PCIE1_IO_PHYS ,LAW_SIZE_64K ,LAW_TRGT_IF_PCIE_1 ), +SET_LAW (CONFIG_SYS_PCIE2_MEM_PHYS ,LAW_SIZE_512M ,LAW_TRGT_IF_PCIE_2 ), +SET_LAW (CONFIG_SYS_PCIE2_IO_PHYS ,LAW_SIZE_64K ,LAW_TRGT_IF_PCIE_2 ), +SET_LAW (CONFIG_SYS_PCIE3_MEM_PHYS ,LAW_SIZE_512M ,LAW_TRGT_IF_PCIE_3 ), +SET_LAW (CONFIG_SYS_PCIE3_IO_PHYS ,LAW_SIZE_64K ,LAW_TRGT_IF_PCIE_3 ), +SET_LAW (PIXIS_BASE_PHYS ,LAW_SIZE_4K ,LAW_TRGT_IF_LBC ), +}; + +int num_law_entries =ARRAY_SIZE (law_table);
board/freescale/p1022ds/p1022ds.c new file +369 -0
369 lines not on this page · raw message
board/freescale/p1022ds/p1022ds_diu.c new file +151 -0
151 lines not on this page · raw message
board/freescale/p1022ds/tlb.c new file +76 -0
76 lines not on this page · raw message
include/configs/P1022DS.h new file +505 -0
505 lines not on this page · raw message
Signature · 1 line
1.6.5
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
Dear Timur Tabi,
Quoted 21 lines · In message <[email protected]> you wrote:
Add basic suport for the Freescale P1022DS reference board.
Signed-off-by Timur Tabi <[email protected]>---
This patch requires the following two patches to be applied first:
fsl/85xx: add clkdvdr and pmuxcr2 to global utilities structure definition
fsl: rename 'dma' to 'brdcfg1' in the ngPIXIS structureMakefile | 3 + arch/powerpc/cpu/mpc8xxx/pci_cfg.c | 26 ++ board/freescale/p1022ds/Makefile | 40 +++ board/freescale/p1022ds/config.mk | 14 + board/freescale/p1022ds/ddr.c | 108 +++++++ board/freescale/p1022ds/law.c | 27 ++ board/freescale/p1022ds/p1022ds.c | 369 ++++++++++++++++++++++++ board/freescale/p1022ds/p1022ds_diu.c | 151 ++++++++++ board/freescale/p1022ds/tlb.c | 76 +++++ include/configs/P1022DS.h | 505 +++++++++++++++++++++++++++++++++ 10 files changed, 1319 insertions(+), 0 deletions(-)
Quoted 8 lines
create mode 100644 board/freescale/p1022ds/Makefile create mode 100644 board/freescale/p1022ds/config.mk create mode 100644 board/freescale/p1022ds/ddr.c create mode 100644 board/freescale/p1022ds/law.c create mode 100644 board/freescale/p1022ds/p1022ds.c create mode 100644 board/freescale/p1022ds/p1022ds_diu.c create mode 100644 board/freescale/p1022ds/tlb.c create mode 100644 include/configs/P1022DS.h
Entries to MAKEALL and MAINTAINERS missing.
Quoted 5 lines
Makefile +0
-0
Makefile P2020DS_36BIT_config \ · line 2501
Quoted 9 lines
Makefile +3
-0@@ -2493,6 +2493,9 @@ P2020DS_36BIT_config \ P2020DS_config: unconfig @$(MKCONFIG) -t $(@:_config=) P2020DS powerpc mpc85xx p2020ds freescale +P1022DS_config: unconfig + @$(MKCONFIG) -t $(@:_config=) P1022DS powerpc mpc85xx p1022ds freescale + P1011RDB_config \ P1011RDB_NAND_config \ P1011RDB_SDCARD_config \
Please keep lists sorted / sort them.
Quoted 5 lines
board/freescale/p1022ds/ddr.c new file +0
-0
...
board/freescale/p1022ds/ddr.c line 28
Quoted 6 lines
board/freescale/p1022ds/ddr.c new file +6
-0+void fsl_ddr_get_spd (ddr3_spd_eeprom_t *ctrl_dimms_spd,unsigned int ctrl_num) +{ +int ret; + +/* The P1022 has only one DDR controller, and the board has only one +DIMM slot. */
Incorrect multiline comment style.
...
Quoted 5 lines
+/* ranges for parameters:
+ * wr_data_delay = 0-6 + * clk adjust = 0-8 + * cpo 2-0x1E (30)+ */
Incorrect multiline comment style.
board/freescale/p1022ds/ddr.c line 56
Quoted 4 lines
board/freescale/p1022ds/ddr.c new file +4
-0+static const board_specific_parameters_t bsp[] = { +/* memory controller 0 */ +/* lo| hi| num| clk| cpo|wrdata|2T */ +/* mhz| mhz|ranks|adjst| | delay| */
Incorrect multiline comment style.
Please fix globally!
board/freescale/p1022ds/ddr.c line 66
Quoted 10 lines
board/freescale/p1022ds/ddr.c new file +10
-0+ { 0, 333, 1, 5, 31, 3, 0}, + {334, 400, 1, 5, 31, 3, 0}, + {401, 549, 1, 5, 31, 3, 0}, + {550, 680, 1, 5, 31, 5, 0}, + {681, 850, 1, 5, 31, 5, 0}, + { 0, 333, 2, 5, 31, 3, 0}, + {334, 400, 2, 5, 31, 3, 0}, + {401, 549, 2, 5, 31, 3, 0}, + {550, 680, 2, 5, 31, 5, 0}, + {681, 850, 2, 5, 31, 5, 0},
Please use TABs for vertical alignment.
Quoted 3 lines
board/freescale/p1022ds/ddr.c new file +3
-0+void fsl_ddr_board_options (memctl_options_t *popts,dimm_params_t *pdimm, +unsigned int ctrl_num) +{
...
board/freescale/p1022ds/ddr.c line 103
Quoted 5 lines
board/freescale/p1022ds/ddr.c new file +5
-0+/* Per AN4039, enable ZQ calibration. */ + popts->zq_en =1 ; + + +/*
Drop one of these empty lines, please.
board/freescale/p1022ds/ddr.c
Quoted 7 lines
board/freescale/p1022ds/ddr.c new file +7
-0+int board_early_init_f (void ) +{ +ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR; + +/* Set pmuxcr to allow both i2c1 and i2c2 */ +setbits_be32 (&gur->pmuxcr,0x1000 ); +in_be32 (&gur->pmuxcr);
What is this in_be32() needed for? Either add a comment why it's needed, or remove it.
...
board/freescale/p1022ds/ddr.c
Quoted 12 lines
board/freescale/p1022ds/ddr.c new file +12
-0+phys_size_t initdram (int board_type) +{ +phys_size_t dram_size =0 ; + +puts ("Initializing....\n" ); + + dram_size =fsl_ddr_sdram (); + dram_size =setup_ddr_tlbs (dram_size /0x100000 ); + dram_size *=0x100000 ; + +puts (" DDR: " ); +return dram_size;
How about using get_ram_size() for autosizing / testing?
board/freescale/p1022ds/ddr.c
Quoted 2 lines
board/freescale/p1022ds/ddr.c new file +2
-0+/* Enable the TFP410 Encoder (I2C address 0x38) +*/
Please use a symbolic name instead of the hard-wired constant.
Quoted 12 lines
board/freescale/p1022ds/ddr.c new file +12
-0+void pci_init_board (void ) +{ +volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); +struct fsl_pci_info pci_info[3 ]; +u32 devdisr, pordevsr, io_sel; +int first_free_busno =0 ; +int num =0 ; + +int pcie_ep, pcie_configured; + + devdisr =in_be32 (&gur->devdisr); + pordevsr =in_be32 (&gur->pordevsr);
board/freescale/p1022ds/ddr.c
Quoted 10 lines
board/freescale/p1022ds/ddr.c new file +10
-0+ io_sel = (pordevsr & MPC85xx_PORDEVSR_IO_SEL) >>18 ; + +debug (" pci_init_board: devdisr=%x, io_sel=%x\n" , devdisr, io_sel); + +if (!(pordevsr & MPC85xx_PORDEVSR_SGMII2_DIS)) +printf (" eTSEC2 is in sgmii mode.\n" ); +if (!(pordevsr & MPC85xx_PORDEVSR_SGMII3_DIS)) +printf (" eTSEC3 is in sgmii mode.\n" ); + +puts ("\n" );
Drop that.
Quoted 6 lines
board/freescale/p1022ds/ddr.c new file +6
-0+#ifdef CONFIG_PCIE2 + pcie_configured =is_fsl_pci_cfg (LAW_TRGT_IF_PCIE_2 , io_sel); + +if (pcie_configured && !(devdisr & MPC85xx_DEVDISR_PCIE2)) { +SET_STD_PCIE_INFO (pci_info[num],2 ); + pcie_ep =fsl_setup_hose (&pcie2_hose, pci_info[num].regs);
board/freescale/p1022ds/ddr.c
Quoted 10 lines
board/freescale/p1022ds/ddr.c new file +10
-0+printf (" PCIE2 connected to Slot 3 as %s (base addr %lx)\n" , + pcie_ep ?"Endpoint" :"Root Complex" , + pci_info[num].regs); + first_free_busno =fsl_pci_init_port (&pci_info[num++], + &pcie2_hose, first_free_busno); + + }else { +printf (" PCIE2: disabled\n" ); + } +puts ("\n" );
Ditto.
Quoted 9 lines
board/freescale/p1022ds/ddr.c new file +9
-0+#else +setbits_be32 (&gur->devdisr, MPC85xx_DEVDISR_PCIE2);/* disable */ +#endif + +#ifdef CONFIG_PCIE3 + pcie_configured =is_fsl_pci_cfg (LAW_TRGT_IF_PCIE_3 , io_sel); + +if (pcie_configured && !(devdisr & MPC85xx_DEVDISR_PCIE3)) { +SET_STD_PCIE_INFO (pci_info[num],3 );
board/freescale/p1022ds/ddr.c
Quoted 10 lines
board/freescale/p1022ds/ddr.c new file +10
-0+ pcie_ep =fsl_setup_hose (&pcie3_hose, pci_info[num].regs); +printf (" PCIE3 connected to Slot 2 as %s (base addr %lx)\n" , + pcie_ep ?"Endpoint" :"Root Complex" , + pci_info[num].regs); + first_free_busno =fsl_pci_init_port (&pci_info[num++], + &pcie3_hose, first_free_busno); + }else { +printf (" PCIE3: disabled\n" ); + } +puts ("\n" );
Ditto.
Quoted 9 lines
board/freescale/p1022ds/ddr.c new file +9
-0+#else +setbits_be32 (&gur->devdisr, MPC85xx_DEVDISR_PCIE3);/* disable */ +#endif + +#ifdef CONFIG_PCIE1 + pcie_configured =is_fsl_pci_cfg (LAW_TRGT_IF_PCIE_1 , io_sel); + +if (pcie_configured && !(devdisr & MPC85xx_DEVDISR_PCIE)) { +SET_STD_PCIE_INFO (pci_info[num],1 );
board/freescale/p1022ds/ddr.c
Quoted 10 lines
board/freescale/p1022ds/ddr.c new file +10
-0+ pcie_ep =fsl_setup_hose (&pcie1_hose, pci_info[num].regs); +printf (" PCIE1 connected to Slot 1 as %s (base addr %lx)\n" , + pcie_ep ?"Endpoint" :"Root Complex" , + pci_info[num].regs); + first_free_busno =fsl_pci_init_port (&pci_info[num++], + &pcie1_hose, first_free_busno); + }else { +printf (" PCIE1: disabled\n" ); + } +puts ("\n" );
Ditto.
Hm... looks as if you were repeating the same code 3 times. Please make this a function.
Quoted 1 line
+#ifdef
CONFIG_GET_CLK_FROM_ICS307
This CONFIG_GET_CLK_FROM_ICS307 is documented?
Quoted 6 lines
board/freescale/p1022ds/ddr.c new file +6
-0+/* decode S[0-2] to Output Divider (OD) */ +static u8 ics307_S_to_OD[] = { +10 ,2 ,8 ,4 ,5 ,7 ,3 ,6 +}; + +/* Calculate frequency being generated by ICS307-02 clock chip based upon
board/freescale/p1022ds/ddr.c
Quoted 10 lines
board/freescale/p1022ds/ddr.c new file +10
-0+* the control bytes being programmed into it. */ +/* XXX: This function should probably go into a common library */ +static unsigned long ics307_clk_freq (unsigned char cw0,unsigned char cw1, +unsigned char cw2) +{ +const unsigned long InputFrequency =CONFIG_ICS307_REFCLK_HZ ; +unsigned long VDW = ((cw1 <<1 ) &0x1FE ) + ((cw2 >>7 ) &1 ); +unsigned long RDW = cw2 &0x7F ; +unsigned long OD = ics307_S_to_OD[cw0 &0x7 ]; +unsigned long freq;
Please do not use any CamelCase or UPPER CASE identifiers.
Please fix globally.
board/freescale/p1022ds/ddr.c
Quoted 9 lines
board/freescale/p1022ds/ddr.c new file +9
-0+#ifdef CONFIG_PCIE3 +ft_fsl_pci_setup (blob,"pci2" , &pcie3_hose); +#endif +#ifdef CONFIG_PCIE2 +ft_fsl_pci_setup (blob,"pci0" , &pcie2_hose); +#endif +#ifdef CONFIG_PCIE1 +ft_fsl_pci_setup (blob,"pci1" , &pcie1_hose); +#endif
Is this intentional? Looks weird to me...
PCIE1 => pci1 => pcie1_hose
PCIE2 => pci0 => pcie2_hose
PCIE3 => pci2 => pcie3_hose
Weird, weird...
board/freescale/p1022ds/ddr.c
Quoted 2 lines
+++
b/board/freescale/p1022ds/p1022ds_diu.cboard/freescale/p1022ds/ddr.c new file +0
-0@@ -0,0 +1,151 @@
This should probably go to drivers/video/ ?
Quoted 34 lines
board/freescale/p1022ds/ddr.c new file +34
-0+* Copyright 2007-2010 Freescale Semiconductor, Inc. +* Authors: York Sun <[email protected]> +* Srikanth Srinivasan <[email protected]> +* Timur Tabi <[email protected]> +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License as published by the Free +* Software Foundation; either version 2 of the License, or (at your option) +* any later version. +*/ + +#include <common.h> +#include <command.h> +#include <asm/io.h> + +#include "../common/ngpixis.h" +#include "../common/fsl_diu_fb.h" + +#if defined(CONFIG_VIDEO ) || defined(CONFIG_CFB_CONSOLE ) +#include <stdio_dev.h> +#include <video_fb.h> +#endif + +extern unsigned int FSL_Logo_BMP[]; + +static unsigned int xres, yres; + +void diu_set_pixel_clock (unsigned int pixclock) +{ +ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR; +unsigned long speed_ccb, temp, pixval; + + speed_ccb =get_bus_freq (0 ); + temp =1000000000UL / pixclock;
board/freescale/p1022ds/ddr.c line 44
Quoted 10 lines
board/freescale/p1022ds/ddr.c new file +10
-0+ temp *=1000 ; + pixval = speed_ccb / temp; +debug ("DIU pixval = %lu\n" , pixval); + +/* Modify PXCLK in GUTS CLKDVDR */ +debug ("DIU: Current value of CLKDVDR = 0x%08x\n" ,in_be32 (&gur->clkdvdr)); +clrbits_be32 (&gur->clkdvdr,0xdfff0000 );/* turn off clock */ + setbits_be32(&gur->clkdvdr, 0x80000000 | ((pixval & 0x1F) << 16)) +debug ("DIU: Modified value of CLKDVDR = 0x%08x\n" ,in_be32 (&gur->clkdvdr)); +}
Hmmm... this looks pretty much similar toboard/freescale/mpc8610hpcd/mpc8610hpcd_diu.c;
I think you should merge these two into one driver.
board/freescale/p1022ds/ddr.c line 47
Quoted 3 lines
board/freescale/p1022ds/ddr.c new file +3
-0+int p1022diu_init_show_bmp (cmd_tbl_t *cmdtp,int flag,int argc,char *argv[]) +{ +unsigned int addr;
...while doing so, please clean up to use the standard bmp command instead.
board/freescale/p1022ds/ddr.c line 53
Quoted 6 lines
board/freescale/p1022ds/ddr.c new file +6
-0+U_BOOT_CMD ( + diufb,CONFIG_SYS_MAXARGS ,1 , p1022diu_init_show_bmp, +"Init or Display BMP file" , +"init\n - initialize DIU\n" +"addr\n - display bmp at address 'addr'" +);
This should go away.
Quoted 5 lines
include/configs/P1022DS.h new file +0
-0
...
include/configs/P1022DS.h line 45
Quoted 4 lines
include/configs/P1022DS.h new file +4
-0+#ifndef __ASSEMBLY__ +extern unsigned long calculate_board_sys_clk (void ); +extern unsigned long calculate_board_ddr_clk (void ); +#endif
Please move to appropriate header file.
include/configs/P1022DS.h line 68
Quoted 8 lines
include/configs/P1022DS.h new file +8
-0+/* +* Base addresses -- Note these are effective addresses where the +* actual resources get mapped (not physical addresses) +*/ +#define CONFIG_SYS_CCSRBAR_DEFAULT 0xff700000/* CCSRBAR Default */ +#define CONFIG_SYS_CCSRBAR 0xffe00000/* relocated CCSRBAR */ +#define CONFIG_SYS_CCSRBAR_PHYS 0xfffe00000ull/* physical addr of CCSRBAR */ +#define CONFIG_SYS_IMMR CONFIG_SYS_CCSRBAR/* PQII uses CONFIG_SYS_IMMR */
Lines too long. Please fix globally.
include/configs/P1022DS.h line 81
Quoted 2 lines
include/configs/P1022DS.h new file +2
-0+/* ECC will be enabled based on perf_mode environment variable */ +//#define CONFIG_DDR_ECC
No C++ comments. Please fix globally.
include/configs/P1022DS.h line 201
Quoted 2 lines
include/configs/P1022DS.h new file +2
-0+/* video */ +/* #define CONFIG_VIDEO */
Please do not add dead code. Please fix globally.
include/configs/P1022DS.h line 452
Quoted 2 lines
include/configs/P1022DS.h new file +2
-0+#define CONFIG_BOOTDELAY 10/* -1 disables auto-boot */ +#undef CONFIG_BOOTARGS/* the boot command will set bootargs */
Do not undefine what is not defined anyway.
include/configs/P1022DS.h line 466
Quoted 11 lines
include/configs/P1022DS.h new file +11
-0+#define CONFIG_EXTRA_ENV_SETTINGS \ + "perf_mode=stable\0" \ + "memctl_intlv_ctl=2\0" \ + "netdev=eth0\0" \ + "uboot=" MK_STR(CONFIG_UBOOTPATH) "\0" \ + "tftpflash=tftpboot $loadaddr $uboot; " \ + "protect off " MK_STR(TEXT_BASE) " +$filesize; " \ + "erase " MK_STR(TEXT_BASE) " +$filesize; " \ + "cp.b $loadaddr " MK_STR(TEXT_BASE) " $filesize; " \ + "protect on " MK_STR(TEXT_BASE) " +$filesize; " \ + "cmp.b $loadaddr " MK_STR(TEXT_BASE) " $filesize\0" \
Please indent by TABs only.
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 It's hard to make a program foolproof because fools are so ingenious.
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
Quoted 15 lines · Wolfgang Denk
...
board/freescale/p1022ds/p1022ds.c line 89
Quoted 12 lines
board/freescale/p1022ds/p1022ds.c new file +12
-0+phys_size_t initdram (int board_type) +{ +phys_size_t dram_size =0 ; + +puts ("Initializing....\n" ); + + dram_size =fsl_ddr_sdram (); + dram_size =setup_ddr_tlbs (dram_size /0x100000 ); + dram_size *=0x100000 ; + +puts (" DDR: " ); +return dram_size;How about using
get_ram_size()for autosizing / testing?
Why, the board is SPD based?
- k
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
Dear Kumar Gala,
Quoted 4 lines · In message <[email protected]> you wrote:
Quoted 2 lines
How about using
get_ram_size()for autosizing / testing?Why, the board is SPD based?
Testing memory has always been an excellent idea - it's pretty useful information to know that the RAM is not only physically present, but actually working. Also, it helps to detect problems with the SPD detection code.
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 How much net work could a network work, if a network could net work?
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
In reply to Wolfgang DenkQuoted 1 line · Wolfgang Denk
Entries to MAKEALL and
MAINTAINERSmissing.
Ok.
Quoted 8 lines
Quoted 6 lines
(quoted diff) +3
-0+P1022DS_config: ? ? ? ? ? ? ?unconfig + ? ? @$(MKCONFIG) -t $(@:_config=) P1022DS powerpc mpc85xx p1022ds freescale +?P1011RDB_config ? ? ?\
?P1011RDB_NAND_config \
?P1011RDB_SDCARD_config \Please keep lists sorted / sort them.
Ok.
Quoted 8 lines
board/freescale/p1022ds/ddr.c
Quoted 6 lines
board/freescale/p1022ds/ddr.c new file +6
-0+void fsl_ddr_get_spd (ddr3_spd_eeprom_t *ctrl_dimms_spd,unsigned int ctrl_num) +{ + ? ? int ret; + + ? ? /* The P1022 has only one DDR controller, and the board has only one +? ? ? ?DIMM slot. */ Incorrect multiline comment style.
Ok.
Quoted 9 lines
...
Quoted 5 lines
+/* ranges for parameters:
+ * ?wr_data_delay = 0-6
+ * ?clk adjust = 0-8
+ * ?cpo 2-0x1E (30)
+ */Incorrect multiline comment style.
Sorry, what's wrong with this, specifically? Should it look like this:
/*
* ranges for parameters:
* wr_data_delay = 0-6 * clk adjust = 0-8 * cpo 2-0x1E (30)
*/
Please keep in mind that a lot of this code is taken from the existing p2020ds support that's already in your repository, so many of your comments are really criticisms of code that you have already accepted.
Quoted 11 lines
Quoted 10 lines
+ ? ? { ?0, 333, ? ?1, ? ?5, ?31, ? ?3, ?0},
+ ? ? {334, 400, ? ?1, ? ?5, ?31, ? ?3, ?0},
+ ? ? {401, 549, ? ?1, ? ?5, ?31, ? ?3, ?0},
+ ? ? {550, 680, ? ?1, ? ?5, ?31, ? ?5, ?0},
+ ? ? {681, 850, ? ?1, ? ?5, ?31, ? ?5, ?0},
+ ? ? { ?0, 333, ? ?2, ? ?5, ?31, ? ?3, ?0},
+ ? ? {334, 400, ? ?2, ? ?5, ?31, ? ?3, ?0},
+ ? ? {401, 549, ? ?2, ? ?5, ?31, ? ?3, ?0},
+ ? ? {550, 680, ? ?2, ? ?5, ?31, ? ?5, ?0},
+ ? ? {681, 850, ? ?2, ? ?5, ?31, ? ?5, ?0},
Quoted 1 line
Please use TABs for vertical alignment.
I thought I did.
Quoted 11 lines
Quoted 3 lines
board/freescale/p1022ds/ddr.c new file +3
-0+void fsl_ddr_board_options (memctl_options_t *popts,dimm_params_t *pdimm, + ? ? ? ? ? ? ? ? ? ? ? ?unsigned int ctrl_num) +{...
board/freescale/p1022ds/Makefile
Quoted 5 lines
+ ? ? /* Per AN4039, enable ZQ calibration. */
+ ? ?popts->zq_en= 1;board/freescale/p1022ds/Makefile new file +3
-0+ + + ? ? /*Drop one of these empty lines, please.
Ok. I don't know how that got in there.
Quoted 11 lines
Review
Quoted 8 lines
(quoted diff) +7
-0+int board_early_init_f(void) +{ + ? ? ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR; + + ? ? /* Set pmuxcr to allow both i2c1 and i2c2 */ + ? ? setbits_be32(&gur->pmuxcr, 0x1000); + ? ? in_be32(&gur->pmuxcr);What is this
in_be32()needed for? Either add a comment why it's needed, or remove it.
Ok. It's for serializing the I/O. The PIXIS won't complete the read until after the write is finished.
Quoted 6 lines
Quoted 6 lines
board/freescale/p1022ds/p1022ds.c new file +6
-0+phys_size_t initdram (int board_type) +{ + ? ? phys_size_t dram_size = 0; + + ? ? puts("Initializing....\n"); +
Quoted 8 lines
Quoted 6 lines
+ ? ?
dram_size=fsl_ddr_sdram();
+ ? ?dram_size=setup_ddr_tlbs(dram_size / 0x100000);
+ ? ?dram_size*=0x100000;
+
+ ? ?puts(" ? ?DDR: ");
+ ? ? returndram_size;How about using
get_ram_size()for autosizing / testing?
That's what fsl_ddr_sdram() does. It returns the size based on SPD.
Quoted 4 lines
Quoted 2 lines
+ ? ? /* ?Enable the TFP410 Encoder (I2C address
0x38)
+ ? ? */Please use a symbolic name instead of the hard-wired constant.
Ok.
Quoted 16 lines
Quoted 16 lines
(quoted diff) +16
-0+void pci_init_board(void) +{ + ? ? volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); + ? ? struct fsl_pci_info pci_info[3]; + ? ? u32 devdisr, pordevsr, io_sel; + ? ? int first_free_busno = 0; + ? ? int num = 0; + + ? ? int pcie_ep, pcie_configured; + + ? ? devdisr = in_be32(&gur->devdisr); + ? ? pordevsr = in_be32(&gur->pordevsr); + ? ? io_sel = (pordevsr & MPC85xx_PORDEVSR_IO_SEL) >> 18; + + ? ? debug (" ? pci_init_board: devdisr=%x, io_sel=%x\n", devdisr, io_sel); +
Quoted 8 lines
Quoted 6 lines
+ ? ? if (!(pordevsr &
MPC85xx_PORDEVSR_SGMII2_DIS))
+ ? ? ? ? ? ?printf(" ? ?eTSEC2 is in sgmii mode.\n");
+ ? ? if (!(pordevsr &MPC85xx_PORDEVSR_SGMII3_DIS))
+ ? ? ? ? ? ?printf(" ? ?eTSEC3 is in sgmii mode.\n"); +
+ ? ?puts("\n");Drop that.
This code is identical to the code in the p2020ds.c, so I'm just mirroring it. The only difference is the names of the slots in the printf. I would prefer to keep this new code as close as possible to our existing code. I suspect that we'll be unifying the PCI code in the future, and keeping it similar will make it easier.
Quoted 19 lines
Quoted 5 lines
(quoted diff) +5
-0+#ifdef CONFIG_PCIE1 + ? ? pcie_configured = is_fsl_pci_cfg(LAW_TRGT_IF_PCIE_1, io_sel); + + ? ? if (pcie_configured && !(devdisr & MPC85xx_DEVDISR_PCIE)) { + ? ? ? ? ? ? SET_STD_PCIE_INFO(pci_info[num], 1);Review
Quoted 10 lines
(quoted diff) +10
-0+ ? ? ? ? ? ? pcie_ep = fsl_setup_hose(&pcie1_hose, pci_info[num].regs); + ? ? ? ? ? ? printf(" ? ?PCIE1 connected to Slot 1 as %s (base addr %lx)\n", + ? ? ? ? ? ? ? ? ? ? ? ? ? ? pcie_ep ? "Endpoint" : "Root Complex", + ? ? ? ? ? ? ? ? ? ? ? ? ? ? pci_info[num].regs); + ? ? ? ? ? ? first_free_busno = fsl_pci_init_port(&pci_info[num++], + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? &pcie1_hose, first_free_busno); + ? ? } else { + ? ? ? ? ? ? printf(" ? ?PCIE1: disabled\n"); + ? ? } + ? ? puts("\n");Ditto.
Quoted 2 lines
Hm... looks as if you were repeating the same code 3 times. Please make this a function.
The code isn't really the same. I would need to pass a lot of parameters to this function: the hose, the devdisr mask, the slot name, the slot number, the bus number, and so on.
Quoted 3 lines
Quoted 1 line
+#ifdef
CONFIG_GET_CLK_FROM_ICS307This
CONFIG_GET_CLK_FROM_ICS307is documented?
We've been using it for years. Now you complain? It's the same code in almost all of our recent boards.
Quoted 10 lines
Review
Quoted 8 lines
(quoted diff) +8
-0+static unsigned long ics307_clk_freq(unsigned char cw0, unsigned char cw1, + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?unsigned char cw2) +{ + ? ? const unsigned long InputFrequency = CONFIG_ICS307_REFCLK_HZ; + ? ? unsigned long VDW = ((cw1 << 1) & 0x1FE) + ((cw2 >> 7) & 1); + ? ? unsigned long RDW = cw2 & 0x7F; + ? ? unsigned long OD = ics307_S_to_OD[cw0 & 0x7]; + ? ? unsigned long freq;Please do not use any CamelCase or UPPER CASE identifiers.
Again, this is the same code as always. You've accepted this code a dozen times over. Why are you picking on me about it now?
Quoted 12 lines
board/freescale/p1022ds/p1022ds.c line 217
Quoted 9 lines
board/freescale/p1022ds/p1022ds.c new file +9
-0+#ifdef CONFIG_PCIE3 + ? ? ft_fsl_pci_setup(blob, "pci2", &pcie3_hose); +#endif +#ifdef CONFIG_PCIE2 + ? ? ft_fsl_pci_setup(blob, "pci0", &pcie2_hose); +#endif +#ifdef CONFIG_PCIE1 + ? ? ft_fsl_pci_setup(blob, "pci1", &pcie1_hose); +#endif Is this intentional? Looks weird to me...
Quoted 5 lines
PCIE1 => pci1 =>
pcie1_hose
PCIE2 => pci0 =>pcie2_hose
PCIE3 => pci2 =>pcie3_hoseWeird, weird...
I asked Kumar about it, but he didn't really have much to say, so I left it.
Quoted 4 lines
Review
Quoted 2 lines
+++
b/board/freescale/p1022ds/p1022ds_diu.c(quoted diff) +0
-0@@ -0,0 +1,151 @@This should probably go to
drivers/video/?
It's p1022-specific, so I don't see why.
Quoted 4 lines
Hmmm... this looks pretty much similar to
board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c;I think you should merge these two into one driver.
And one day I will. But not today. It's going to take me a long time to analyze both code and test it on both boards. I can't solve every problem at once.
Quoted 7 lines
board/freescale/p1022ds/p1022ds_diu.c
Quoted 4 lines
board/freescale/p1022ds/p1022ds_diu.c new file +3
-0+int p1022diu_init_show_bmp (cmd_tbl_t *cmdtp,int flag,int argc,char *argv[]) +{ + ? ? unsigned int addr;...while doing so, please clean up to use the standard bmp command instead.
I didn't know there was a standard bmp command.
Quoted 8 lines
Review line 9
Quoted 6 lines
(quoted diff) +6
-0+U_BOOT_CMD( + ? ? diufb, CONFIG_SYS_MAXARGS, 1, p1022diu_init_show_bmp, + ? ? "Init or Display BMP file", + ? ? "init\n ? ?- initialize DIU\n" + ? ? "addr\n ? ?- display bmp at address 'addr'" +);This should go away.
What's wrong with it?
Quoted 6 lines
Quoted 5 lines
include/configs/P1022DS.h new file +0
-0...
Quoted 6 lines
include/configs/P1022DS.h line 45
Quoted 4 lines
include/configs/P1022DS.h new file +4
-0+#ifndef __ASSEMBLY__ +extern unsigned long calculate_board_sys_clk (void ); +extern unsigned long calculate_board_ddr_clk (void ); +#endif Please move to appropriate header file.
OMG, every single one of our header files does this!!!! We've been doing this for years!
I really do believe you're picking on me now.
Quoted 11 lines
include/configs/P1022DS.h
Quoted 9 lines
include/configs/P1022DS.h new file +8
-0+/* +* Base addresses -- Note these are effective addresses where the +* actual resources get mapped (not physical addresses) +*/ +#define CONFIG_SYS_CCSRBAR_DEFAULT ? 0xff700000 ? ? ?/* CCSRBAR Default */ +#define CONFIG_SYS_CCSRBAR ? ? ? ? ? 0xffe00000 ? ? ?/* relocated CCSRBAR */ +#define CONFIG_SYS_CCSRBAR_PHYS ? ? ? ? ? ? ?0xfffe00000ull ?/* physical addr of CCSRBAR */ +#define CONFIG_SYS_IMMR ? ? ? ? ? ? ? ? ? ? ?CONFIG_SYS_CCSRBAR ? ? ?/* PQII uses CONFIG_SYS_IMMR */ Lines too long. Please fix globally.
Ok.
Quoted 5 lines
include/configs/P1022DS.h
Quoted 3 lines
include/configs/P1022DS.h new file +2
-0+/* ECC will be enabled based on perf_mode environment variable */ +//#define ? ?CONFIG_DDR_ECC No C++ comments. Please fix globally.
Oops, I forgot to delete that one.
Quoted 4 lines
include/configs/P1022DS.h line 201
Quoted 2 lines
include/configs/P1022DS.h new file +2
-0+/* video */ +/* #define CONFIG_VIDEO */ Please do not add dead code. Please fix globally.
Ok.
Quoted 5 lines
include/configs/P1022DS.h
Quoted 3 lines
include/configs/P1022DS.h new file +2
-0+#define CONFIG_BOOTDELAY 10 ?/* -1 disables auto-boot */ +#undef ?CONFIG_BOOTARGS ? ? ? ? ? ? ?/* the boot command will set bootargs */ Do not undefine what is not defined anyway.
Sorry, I don't know how that got in there. My eyes saw #define and not #undef.
Signature · 2 lines
Timur Tabi Linux kernel developer at Freescale
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
Dear Timur Tabi,
In message <[email protected]> you wrote:
...
Quoted 8 lines
Quoted 7 lines
Quoted 5 lines
+/* ranges for parameters:
+ * =A0wr_data_delay =3D 0-6
+ * =A0clk adjust =3D 0-8
+ * =A0cpo 2-0x1E (30)
+ */Incorrect multiline comment style.
Quoted 8 lines
Sorry, what's wrong with this, specifically? Should it look like this:
/*
* ranges for parameters:* wr_data_delay =3D 0-6 * clk adjust =3D 0-8 * cpo 2-0x1E (30)*/
Yes,indeed. Please see the Coding Style document in case of further questions.
Quoted 3 lines
Quoted 1 line
Please use TABs for vertical alignment.
I thought I did.
You did not.
Quoted 9 lines
Quoted 6 lines
board/freescale/p1022ds/p1022ds.c line 40
Quoted 3 lines
board/freescale/p1022ds/p1022ds.c new file +3
-0+/* Set pmuxcr to allow both i2c1 and i2c2 */ +setbits_be32 (&gur->pmuxcr,0x1000 ); +in_be32 (&gur->pmuxcr);What is this
in_be32()needed for? Either add a comment why it's needed, or remove it.Ok. It's for serializing the I/O. The PIXIS won't complete the read until after the write is finished.
Please add such a comment, then.
Quoted 10 lines
Quoted 8 lines
board/freescale/p1022ds/p1022ds.c line 89
Quoted 6 lines
board/freescale/p1022ds/p1022ds.c new file +6
-0+ dram_size =fsl_ddr_sdram (); + dram_size =setup_ddr_tlbs (dram_size /0x100000 ); + dram_size *=0x100000 ; + +puts (" DDR: " ); +return dram_size;How about using
get_ram_size()for autosizing / testing?That's what
fsl_ddr_sdram()does. It returns the size based on SPD.
fsl_ddr_sdram() does NOT the same as get_ram_size(). It does not perform any actual testing, and will not detect errors in the SPD information or in the code processing it.
...
Quoted 8 lines
Quoted 8 lines
board/freescale/p1022ds/p1022ds.c line 159
Quoted 6 lines
board/freescale/p1022ds/p1022ds.c new file +6
-0+if (!(pordevsr & MPC85xx_PORDEVSR_SGMII2_DIS)) +printf (" eTSEC2 is in sgmii mode.\n" ); +if (!(pordevsr & MPC85xx_PORDEVSR_SGMII3_DIS)) +printf (" eTSEC3 is in sgmii mode.\n" ); + +puts ("\n" );Drop that.
I should have been more specific here. Hiere, at the first repetition of this code, I only meant you should drop the ``puts("\n");'' line.
Quoted 5 lines
This code is identical to the code in the
p2020ds.c, so I'm just mirroring it. The only difference is the names of the slots in the printf. I would prefer to keep this new code as close as possible to our existing code. I suspect that we'll be unifying the PCI code in the future, and keeping it similar will make it easier.
Thanks for pointing this out. so we have even more occurrences of this block of code - time has come to factor this out into a common function that is used for this board and for p2020ds as well.
Quoted 6 lines
Quoted 2 lines
Hm... looks as if you were repeating the same code 3 times. Please make this a function.
The code isn't really the same. I would need to pass a lot of parameters to this function: the hose, the devdisr mask, the slot name, the slot number, the bus number, and so on.
Actually it is not that many arguments.
In any case, there are so many occurrences of this block of code that it really should be turned into a function.
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
+#ifdef
CONFIG_GET_CLK_FROM_ICS307This
CONFIG_GET_CLK_FROM_ICS307is documented?We've been using it for years. Now you complain? It's the same code in almost all of our recent boards.
Please document it.
Quoted 4 lines
Quoted 1 line
Please do not use any CamelCase or UPPER CASE identifiers.
Again, this is the same code as always. You've accepted this code a dozen times over. Why are you picking on me about it now?
I complain about things when I see them.
Do you really expect me to review all patches submitted on this list in scrupulous detail? I skim through most of them. I read many of them more carefully. I try to review as many patches as time permits, but I never claimed 100% coverage.
Maybe this slept through in the past.
Now it got caught.
It would be nice if you also fixed all the other dozen places where such code has crept in.
Quoted 12 lines
Quoted 12 lines
board/freescale/p1022ds/p1022ds.c line 357
Quoted 9 lines
board/freescale/p1022ds/p1022ds.c new file +9
-0+#ifdef CONFIG_PCIE3 +ft_fsl_pci_setup (blob,"pci2" , &pcie3_hose); +#endif +#ifdef CONFIG_PCIE2 +ft_fsl_pci_setup (blob,"pci0" , &pcie2_hose); +#endif +#ifdef CONFIG_PCIE1 +ft_fsl_pci_setup (blob,"pci1" , &pcie1_hose); +#endif Is this intentional? Looks weird to me...
Quoted 7 lines
Quoted 5 lines
PCIE1 => pci1 =>
pcie1_hose
PCIE2 => pci0 =>pcie2_hose
PCIE3 => pci2 =>pcie3_hoseWeird, weird...
I asked Kumar about it, but he didn't really have much to say, so I left it.
You mean neither of you knows if this is correct or wrong ???
Quoted 6 lines
Quoted 4 lines
Review
Quoted 2 lines
+++
b/board/freescale/p1022ds/p1022ds_diu.c(quoted diff) +0
-0@@ -0,0 +1,151 @@This should probably go to
drivers/video/?It's p1022-specific, so I don't see why.
No, it's not. It is largely the same as mpc8610hpcd_diu.c; common video driver code belongs into drivers/video/
Quoted 8 lines
Quoted 4 lines
Hmmm... this looks pretty much similar to
board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c;I think you should merge these two into one driver.
And one day I will. But not today. It's going to take me a long time to analyze both code and test it on both boards. I can't solve every problem at once.
It's only about 200 LOC, and large parts look pretty similar. Please do not duplicate all this, instead factor our the common parts.
Quoted 8 lines
Quoted 6 lines
board/freescale/p1022ds/p1022ds_diu.c line 79
Quoted 3 lines
board/freescale/p1022ds/p1022ds_diu.c new file +3
-0+int p1022diu_init_show_bmp(cmd_tbl_t *cmdtp, int flag, int argc, char *> argv[]) +{ +unsigned int addr;...while doing so, please clean up to use the standard bmp command instead.
I didn't know there was a standard bmp command.
You know it know.
Quoted 10 lines
Quoted 8 lines
board/freescale/p1022ds/p1022ds_diu.c line 107
Quoted 6 lines
board/freescale/p1022ds/p1022ds_diu.c new file +6
-0+U_BOOT_CMD ( + diufb,CONFIG_SYS_MAXARGS ,1 , p1022diu_init_show_bmp, +"Init or Display BMP file" , +"init\n - initialize DIU\n" +"addr\n - display bmp at address 'addr'" +);This should go away.
What's wrong with it?
It's duplicating existing code ("bmp" command).
Quoted 11 lines
Quoted 6 lines
include/configs/P1022DS.h line 45
Quoted 4 lines
include/configs/P1022DS.h new file +4
-0+#ifndef __ASSEMBLY__ +extern unsigned long calculate_board_sys_clk (void ); +extern unsigned long calculate_board_ddr_clk (void ); +#endif Please move to appropriate header file.
OMG, every single one of our header files does this!!!! We've been doing this for years!
I really do believe you're picking on me now.
I'm not. I'm just reviewing a patch.
It would be great if you cleaned up the other places as well.
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 biggest difference between time and space is that you can't reuse time. - Merrick Furst
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
Quoted 3 lines · Wolfgang Denk
fsl_ddr_sdram()does NOT the same asget_ram_size(). It does not perform any actual testing, and will not detect errors in the SPD information or in the code processing it.
Ok, I'll add it.
Quoted 9 lines
Quoted 5 lines
This code is identical to the code in the
p2020ds.c, so I'm just mirroring it. The only difference is the names of the slots in the printf. I would prefer to keep this new code as close as possible to our existing code. I suspect that we'll be unifying the PCI code in the future, and keeping it similar will make it easier.Thanks for pointing this out. so we have even more occurrences of this block of code - time has come to factor this out into a common function that is used for this board and for p2020ds as well.
Kumar just posted some patches for p2020ds that changes this, so I'll incorporate those.
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
This
CONFIG_GET_CLK_FROM_ICS307is documented?We've been using it for years. Now you complain? It's the same code in almost all of our recent boards.
Please document it.
Looks like Kumar posted patches for this, too, so I'll add those as well.
Quoted 4 lines
I complain about things when I see them.
Do you really expect me to review all patches submitted on this list in scrupulous detail?
No, apparently just mine.
Quoted 2 lines
It would be nice if you also fixed all the other dozen places where such code has crept in.
Can I do one thing at a time? I agree that a lot of those could be optimized, and if you look at the git log for our stuff, you'll see we've been doing that a lot in the past year. But in general, fixes like these usually work better if the board support is already present in your repository.
Quoted 9 lines
Quoted 7 lines
Quoted 5 lines
PCIE1 => pci1 =>
pcie1_hose
PCIE2 => pci0 =>pcie2_hose
PCIE3 => pci2 =>pcie3_hoseWeird, weird...
I asked Kumar about it, but he didn't really have much to say, so I left it.
You mean neither of you knows if this is correct or wrong ???
I guess I should clarify. Kumar said it was based on the order of the addresses of the PCI devices within CCSR space, but he didn't offer any insight as to whether it should be fixed or how.
Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
Review
Quoted 2 lines
+++
b/board/freescale/p1022ds/p1022ds_diu.c(quoted diff) +0
-0@@ -0,0 +1,151 @@This should probably go to
drivers/video/?It's p1022-specific, so I don't see why.
No, it's not. It is largely the same as
mpc8610hpcd_diu.c; common video driver code belongs intodrivers/video/
Ok, will you allow me to merge those two functions into a single driver at a later time, when I have the opportunity to examine the code and test it on both boards?
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
include/configs/P1022DS.h line 45
Quoted 4 lines
include/configs/P1022DS.h new file +4
-0+#ifndef __ASSEMBLY__ +extern unsigned long calculate_board_sys_clk (void ); +extern unsigned long calculate_board_ddr_clk (void ); +#endif Please move to appropriate header file.
Quoted 8 lines
Quoted 4 lines
OMG, every single one of our header files does this!!!! We've been doing this for years!
I really do believe you're picking on me now.
I'm not. I'm just reviewing a patch.
It would be great if you cleaned up the other places as well.
Well, this particular change would probably need to be made later, because I would probably need to change all the board header files at once. It's not trivial.
Signature · 2 lines
Timur Tabi Linux kernel developer at Freescale
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
Dear Timur Tabi,
Quoted 5 lines · In message <[email protected]> you wrote:
Quoted 3 lines
Do you really expect me to review all patches submitted on this list in scrupulous detail?
No, apparently just mine.
Unless you pay me for this (or FSL) you should not even rely on this.
Quoted 7 lines
Quoted 2 lines
It would be nice if you also fixed all the other dozen places where such code has crept in.
Can I do one thing at a time? I agree that a lot of those could be optimized, and if you look at the git log for our stuff, you'll see we've been doing that a lot in the past year. But in general, fixes like these usually work better if the board support is already present in your repository.
Well, there are things and things.
When we discover that crap has piled up here and there, it's a good idea to perform a clean up.
When the first one adds some feature or new architecture or similar, it is pretty normal that he cannot yet always decide correctly what needs to go where, or which parts are specific to CPU or board and which are common. But when more boards get added, this usually becomes clear pretty quickly.
It has always been more efficient to prevent code that is known to need such cleanup to prevent from going into mainline in the first place, than to allow it to go in and hope that somebody, sometime will find time and resources and zest for a clean-up.
Is it easier for you to convince your manager that you need N more hours to get that code accepted for mainline, or to get allownce for N hours to perform some cleanup in U-Boot that is not related to your current project?
[I have somemore tasks at hand if the latter should be the case :-) ]
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
PCIE1 => pci1 =>
pcie1_hose
PCIE2 => pci0 =>pcie2_hose
PCIE3 => pci2 =>pcie3_hoseWeird, weird...
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
I asked Kumar about it, but he didn't really have much to say, so I left it.
You mean neither of you knows if this is correct or wrong ???
I guess I should clarify. Kumar said it was based on the order of the addresses of the PCI devices within CCSR space, but he didn't offer any insight as to whether it should be fixed or how.
So please check this again. It looks broken to me.
Quoted 6 lines
Quoted 2 lines
No, it's not. It is largely the same as
mpc8610hpcd_diu.c; common video driver code belongs intodrivers/video/Ok, will you allow me to merge those two functions into a single driver at a later time, when I have the opportunity to examine the code and test it on both boards?
Please let's do it now, instead of adding code that is known to need fixing. See above for my reasoning.
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
include/configs/P1022DS.h line 45
Quoted 4 lines
include/configs/P1022DS.h new file +4
-0+#ifndef __ASSEMBLY__ +extern unsigned long calculate_board_sys_clk (void ); +extern unsigned long calculate_board_ddr_clk (void ); +#endif Please move to appropriate header file.
...
Quoted 3 lines
Well, this particular change would probably need to be made later, because I would probably need to change all the board header files at once. It's not trivial.
What exactly is not trivial in moving some prototype declarations to another header file? Please elucidate. The most difficult part is probably determining where they actually belong to.
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 To program is to be.
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
Quoted 1 line · Wolfgang Denk
Unless you pay me for this (or FSL) you should not even rely on this.
Heh.
Quoted 4 lines
Well, there are things and things.
When we discover that crap has piled up here and there, it's a good idea to perform a clean up.
I agree 100%.
Quoted 5 lines
When the first one adds some feature or new architecture or similar, it is pretty normal that he cannot yet always decide correctly what needs to go where, or which parts are specific to CPU or board and which are common. But when more boards get added, this usually becomes clear pretty quickly.
Ok.
Quoted 4 lines
It has always been more efficient to prevent code that is known to need such cleanup to prevent from going into mainline in the first place, than to allow it to go in and hope that somebody, sometime will find time and resources and zest for a clean-up.
I'm not sure I agree with that completely. In many cases, it's more efficient to work on tasks in bite-size chunks.
Quoted 4 lines
Is it easier for you to convince your manager that you need N more hours to get that code accepted for mainline, or to get allownce for N hours to perform some cleanup in U-Boot that is not related to your current project?
Definitely the latter. Cleaning up U-Boot (and Linux) code so that it's overall easier to maintain and more efficient is one of the primary tasks of my department.
Quoted 1 line
[I have somemore tasks at hand if the latter should be the case :-) ]
Please, send me a list. We have an internal bug tracking system, and I would be more than happy to log all the items that concern you (as long as they affect Freescale PowerPC products in some way).
Quoted 5 lines
Quoted 3 lines
I guess I should clarify. Kumar said it was based on the order of the addresses of the PCI devices within CCSR space, but he didn't offer any insight as to whether it should be fixed or how.
So please check this again. It looks broken to me.
Ok.
Quoted 6 lines
Quoted 3 lines
Ok, will you allow me to merge those two functions into a single driver at a later time, when I have the opportunity to examine the code and test it on both boards?
Please let's do it now, instead of adding code that is known to need fixing. See above for my reasoning.
And see my above response for why I'd prefer not to solve this now.
I'll try to fix it anyway, though.
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
include/configs/P1022DS.h line 45
Quoted 4 lines
include/configs/P1022DS.h new file +4
-0+#ifndef __ASSEMBLY__ +extern unsigned long calculate_board_sys_clk (void ); +extern unsigned long calculate_board_ddr_clk (void ); +#endif Please move to appropriate header file.
Quoted 8 lines
...
Quoted 3 lines
Well, this particular change would probably need to be made later, because I would probably need to change all the board header files at once. It's not trivial.
What exactly is not trivial in moving some prototype declarations to another header file? Please elucidate. The most difficult part is probably determining where they actually belong to.
Well, I'll take a closer look, but my concern is that there is no good header file to move these into that wouldn't require modifying dozens of files. Since I'm trying to add support for one particular board, I don't want to modify every other board in the same patch set.
I'll try to fix it anyway, though.
Signature · 2 lines
Timur Tabi Linux kernel developer at Freescale
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
In reply to Wolfgang DenkQuoted 6 lines · Wolfgang Denk
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
include/configs/P1022DS.h line 45
Quoted 4 lines
include/configs/P1022DS.h new file +4
-0+#ifndef __ASSEMBLY__ +extern unsigned long calculate_board_sys_clk (void ); +extern unsigned long calculate_board_ddr_clk (void ); +#endif Please move to appropriate header file.
Quoted 8 lines
...
Quoted 3 lines
Quoted 3 lines
Well, this particular change would probably need to be made later, because I would probably need to change all the board header files at once. It's not trivial.
What exactly is not trivial in moving some prototype declarations to another header file? Please elucidate. The most difficult part is probably determining where they actually belong to.
Well, I'm having a hard time finding a good header file.
For the P1022DS, I just need to have this macros known to speed.c, so I could add these lines to the top of /arch/powerpc/cpu/mpc85xx/speed.c:
#include <common.h> #include <ppc_asm.tmpl> #include <asm/processor.h> #include <asm/io.h> /* Clock frequency */ unsigned long calculate_board_sys_clk(void); unsigned long calculate_board_ddr_clk(void); DECLARE_GLOBAL_DATA_PTR;
But I suspect this will not be sufficient for all of the other 85xx boards.
Another option is arch/powerpc/include/asm/config.h, but that header file doesn't have any function prototypes today.
There's also include/common.h, near this block:
#if defined(CONFIG_MPC85xx)
typedef MPC85xx_SYS_INFO sys_info_t;
void get_sys_info ( sys_info_t * );
ulong get_ddr_freq (ulong);
#endif
#if defined(CONFIG_MPC86xx)
typedef MPC86xx_SYS_INFO sys_info_t;
void get_sys_info ( sys_info_t * );
#endif
Suggestions?
Signature · 2 lines
Timur Tabi Linux kernel developer at Freescale
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
In reply to Wolfgang DenkQuoted 8 lines · Wolfgang Denk
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines
Quoted 2 lines
Hm... looks as if you were repeating the same code 3 times. Please make this a function.
The code isn't really the same. I would need to pass a lot of parameters to this function: the hose, the devdisr mask, the slot name, the slot number, the bus number, and so on.
Actually it is not that many arguments.
It is. Here's the prototype I came up with;
static int configure_pci(enum srds_prtcl pci,
const char *name, const char *target, int endpoint,
int first_free_busno, phys_addr_t mem_addr, enum law_size mem_size, phys_addr_t io_addr, enum law_size io_size, struct fsl_pci_info *pci_info, struct pci_controller *hose);
Are you sure you would really rather see this as its own function?
Signature · 2 lines
Timur Tabi Linux kernel developer at Freescale
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
Quoted 25 lines · Timur Tabi
Quoted 8 lines · Wolfgang Denk
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines
Quoted 2 lines
Hm... looks as if you were repeating the same code 3 times. Please make this a function.
The code isn't really the same. I would need to pass a lot of parameters to this function: the hose, the devdisr mask, the slot name, the slot number, the bus number, and so on.
Actually it is not that many arguments.
It is. Here's the prototype I came up with;
static int configure_pci(enum
srds_prtclpci,
const char *name, const char *target, int endpoint,
intfirst_free_busno,phys_addr_tmem_addr, enumlaw_sizemem_size,phys_addr_tio_addr, enumlaw_sizeio_size, structfsl_pci_info*pci_info, structpci_controller*hose);
Quoted 2 lines
Are you sure you would really rather see this as its own function?
Perhaps (most of) this information could be put in a data structure to which you point?
-Scott
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
Quoted 2 lines · Scott Wood
Perhaps (most of) this information could be put in a data structure to which you point?
That doesn't change the amount of information that needs to be passed, it only makes the prototype have fewer lines.
The point I'm trying to make is that the code in question is not the same code copy/pasted three times. Every line is different. Moving that code into a function is not going to simplify anything.
Signature · 2 lines
Timur Tabi Linux kernel developer at Freescale
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
Quoted 7 lines · Timur Tabi
Quoted 2 lines · Scott Wood
Perhaps (most of) this information could be put in a data structure to which you point?
That doesn't change the amount of information that needs to be passed, it only makes the prototype have fewer lines.
Which is relevant, given that you're whipping out a big scary-looking prototype as a reason to avoid refactoring. :-)
Quoted 4 lines
The point I'm trying to make is that the code in question is not the same code copy/pasted three times. Every line is different. Moving that code into a function is not going to simplify anything.
They are not identical lines, but they're doing the same basic thing -- making it data driven would be a proper separation of concerns.
-Scott
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
Quoted 2 lines · Scott Wood
Which is relevant, given that you're whipping out a big scary-looking prototype as a reason to avoid refactoring. :-)
So instead of this:
configure_pci(PCIE1, "PCIE1", "Slot 1", pcie_ep, num, LAW_TRGT_IF_PCIE_1, CONFIG_SYS_PCIE1_MEM_PHYS, LAW_SIZE_512M, CONFIG_SYS_PCIE1_IO_PHYS, LAW_SIZE_64K, &pci_info[num], &pcie1_hose);
You want this instead:
struct {
enum srds_prtcl pci;
const char *name;
const char *target;
int endpoint;
int first_free_busno;
enum law_trgt_if law;
phys_addr_t mem_addr;
enum law_size mem_size;
phys_addr_t io_addr;
enum law_size io_size;
struct fsl_pci_info *pci_info;
struct pci_controller *hose;
} x;x.pci = PCIE1;
x.name = "PCIE1";
x.target = "Slot 1";
x.endpoint =- pcie_ep;
x.first_free_busno = num;
x.law = LAW_TRGT_IF_PCIE_1;
x.mem_addr = CONFIG_SYS_PCIE1_MEM_PHYS;
x.mem_size = LAW_SIZE_512M;
x.io_addr = CONFIG_SYS_PCIE1_IO_PHYS;
x.io_size = LAW_SIZE_64K;
x.pci_info = &pci_info[num];
x.hose = &pcie1_hose;
configure_pci(&x);
I don't see how this is an improvement.
Signature · 2 lines
Timur Tabi Linux kernel developer at Freescale
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
Quoted 41 lines · Timur Tabi
Quoted 2 lines · Scott Wood
Which is relevant, given that you're whipping out a big scary-looking prototype as a reason to avoid refactoring. :-)
So instead of this:
configure_pci(PCIE1, "PCIE1", "Slot 1",
pcie_ep, num,LAW_TRGT_IF_PCIE_1,CONFIG_SYS_PCIE1_MEM_PHYS,LAW_SIZE_512M,CONFIG_SYS_PCIE1_IO_PHYS, LAW_SIZE_64K,&pci_info[num],&pcie1_hose);You want this instead:
struct { enum srds_prtcl pci; const char *name; const char *target; int endpoint; int first_free_busno; enum law_trgt_if law; phys_addr_t mem_addr; enum law_size mem_size; phys_addr_t io_addr; enum law_size io_size; struct fsl_pci_info *pci_info; struct pci_controller *hose; } x;x.pci = PCIE1;
x.name = "PCIE1";
x.target = "Slot 1";
x.endpoint =-pcie_ep;
x.first_free_busno = num;
x.law =LAW_TRGT_IF_PCIE_1;
x.mem_addr =CONFIG_SYS_PCIE1_MEM_PHYS;
x.mem_size =LAW_SIZE_512M;
x.io_addr =CONFIG_SYS_PCIE1_IO_PHYS;
x.io_size =LAW_SIZE_64K;
x.pci_info =&pci_info[num];
x.hose =&pcie1_hose;
Quoted 3 lines
configure_pci(&x);I don't see how this is an improvement.
Much of that struct could be defined statically, with the board or soc file providing an array of PCI info structs. Look at how the 83xx PCI code does it -- you'll need more than just the generic u-boot pci_region struct, though you could have it as a member of the hw-specific struct.
A few of those things don't belong there -- I think first_free_busno should be a static variable inside the pci setup function, for example (does Linux still even need separate bus number spaces on different hoses?). pcie_ep should just be a local variable. The hose could maybe just be an uninitialized member of the struct instead of a pointer to an arbitrary other symbol.
-Scott
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
Quoted 6 lines · Scott Wood
A few of those things don't belong there -- I think
first_free_busnoshould be a static variable inside the pci setup function, for example (does Linux still even need separate bus number spaces on different hoses?).pcie_epshould just be a local variable. The hose could maybe just be an uninitialized member of the struct instead of a pointer to an arbitrary other symbol.
I'm not sure what you mean about the 'hose'. How about this:
static void configure_pcie(enum srds_prtcl pci,
u32 devdisr_mask, const char *target, enum law_trgt_if law, phys_addr_t mem_addr, enum law_size mem_size, phys_addr_t io_addr, enum law_size io_size, struct pci_controller *hose)
{
volatile ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
struct fsl_pci_info pci_info;
u32 devdisr;
static int first_free_busno = 0;
int is_endpoint;
int num;
devdisr = in_be32(&gur->devdisr);
if (is_serdes_configured(pci) && !(devdisr & devdisr_mask)) {
set_next_law(mem_addr, mem_size, law);
set_next_law(io_addr, io_size, law);
switch (pci) {
#ifdef CONFIG_PCIE1
case PCIE1:
num = 1;
SET_STD_PCIE_INFO(pci_info, 1);
break;
#endif
#ifdef CONFIG_PCIE2
case PCIE2:
num = 2;
SET_STD_PCIE_INFO(pci_info, 2);
break;
#endif
#ifdef CONFIG_PCIE3
case PCIE3:
num = 3;
SET_STD_PCIE_INFO(pci_info, 3);
break;
#endif
#ifdef CONFIG_PCIE4
case PCIE4:
num = 4;
SET_STD_PCIE_INFO(pci_info, 4);
break;
#endif
default:
break;
}
is_endpoint = fsl_setup_hose(hose, pci_info.regs);
printf(" PCIE%u: connected to %s as %s (base addr %lx)\n",
num, target, is_endpoint ? "Endpoint" : "Root Complex",
pci_info.regs);
first_free_busno = fsl_pci_init_port(&pci_info, hose, first_free_busno);
} else {
printf(" PCIE%u: disabled\n", num);
}
}Signature · 2 lines
Timur Tabi Linux kernel developer at Freescale
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
In reply to Wolfgang DenkQuoted 4 lines · Wolfgang Denk
Quoted 4 lines
board/freescale/p1022ds/ddr.c new file +4
-0+ { 0, 333, 1, 5, 31, 3, 0}, + {334, 400, 1, 5, 31, 3, 0}, + {401, 549, 1, 5, 31, 3, 0}, + {550, 680, 1, 5, 31, 5, 0},
Quoted 8 lines
board/freescale/p1022ds/ddr.c line 66
Quoted 6 lines
board/freescale/p1022ds/ddr.c new file +6
-0+ {681, 850, 1, 5, 31, 5, 0}, + { 0, 333, 2, 5, 31, 3, 0}, + {334, 400, 2, 5, 31, 3, 0}, + {401, 549, 2, 5, 31, 3, 0}, + {550, 680, 2, 5, 31, 5, 0}, + {681, 850, 2, 5, 31, 5, 0},Please use TABs for vertical alignment.
Ok, I understand now what you mean. However, the columns are right-justified. You can't use tabs to align right-justified columns.
Quoted 6 lines
Quoted 6 lines
board/freescale/p1022ds/p1022ds.c new file +6
-0+phys_size_t initdram (int board_type) +{ +phys_size_t dram_size =0 ; + +puts ("Initializing....\n" ); +
Quoted 8 lines
board/freescale/p1022ds/p1022ds.c line 89
Quoted 6 lines
board/freescale/p1022ds/p1022ds.c new file +6
-0+ dram_size =fsl_ddr_sdram (); + dram_size =setup_ddr_tlbs (dram_size /0x100000 ); + dram_size *=0x100000 ; + +puts (" DDR: " ); +return dram_size;How about using
get_ram_size()for autosizing / testing?
It appears get_ram_size() has never been used on PowerPC before. This
function writes data to memory in blocks and reads it back. In my experience, attempting to access memory that doesn't exist will generate a machine check and cause U-Boot to hang.
In addition, we only create a TLB to map the lower 2GB, no matter how much memory is in the system. But the initdram() function returns the full size of RAM, no matter how big it is. So won't get_ram_size() always fail if I have more than 2GB of RAM?
Signature · 2 lines
Timur Tabi Linux kernel developer at Freescale
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
Dear Timur Tabi,
Quoted 14 lines · In message <[email protected]> you wrote:
Quoted 13 lines
board/freescale/p1022ds/ddr.c line 66
Quoted 11 lines
board/freescale/p1022ds/ddr.c new file +10
-0+ { 0, 333, 1, 5, 31, 3, 0}, + {334, 400, 1, 5, 31, 3, 0}, + {401, 549, 1, 5, 31, 3, 0}, + {550, 680, 1, 5, 31, 5, 0}, + {681, 850, 1, 5, 31, 5, 0}, + { 0, 333, 2, 5, 31, 3, 0}, + {334, 400, 2, 5, 31, 3, 0}, + {401, 549, 2, 5, 31, 3, 0}, + {550, 680, 2, 5, 31, 5, 0}, + {681, 850, 2, 5, 31, 5, 0},Please use TABs for vertical alignment.
Quoted 2 lines
Ok, I understand now what you mean. However, the columns are right-justified. You can't use tabs to align right-justified columns.
There is exactly two entries in that table where it would make any difference, and if that's really that important to you, adding two spaces after the TAB would work wonders.
Quoted 3 lines
Quoted 1 line
How about using
get_ram_size()for autosizing / testing?It appears
get_ram_size()has never been used on PowerPC before. This
It appears you really haven't bothered checking. We have been using it on PowerPC since day 1 - for well over 10 years by now. On many, many systems. Get a clue!
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 Making files is easy under the UNIX operating system. Therefore, users tend to create numerous files using large amounts of file space. It has been said that the only standard thing about all UNIX systems is the message-of-the-day telling users to clean up their files. -- System V.2 administrator's guide
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
Quoted 3 lines · Wolfgang Denk
There is exactly two entries in that table where it would make any difference, and if that's really that important to you, adding two spaces after the TAB would work wonders.
The column headers would be unaligned:
static const board_specific_parameters_t bsp[] = { /*
* memory controller 0
* lo| hi| num| clk| cpo|wrdata|2T
* mhz| mhz|ranks|adjst| | delay|
*/
{ 0, 333, 1, 5, 31, 3, 0},
{334, 400, 1, 5, 31, 3, 0},
{401, 549, 1, 5, 31, 3, 0},
{550, 680, 1, 5, 31, 5, 0},
{681, 850, 1, 5, 31, 5, 0},
{ 0, 333, 2, 5, 31, 3, 0},
{334, 400, 2, 5, 31, 3, 0},
{401, 549, 2, 5, 31, 3, 0},
{550, 680, 2, 5, 31, 5, 0},
{681, 850, 2, 5, 31, 5, 0},};
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
How about using
get_ram_size()for autosizing / testing?It appears
get_ram_size()has never been used on PowerPC before. ThisIt appears you really haven't bothered checking. We have been using it on PowerPC since day 1 - for well over 10 years by now. On many, many systems. Get a clue!
Sorry, I must have used grep wrong or something. I see what you're talking about now.
Signature · 2 lines
Timur Tabi Linux kernel developer at Freescale
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
In reply to Wolfgang DenkQuoted 3 lines · Wolfgang Denk
It appears you really haven't bothered checking. We have been using it on PowerPC since day 1 - for well over 10 years by now. On many, many systems. Get a clue!
I've looked at get_ram_size(), and I don't think I can use it.
We use phys_addr_t to represent DDR sizes, which is a 64-bit integer on the P1022DS. get_ram_size() takes a 'long' and returns a 'long', so it's not capable of handling the amount of memory that we support on the board.
I can use get_ram_size() to test the lower 2GB of DDR, but I can't use it to verify the amount of RAM in the system.
Signature · 2 lines
Timur Tabi Linux kernel developer at Freescale
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
Dear Timur Tabi,
Quoted 6 lines · In message <[email protected]> you wrote:
Quoted 3 lines · Wolfgang Denk
It appears you really haven't bothered checking. We have been using it on PowerPC since day 1 - for well over 10 years by now. On many, many systems. Get a clue!
I've looked at
get_ram_size(), and I don't think I can use it.
Then fix it, please.
Quoted 6 lines
We use
phys_addr_tto represent DDR sizes, which is a 64-bit integer on the P1022DS.get_ram_size()takes a 'long' and returns a 'long', so it's not capable of handling the amount of memory that we support on the board.I can use
get_ram_size()to test the lower 2GB of DDR, but I can't use it to verify the amount of RAM in the system.
Do you really have > 4 GB RAM on this board?
If this turns out to be a real problem, we have to fix get_ram_size to handle bigger memory sizes as well. I guess this will needed for more and more systems.
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 something is different, it's either better or worse, and usually both. - Larry Wall
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
Quoted 3 lines · Wolfgang Denk
Quoted 1 line
I've looked at
get_ram_size(), and I don't think I can use it.Then fix it, please.
Let me guess, you won't accept my patch until I fix get_ram_size() first and use it, right?
Quoted 8 lines
Quoted 6 lines
We use
phys_addr_tto represent DDR sizes, which is a 64-bit integer on the P1022DS.get_ram_size()takes a 'long' and returns a 'long', so it's not capable of handling the amount of memory that we support on the board.I can use
get_ram_size()to test the lower 2GB of DDR, but I can't use it to verify the amount of RAM in the system.Do you really have > 4 GB RAM on this board?
Actually, anything more than 2GB would cause the problem, since the maximum value of a long is 2GB. On this particular board, there is only 2GB, but all of our new boards are expected to support more than 4GB of RAM.
Quoted 3 lines
If this turns out to be a real problem, we have to fix
get_ram_sizeto handle bigger memory sizes as well. I guess this will needed for more and more systems.
Yes.
Signature · 2 lines
Timur Tabi Linux kernel developer at Freescale
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
Dear Timur Tabi,
Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 4 lines
Quoted 2 lines
I've looked at
get_ram_size(), and I don't think I can use it.Then fix it, please.
Let me guess, you won't accept my patch until I fix
get_ram_size()first and use it, right?
Do you think this is an unreasonable request? A quick fix takes me less than it takes to write this email (see following patch).
Quoted 5 lines
Quoted 1 line
Do you really have > 4 GB RAM on this board?
Actually, anything more than 2GB would cause the problem, since the maximum value of a long is 2GB. On this particular board, there is only 2GB, but all of our new boards are expected to support more than 4GB of RAM.
All the more reasons to fix this.
Quoted 5 lines
Quoted 3 lines
If this turns out to be a real problem, we have to fix
get_ram_sizeto handle bigger memory sizes as well. I guess this will needed for more and more systems.Yes.
Well, didn't you say you were looking for a list of task to imrpove U-Boot for your boards?
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 Gods don't like people not doing much work. People who aren't busy all the time might start to _think_. - Terry Pratchett, _Small Gods_
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
Quoted 2 lines · Wolfgang Denk
Do you think this is an unreasonable request? A quick fix takes me less than it takes to write this email (see following patch).
Fixing get_ram_size() is not a quick fix. We would need to implement a temporary TLB mechanism for accessing memory above 2GB, and a machine check handler for handling memory access to non-existent RAM.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
If this turns out to be a real problem, we have to fix
get_ram_sizeto handle bigger memory sizes as well. I guess this will needed for more and more systems.Yes.
Well, didn't you say you were looking for a list of task to imrpove U-Boot for your boards?
True. But I also want to get real work done in a timely manner. It's taking a lot longer than I expected to get support for this board approved.
Signature · 2 lines
Timur Tabi Linux kernel developer at Freescale
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
Quoted 8 lines · Timur Tabi
Quoted 2 lines · Wolfgang Denk
Do you think this is an unreasonable request? A quick fix takes me less than it takes to write this email (see following patch).
Fixing
get_ram_size()is not a quick fix. We would need to implement a temporary TLB mechanism for accessing memory above 2GB, and a machine check handler for handling memory access to non-existent RAM.
Passing the actual, known size of RAM (why guess when we know?) as "maxsize" should eliminate the machine check problem[1] -- you'd just be using it as a not particularly exhaustive memory tester. I don't see why it should be mandatory.
It also doesn't handle non-power-of-two sized memory -- don't rely on the value it returns.
-Scott
[1] It's worse than machine checks, what if some I/O device is mapped directly after RAM? IIRC people have run into this sort of problem doing this type of memory sizing on PCs.
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
Quoted 4 lines · Scott Wood
Passing the actual, known size of RAM (why guess when we know?) as "maxsize" should eliminate the machine check problem[1] -- you'd just be using it as a not particularly exhaustive memory tester. I don't see why it should be mandatory.
The purpose of get_ram_size() is to verify the "known size of RAM". That is, once you think you know how much RAM there is, you ask get_ram_size() to verify that claim. The return value is the true, validated amount of RAM.
Quoted 2 lines
It also doesn't handle non-power-of-two sized memory -- don't rely on the value it returns.
Ah, that's a serious limitation.
Signature · 2 lines
Timur Tabi Linux kernel developer at Freescale
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
Quoted 10 lines · Timur Tabi
Quoted 4 lines · Scott Wood
Passing the actual, known size of RAM (why guess when we know?) as "maxsize" should eliminate the machine check problem[1] -- you'd just be using it as a not particularly exhaustive memory tester. I don't see why it should be mandatory.
The purpose of
get_ram_size()is to verify the "known size of RAM". That is, once you think you know how much RAM there is, you askget_ram_size()to verify that claim.
It would still (sort of) verify that you don't have less than you claim.
Attempting to experimentally determine whether you have more than you
claim is dangerous.
-Scott
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
Dear Scott Wood,
Quoted 3 lines · In message <[email protected]> you wrote:
Attempting to experimentally determine whether you have more than you
claim is dangerous.
It's not. Actually it allows to detect certain classes of errors.
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 modem is a baudy house.
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
In reply to Timur TabiDear Timur Tabi,
Quoted 5 lines · In message <[email protected]> you wrote:
Quoted 3 lines
It also doesn't handle non-power-of-two sized memory -- don't rely on the value it returns.
Ah, that's a serious limitation.
No, it is not. Testing is done per bank.
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 was playing poker the other night... with Tarot cards. I got a full house and 4 people died. - Steven Wright
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
Quoted 3 lines · Wolfgang Denk
Quoted 1 line
Ah, that's a serious limitation.
No, it is not. Testing is done per bank.
Ok, I get it now. I'm supposed to call get_ram_size() on each DIMM I locate. That's going to be complicated because we don't have any TLBs set up when we do that.
And what if we have a 4GB DIMM? Because virtual addresses are still 32-bits, we would need to change get_ram_size() to modify a temporary TLB while it's reading/writing memory. So we'd need to have an e300 version of get_ram_size(), an e500 version, an e600 version, and so on.
So I have a question: are you still going to require me to use get_ram_size() in my P1022DS board patch?
Signature · 2 lines
Timur Tabi Linux kernel developer at Freescale
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
Dear Timur Tabi,
Quoted 3 lines · In message <[email protected]> you wrote:
So I have a question: are you still going to require me to use
get_ram_size()in my P1022DS board patch?
I never *reqired* this.
All I wrote was:
| > + puts(" DDR: ");
| > + return dram_size;
|
| How about using get_ram_size() for autosizing / testing?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 It may be that your whole purpose in life is simply to serve as a warning to others.
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
In reply to Scott WoodDear Scott Wood,
Quoted 5 lines · In message <[email protected]> you wrote:
Passing the actual, known size of RAM (why guess when we know?) as "maxsize" should eliminate the machine check problem[1] -- you'd just be using it as a not particularly exhaustive memory tester. I don't see why it should be mandatory.
Typically we chose "maxsize" to b twice the actual possible maximum to allow for real testing.
Quoted 2 lines
It also doesn't handle non-power-of-two sized memory -- don't rely on the value it returns.
Such configurations are usually set up of from several differently sized banks of memory, and get_ram_size() is always run per bank. So as long as chip manufacturers continue to make RAM chips with power-of-two sizes only, everything should be fine.
Quoted 3 lines
[1] It's worse than machine checks, what if some I/O device is mapped directly after RAM? IIRC people have run into this sort of problem doing this type of memory sizing on PCs.
Well, let's call this a bug in setting up the memory map for the system ;-)
Best regards,
Wolfgang Denk
Signature · 6 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 When you say "I wrote a program that crashed Windows", people just stare at you blankly and say "Hey, I got those with the system, *for free*". - Linus Torvalds in <[email protected]>
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
Quoted 7 lines · Wolfgang Denk
Quoted 2 lines
It also doesn't handle non-power-of-two sized memory -- don't rely on the value it returns.
Such configurations are usually set up of from several differently sized banks of memory, and
get_ram_size()is always run per bank. So as long as chip manufacturers continue to make RAM chips with power-of-two sizes only, everything should be fine.
What if the board has two DIMM slots, one of which has a 1GB DIMM and the other has a 512MB DIMM?
Quoted 6 lines
Quoted 3 lines
[1] It's worse than machine checks, what if some I/O device is mapped directly after RAM? IIRC people have run into this sort of problem doing this type of memory sizing on PCs.
Well, let's call this a bug in setting up the memory map for the system ;-)
I thought get_ram_size() was supposed to safely determine how much RAM is actually in the system? Otherwise, it should be called verify_ram_size().
Signature · 2 lines
Timur Tabi Linux kernel developer at Freescale
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
Dear Timur Tabi,
Quoted 8 lines · In message <[email protected]> you wrote:
Quoted 5 lines
Such configurations are usually set up of from several differently sized banks of memory, and
get_ram_size()is always run per bank. So as long as chip manufacturers continue to make RAM chips with power-of-two sizes only, everything should be fine.What if the board has two DIMM slots, one of which has a 1GB DIMM and the other has a 512MB DIMM?
Then you run get_ram_size() twice, and it will find 1 GiB and 512 MiB of memory - what's the problem?
Quoted 2 lines
I thought
get_ram_size()was supposed to safely determine how much RAM is actually in the system? Otherwise, it should be calledverify_ram_size().
Indeed it is intended to determine tha actual RAM size - and does so fine in dozens of board configurations.
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 "Why waste negative entropy on comments, when you could use the same entropy to create bugs instead?" - Steve Elias
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
In reply to Wolfgang DenkQuoted 11 lines · Wolfgang Denk
Dear Scott Wood,
Quoted 5 lines · In message<[email protected]> you wrote:
Passing the actual, known size of RAM (why guess when we know?) as "maxsize" should eliminate the machine check problem[1] -- you'd just be using it as a not particularly exhaustive memory tester. I don't see why it should be mandatory.
Typically we chose "maxsize" to b twice the actual possible maximum to allow for real testing.
If you set maxsize beyond what you expect to find, how are you going to constrain it to operating on one bank?
Quoted 7 lines
Quoted 2 lines
It also doesn't handle non-power-of-two sized memory -- don't rely on the value it returns.
Such configurations are usually set up of from several differently sized banks of memory, and
get_ram_size()is always run per bank. So as long as chip manufacturers continue to make RAM chips with power-of-two sizes only, everything should be fine.
So it's not the board code at all that should be calling this, it's the SDRAM code? Which is already in u-boot, and not in this patch (other than some board-specific tweaks)?
Quoted 6 lines
Quoted 3 lines
[1] It's worse than machine checks, what if some I/O device is mapped directly after RAM? IIRC people have run into this sort of problem doing this type of memory sizing on PCs.
Well, let's call this a bug in setting up the memory map for the system ;-)
Let's not. It can be crowded enough as is, we don't need more restrictions coming from u-boot wanting to do questionable and unnecessary things.
-Scott
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
Dear Scott Wood,
Quoted 3 lines · In message <[email protected]> you wrote:
If you set maxsize beyond what you expect to find, how are you going to constrain it to operating on one bank?
Maybe it helps if you read section "System Initialization" in teh README; this explains the original design when I implemented this a decade ago.
Quoted 8 lines
Quoted 4 lines
Such configurations are usually set up of from several differently sized banks of memory, and
get_ram_size()is always run per bank. So as long as chip manufacturers continue to make RAM chips with power-of-two sizes only, everything should be fine.So it's not the board code at all that should be calling this, it's the SDRAM code? Which is already in u-boot, and not in this patch (other than some board-specific tweaks)?
I don't know where you initialize the RAM.
Quoted 3 lines
Let's not. It can be crowded enough as is, we don't need more restrictions coming from u-boot wanting to do questionable and unnecessary things.
Well, what seems unnecessary to you is actually pretty important to others.
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 I realize that command does have its fascination, even under circum- stances such as these, but I neither enjoy the idea of command nor am I frightened of it. It simply exists, and I will do whatever logi- cally needs to be done. -- Spock, "The Galileo Seven", stardate 2812.7
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
In reply to Timur TabiDear Timur Tabi,
Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 3 lines
Do you think this is an unreasonable request? A quick fix takes me less than it takes to write this email (see following patch).
Fixing
get_ram_size()is not a quick fix. We would need to implement a temporary TLB mechanism for accessing memory above 2GB, and a machine check handler for handling memory access to non-existent RAM.
We don't have machine check handlers on the other PPC systems either. We kust make sure that the mapping is big enough for the maximal RAM size we are going to test.
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 You've no idea of what a poor opinion I have of myself, and how little I deserve it. - W. S. Gilbert
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
Quoted 3 lines · Wolfgang Denk
We don't have machine check handlers on the other PPC systems either. We kust make sure that the mapping is big enough for the maximal RAM size we are going to test.
What if the mapping is too big? Isn't the whole point of get_ram_size() that there is less RAM than we say there is? That is, if there's only 1GB of RAM, and we do this:
dram_size = get_ram_size(0, 2GB);
That get_ram_size() will return 1GB?
Signature · 2 lines
Timur Tabi Linux kernel developer at Freescale
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
Dear Timur Tabi,
Quoted 4 lines · In message <[email protected]> you wrote:
What if the mapping is too big? Isn't the whole point of
get_ram_size()that there is less RAM than we say there is? That is, if there's only 1GB of RAM, and we do this:
get_ram_size() will also detect a number of hardware problems list stuck / swapped / mirrored address lines etc. (actually a pretty large percentage of the real world hardware problems).
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 think it's a new feature. Don't tell anyone it was an accident. :-) -- Larry Wall on s/foo/bar/eieio in <[email protected]>
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
Quoted 11 lines · Wolfgang Denk
Dear Timur Tabi,
Quoted 4 lines · In message<[email protected]> you wrote:
What if the mapping is too big? Isn't the whole point of
get_ram_size()that there is less RAM than we say there is? That is, if there's only 1GB of RAM, and we do this:
get_ram_size()will also detect a number of hardware problems list stuck / swapped / mirrored address lines etc. (actually a pretty large percentage of the real world hardware problems).
How about splitting out the testing bit into something that will just test a specified range, and report any errors, rather than quietly pretend you have less RAM if the test fails?
-Scott
PATCH 1/1 powerpc: add support for the FreescaleP1022DS reference board
In reply to Timur TabiQuoted 1 line
Add basic suport for the Freescale P1022DS reference board.
<snip>
arch/powerpc/cpu/mpc8xxx/pci_cfg.c static struct pci_info pci_config_info[] = · line 200
Quoted 12 lines
arch/powerpc/cpu/mpc8xxx/pci_cfg.c +12
-0+#elif defined(CONFIG_P1022 ) +static struct pci_info pci_config_info[] = +{ + [LAW_TRGT_IF_PCIE_1 ] = { + .agent = (1 <<0 ) | (1 <<1 ), + .cfg = (1 <<6 ) | (1 <<7 ) | (1 <<9 ) | (1 <<0xa ) | + (1 <<0xb ) | (1 <<0xd ) | (1 <<0xe ) | + (1 <<0xf ) | (1 <<0x15 ) | (1 <<0x16 ) | + (1 <<0x17 ) | (1 <<0x18 ) | (1 <<0x19 ) | + (1 <<0x1a ) | (1 <<0x1b ) | (1 <<0x1c ) | + (1 <<0x1d ) | (1 <<0x1e ) | (1 <<0x1f ), + },
Tiimur,
Did you grab the patch from our latest BSP tree?
It seems like your patch doesn't base on latest upstream tree, IIRC, the PCI stuff
in mpc8xxx/pci_cfg.c is ready in upstream tree.
Did you have a test the patch on V2 board? The V2 board has big change from V1
board. Anyway I would like we have sufficient test on V2 board before it is merged to
main tree.
Thanks, Dave
PATCH 1/1 powerpc: add support for the FreescaleP1022DS reference board
Quoted 1 line · Liu Dave-R63238 wrote:
Did you grab the patch from our latest BSP tree?
No, I've been using the ltib patches. I guess I should use the repository on git.ap instead.
Quoted 3 lines
It seems like your patch doesn't base on latest upstream tree, IIRC, the PCI stuff
inmpc8xxx/pci_cfg.cis ready in upstream tree.
Ah, I was using the P2020 as a basis, not the 8536. And I see Kumar just posted patches for the P2020.
Quoted 5 lines
Did you have a test the patch on V2 board? The V2 board has big change from V1
board. Anyway I would like we have sufficient test on V2 board before it is merged to
main tree.
When I power on the board, it says this:
Board: P1022DS Sys ID: 0x19, Sys Ver: 0x02, FPGA Ver: 0x04, vBank: 0
How can I tell if I have a rev2 board? There's a sticker that says, "sch-26191 rev b"
Signature · 2 lines
Timur Tabi Linux kernel developer at Freescale
PATCH 1/1 powerpc: add support for the Freescale P1022DS reference board
In reply to Timur TabiQuoted 35 lines · Timur Tabi
arch/powerpc/cpu/mpc8xxx/pci_cfg.c +26
-0@@ -186,6 +186,32 @@ static struct pci_info pci_config_info[] = (1 << 0x16) | (1 << 0x17) | (1 << 0x18) | (1 << 0x1c), }, }; +#elif defined(CONFIG_P1022 ) +static struct pci_info pci_config_info[] = +{ + [LAW_TRGT_IF_PCIE_1 ] = { + .agent = (1 <<0 ) | (1 <<1 ), + .cfg = (1 <<6 ) | (1 <<7 ) | (1 <<9 ) | (1 <<0xa ) | + (1 <<0xb ) | (1 <<0xd ) | (1 <<0xe ) | + (1 <<0xf ) | (1 <<0x15 ) | (1 <<0x16 ) | + (1 <<0x17 ) | (1 <<0x18 ) | (1 <<0x19 ) | + (1 <<0x1a ) | (1 <<0x1b ) | (1 <<0x1c ) | + (1 <<0x1d ) | (1 <<0x1e ) | (1 <<0x1f ), + }, + [LAW_TRGT_IF_PCIE_2 ] = { + .agent = (1 <<0 ) | (1 <<2 ), + .cfg = (1 <<0 ) | (1 <<1 ) | (1 <<6 ) | (1 <<7 ) | + (1 <<9 ) | (1 <<0xa ) | (1 <<0xb ) | (1 <<0xd ) | + (1 <<0x15 ) | (1 <<0x16 ) | (1 <<0x17 ) | + (1 <<0x18 ) | (1 <<0x1c ), + }, + [LAW_TRGT_IF_PCIE_3 ] = { + .agent = (1 <<0 ) | (1 <<3 ), + .cfg = (1 <<6 ) | (1 <<7 ) | (1 <<9 ) | (1 <<0xd ) | + (1 <<0x15 ) | (1 <<0x16 ) | (1 <<0x17 ) | (1 <<0x18 ) | + (1 <<0x19 ) | (1 <<0x1a ) | (1 <<0x1b ), + }, +};#elif defined(CONFIG_P2010 ) || defined(CONFIG_P2020 )
Quoted 2 lines
static struct
pci_infopci_config_info[] =
{
This is the old style that we want to move away from. I posted patches for the P2020 DS.
- k