[U-Boot] [PATCH 1/2] sbc8349: make enabling PCI more user friendly.

Prior to this commit, to enable PCI, you had to go manually edit the board config header, which isn't really user friendly. This adds the typical PCI make targets to the toplevel Makefile in accordance with what is being done with other boards.
Signed-off-by: Paul Gortmaker paul.gortmaker@windriver.com --- Makefile | 19 +++++++++++++++- doc/README.sbc8349 | 50 ++++++++++++++++++++++++++++++-------------- include/configs/sbc8349.h | 22 +++++++++++-------- 3 files changed, 64 insertions(+), 27 deletions(-)
diff --git a/Makefile b/Makefile index 329e0f5..da98900 100644 --- a/Makefile +++ b/Makefile @@ -2375,8 +2375,23 @@ MPC837XERDB_config: unconfig MVBLM7_config: unconfig @$(MKCONFIG) $(@:_config=) ppc mpc83xx mvblm7 matrix_vision
-sbc8349_config: unconfig - @$(MKCONFIG) $(@:_config=) ppc mpc83xx sbc8349 +sbc8349_config \ +sbc8349_PCI_33_config \ +sbc8349_PCI_66_config: unconfig + @mkdir -p $(obj)include + @if [ "$(findstring _PCI_,$@)" ] ; then \ + $(XECHO) -n "... PCI HOST at " ; \ + echo "#define CONFIG_PCI" >>$(obj)include/config.h ; \ + fi ; \ + if [ "$(findstring _33_,$@)" ] ; then \ + $(XECHO) -n "33MHz... " ; \ + echo "#define PCI_33M" >>$(obj)include/config.h ; \ + fi ; \ + if [ "$(findstring _66_,$@)" ] ; then \ + $(XECHO) -n "66MHz... " ; \ + echo "#define PCI_66M" >>$(obj)include/config.h ; \ + fi ; + @$(MKCONFIG) -a sbc8349 ppc mpc83xx sbc8349
SIMPC8313_LP_config \ SIMPC8313_SP_config: unconfig diff --git a/doc/README.sbc8349 b/doc/README.sbc8349 index 908e768..2c35919 100644 --- a/doc/README.sbc8349 +++ b/doc/README.sbc8349 @@ -91,19 +91,37 @@ safety check before resetting the board upon completion of the reflash. PCI: ====
-This board and U-Boot have been tested with PCI built in, on a SBC8349 -and confirmed that the "pci" command showed the intel e1000 that was -present in the PCI slot. Note that if a 33MHz 32bit card is inserted -in the slot, then the whole board will clock down to a 33MHz base -clock instead of the default 66MHz. This will change the baud clocks -and mess up your serial console output. If you want to use a 33MHz PCI -card, then you should build a U-Boot with #undef PCI_66M in the -include/configs/sbc8349.h and store this to flash prior to powering down -the board and inserting the 33MHz PCI card. - -By default PCI support is disabled to better support very early -revision MPC834x chips with possible PCI issues. Also PCI support is -untested on the sbc8347 variants at this point in time. - - - Paul Gortmaker, 01/2007 +There are three configuration choices: + sbc8349_config + sbc8349_PCI_33_config + sbc8349_PCI_66_config + +The 1st does not enable CONFIG_PCI, and assumes that the PCI slot +will be left empty (M66EN high), and so the board will operate with +a base clock of 66MHz. Note that you need both PCI enabled in u-boot +and linux in order to have functional PCI under linux. The only +reason for choosing to not enable PCI would be if you had a very +early (rev 1.0) CPU with possible PCI issues. + +The second enables PCI support and builds for a 33MHz clock rate. Note +that if a 33MHz 32bit card is inserted in the slot, then the whole board +will clock down to a 33MHz base clock instead of the default 66MHz. This +will change the baud clocks and mess up your serial console output if you +were previously running at 66MHz. If you want to use a 33MHz PCI card, +then you should build a U-Boot with sbc8349_PCI_33_config and store this +to flash prior to powering down the board and inserting the 33MHz PCI +card. + +The third option builds PCI support in, and leaves the clocking at the +default 66MHz. This has been tested with an intel PCI-X e1000 card. +This is also the appropriate choice for people with a recent (non 1.0) +CPU who currently have the PCI slot physically empty, but intend to +possibly add a PCI-X card at a later date. + + => pci + Scanning PCI devices on bus 0 + BusDevFun VendorId DeviceId Device Class Sub-Class + _____________________________________________________________ + 00.00.00 0x1957 0x0080 Processor 0x20 + 00.11.00 0x8086 0x1026 Network controller 0x00 + => diff --git a/include/configs/sbc8349.h b/include/configs/sbc8349.h index 868bd54..088b283 100644 --- a/include/configs/sbc8349.h +++ b/include/configs/sbc8349.h @@ -40,24 +40,28 @@ #define CONFIG_MPC8349 1 /* MPC8349 specific */ #define CONFIG_SBC8349 1 /* WRS SBC8349 board specific */
-#undef CONFIG_PCI /* Don't enable PCI2 on sbc834x - it doesn't exist physically. */ #undef CONFIG_MPC83XX_PCI2 /* support for 2nd PCI controller */
-#define PCI_66M -#ifdef PCI_66M -#define CONFIG_83XX_CLKIN 66000000 /* in Hz */ -#else +/* + * The default if PCI isn't enabled, or if no PCI clk setting is given + * is 66MHz; this is what the board defaults to when the PCI slot is + * physically empty. The board will automatically (i.e w/o jumpers) + * clock down to 33MHz if you insert a 33MHz PCI card. + */ +#ifdef PCI_33M #define CONFIG_83XX_CLKIN 33000000 /* in Hz */ +#else /* 66M */ +#define CONFIG_83XX_CLKIN 66000000 /* in Hz */ #endif
#ifndef CONFIG_SYS_CLK_FREQ -#ifdef PCI_66M -#define CONFIG_SYS_CLK_FREQ 66000000 -#define HRCWL_CSB_TO_CLKIN HRCWL_CSB_TO_CLKIN_4X1 -#else +#ifdef PCI_33M #define CONFIG_SYS_CLK_FREQ 33000000 #define HRCWL_CSB_TO_CLKIN HRCWL_CSB_TO_CLKIN_8X1 +#else /* 66M */ +#define CONFIG_SYS_CLK_FREQ 66000000 +#define HRCWL_CSB_TO_CLKIN HRCWL_CSB_TO_CLKIN_4X1 #endif #endif

