ppc4xx: Allow overwriting pci target registers for all 4xx boards
PATCH 1/2 ppc4xx: Allow overwriting pci target registers for all 4xx boards
This patch adds the CONFIG_PCI_4xx_PTM_OVERWRITE option and replaces the ugly 'if defined(BOARD1) || ... || defined(BOARDn)' construct in 4xx pci code.
When CONFIG_PCI_4xx_PTM_OVERWRITE is defined the default ptm register setup can be overwritten through environment variables ptm1la, ptm1ms, ptm2la and ptm2ms to do application specific pci target BAR configuration.
--- cpu/ppc4xx/4xx_pci.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
cpu/ppc4xx/4xx_pci.c +2 -2
@@ -138,7 +138,7 @@ void pci_405gp_init(struct pci_controller *hose)unsigned short temp_short;unsigned long ptmpcila[2 ] = {CONFIG_SYS_PCI_PTM1PCI ,CONFIG_SYS_PCI_PTM2PCI }; -#if defined(CONFIG_CPCI405 ) || defined(CONFIG_PMC405 ) +#if defined(CONFIG_PCI_4xx_PTM_OVERWRITE)char *ptmla_str, *ptmms_str;#endif unsigned long ptmla[2 ] = {CONFIG_SYS_PCI_PTM1LA ,CONFIG_SYS_PCI_PTM2LA };
@@ -160,7 +160,7 @@ void pci_405gp_init(struct pci_controller *hose)#endif #endif -#if defined(CONFIG_CPCI405 ) || defined(CONFIG_PMC405 ) +#if defined(CONFIG_PCI_4xx_PTM_OVERWRITE) ptmla_str =getenv ("ptm1la" ); ptmms_str =getenv ("ptm1ms" );if (NULL != ptmla_str &&NULL != ptmms_str ) {
Signature · 1 line
1.6.1
PATCH 2/2 ppc4xx: Add CONFIG_PCI_4xx_PTM_OVERWRITE to some esd 4xx boards
--- include/configs/CPCI405.h | 2 ++ include/configs/CPCI4052.h | 2 ++ include/configs/CPCI405AB.h | 2 ++ include/configs/CPCI405DT.h | 2 ++ include/configs/PMC405.h | 2 ++ include/configs/PMC405DE.h | 2 ++ 6 files changed, 12 insertions(+), 0 deletions(-)
include/configs/CPCI405.h +2 -0
@@ -171,6 +171,8 @@#define CONFIG_SYS_PCI_PTM2MS 0xffc00001/* 4MB, enable */ #define CONFIG_SYS_PCI_PTM2PCI 0x04000000/* Host: use this pci address */ +#define CONFIG_PCI_4xx_PTM_OVERWRITE 1/* overwrite PTMx settings by env */ +/*----------------------------------------------------------------------- * IDE/ATA stuff *-----------------------------------------------------------------------
include/configs/CPCI4052.h +2 -0
@@ -192,6 +192,8 @@#define CONFIG_SYS_PCI_PTM2MS 0xffc00001/* 4MB, enable */ #define CONFIG_SYS_PCI_PTM2PCI 0x04000000/* Host: use this pci address */ +#define CONFIG_PCI_4xx_PTM_OVERWRITE 1/* overwrite PTMx settings by env */ +/*----------------------------------------------------------------------- * IDE/ATA stuff *-----------------------------------------------------------------------
include/configs/CPCI405AB.h +2 -0
@@ -189,6 +189,8 @@#define CONFIG_SYS_PCI_PTM2MS 0xffc00001/* 4MB, enable */ #define CONFIG_SYS_PCI_PTM2PCI 0x04000000/* Host: use this pci address */ +#define CONFIG_PCI_4xx_PTM_OVERWRITE 1/* overwrite PTMx settings by env */ +/*----------------------------------------------------------------------- * IDE/ATA stuff *-----------------------------------------------------------------------
include/configs/CPCI405DT.h +2 -0
@@ -193,6 +193,8 @@#define CONFIG_SYS_PCI_PTM2MS 0xffc00001/* 4MB, enable */ #define CONFIG_SYS_PCI_PTM2PCI 0x04000000/* Host: use this pci address */ +#define CONFIG_PCI_4xx_PTM_OVERWRITE 1/* overwrite PTMx settings by env */ +/*----------------------------------------------------------------------- * IDE/ATA stuff *-----------------------------------------------------------------------
include/configs/PMC405.h +2 -0
@@ -181,6 +181,8 @@#define CONFIG_SYS_PCI_PTM2MS 0xff000001/* 16MB, enable */ #define CONFIG_SYS_PCI_PTM2PCI 0x00000000/* Host: use this pci address */ +#define CONFIG_PCI_4xx_PTM_OVERWRITE 1/* overwrite PTMx settings by env */ +/* * Start addresses for the final memory configuration * (Set up by the startup code)
include/configs/PMC405DE.h +2 -0
@@ -164,6 +164,8 @@#define CONFIG_SYS_PCI_PTM2MS 0xff000001/* 16MB, enable=1 */ #define CONFIG_SYS_PCI_PTM2PCI 0x04000000/* Host: use this pci address */ +#define CONFIG_PCI_4xx_PTM_OVERWRITE 1/* overwrite PTMx settings by env */ +/* * For booting Linux, the board info and command line data * have to be in the first 8 MB of memory, since this is
Signature · 1 line
1.6.1
Stefan Roese
AppliedPATCH 2/2 ppc4xx: Add CONFIG_PCI_4xx_PTM_OVERWRITE to some esd 4xx boards
Quoted 1 line · On Monday 07 September 2009 17:00:41 Matthias Fuchs wrote:
Signed-off-by Matthias Fuchs <[email protected]>
Applied to ppc4xx. Thanks.
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
Stefan Roese
AppliedPATCH 1/2 ppc4xx: Allow overwriting pci target registers for all 4xx boards
In reply to Matthias FuchsQuoted 7 lines · On Monday 07 September 2009 17:00:40 Matthias Fuchs wrote:
This patch adds the
CONFIG_PCI_4xx_PTM_OVERWRITEoption and replaces the ugly 'if defined(BOARD1) || ... || defined(BOARDn)' construct in 4xx pci code.When
CONFIG_PCI_4xx_PTM_OVERWRITEis defined the default ptm register setup can be overwritten through environment variables ptm1la, ptm1ms, ptm2la and ptm2ms to do application specific pci target BAR configuration.
Applied to ppc4xx. Thanks.
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