This was introduced with the MPC8349EMDS board, and then copied to a couple other boards by nature of being the reference implementation.
u-boot$git grep CONFIG_SYS_MID_FLASH_JUMP include/configs/MPC8349EMDS.h:#define CONFIG_SYS_MID_FLASH_JUMP 0x7F000000 include/configs/sbc8349.h:#define CONFIG_SYS_MID_FLASH_JUMP 0x7F000000 include/configs/vme8349.h:#define CONFIG_SYS_MID_FLASH_JUMP 0x7F000000 u-boot$
It currently isn't used, so delete it before it spreads further.
Signed-off-by: Paul Gortmaker paul.gortmaker@windriver.com --- include/configs/MPC8349EMDS.h | 1 - include/configs/sbc8349.h | 1 - include/configs/vme8349.h | 1 - 3 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/include/configs/MPC8349EMDS.h b/include/configs/MPC8349EMDS.h index 3cf59ef..a8c8a79 100644 --- a/include/configs/MPC8349EMDS.h +++ b/include/configs/MPC8349EMDS.h @@ -172,7 +172,6 @@ #define CONFIG_SYS_FLASH_ERASE_TOUT 60000 /* Flash Erase Timeout (ms) */ #define CONFIG_SYS_FLASH_WRITE_TOUT 500 /* Flash Write Timeout (ms) */
-#define CONFIG_SYS_MID_FLASH_JUMP 0x7F000000 #define CONFIG_SYS_MONITOR_BASE TEXT_BASE /* start of monitor */
#if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE) diff --git a/include/configs/sbc8349.h b/include/configs/sbc8349.h index 088b283..4f2aef0 100644 --- a/include/configs/sbc8349.h +++ b/include/configs/sbc8349.h @@ -157,7 +157,6 @@ #define CONFIG_SYS_FLASH_ERASE_TOUT 60000 /* Flash Erase Timeout (ms) */ #define CONFIG_SYS_FLASH_WRITE_TOUT 500 /* Flash Write Timeout (ms) */
-#define CONFIG_SYS_MID_FLASH_JUMP 0x7F000000 #define CONFIG_SYS_MONITOR_BASE TEXT_BASE /* start of monitor */
#if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE) diff --git a/include/configs/vme8349.h b/include/configs/vme8349.h index 1477552..35d367d 100644 --- a/include/configs/vme8349.h +++ b/include/configs/vme8349.h @@ -152,7 +152,6 @@ #define CONFIG_SYS_FLASH_ERASE_TOUT 60000 /* Flash Erase TO (ms) */ #define CONFIG_SYS_FLASH_WRITE_TOUT 500 /* Flash Write TO (ms) */
-#define CONFIG_SYS_MID_FLASH_JUMP 0x7F000000 #define CONFIG_SYS_MONITOR_BASE TEXT_BASE /* start of monitor */
#if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE)

On Wed, 12 Aug 2009 15:44:51 -0400 Paul Gortmaker paul.gortmaker@windriver.com wrote:
Prior to this commit, to enable PCI, you had to go manually edit the board config header, which isn't really user friendly. This adds the typical PCI make targets to the toplevel Makefile in accordance with what is being done with other boards.
Signed-off-by: Paul Gortmaker paul.gortmaker@windriver.com
applied 1-2.
Thanks,
Kim
participants (2)
-
Kim Phillips
-
Paul Gortmaker