[U-Boot-Users] [PATCH] MPC5121e ADS PCI support

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Tue Feb 26 08:02:22 CET 2008


On 17:03 Mon 25 Feb     , John Rigby wrote:
> Third time's the charm.
> 
> Adds PCI support for MPC5121
> 
> Tested with drivers/net/rtl8139.c
> 
> This patch is identical to the previous except PCI support is
> now conditonal since pci on old silicon (most silicon currently in field)
> does not work.
> 
> ads5121_PCI_config turns on PCI
> 
> Signed-off-by: John Rigby <jrigby at freescale.com>
> ---
>  Makefile                      |   11 ++-
>  board/ads5121/Makefile        |    2 +-
>  board/ads5121/ads5121.c       |    1 +
>  board/ads5121/pci.c           |  216 +++++++++++++++++++++++++++++++++++++++++
>  cpu/mpc512x/speed.c           |   21 +++-
>  include/asm-ppc/global_data.h |    1 +
>  include/asm-ppc/immap_512x.h  |   61 +++++++++++-
>  include/configs/ads5121.h     |   32 ++++++-
>  include/mpc512x.h             |   84 ++++++++++++++++
>  9 files changed, 414 insertions(+), 15 deletions(-)
>  create mode 100644 board/ads5121/pci.c
> 
> diff --git a/Makefile b/Makefile
> index d6a0299..4f4efa4 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -733,8 +733,15 @@ motionpro_config:	unconfig
>  #########################################################################
>  ## MPC512x Systems
>  #########################################################################
> -ads5121_config: unconfig
> -	@$(MKCONFIG) ads5121 ppc mpc512x ads5121
> +ads5121_config \
> +ads5121_PCI_config \
> +	:		 unconfig
> +	@echo "" >$(obj)include/config.h
> +	@if [ "$(findstring _PCI_,$@)" ] ; then \
> +		echo "#define CONFIG_PCI"  >>$(obj)include/config.h ; \
> +		$(XECHO) "... with PCI enabled" ; \
> +	fi
> +	@$(MKCONFIG) -a ads5121 ppc mpc512x ads5121
>  
>  
>  #########################################################################
> diff --git a/board/ads5121/Makefile b/board/ads5121/Makefile
> index cd8148c..f15a88b 100644

I think I'll be better ot move the CONFIG_PCI to Makefile as follow

> --- a/board/ads5121/Makefile
> +++ b/board/ads5121/Makefile
> @@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
>  
>  LIB	= $(obj)lib$(BOARD).a
COBJS-y	:= $(BOARD).o
COBJS-$(CONFIG_PCI)	:= pci

SRCS    := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
OBJS	:= $(addprefix $(obj),$(COBJS-y))

instead of
>  
> -COBJS	:= $(BOARD).o
> +COBJS	:= $(BOARD).o pci.o
>  
>  SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
>  OBJS	:= $(addprefix $(obj),$(COBJS))
> +#include <common.h>
> +
> +#ifdef CONFIG_PCI
so you could remove this
> +
> +#include <asm/mmu.h>
> +#include <asm/global_data.h>
> +#include <pci.h>
> +#if defined(CONFIG_OF_LIBFDT)
> +#include <libfdt.h>
> +#include <fdt_support.h>
> +#endif
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
...
> +			tmp[0] = cpu_to_be32(gd->pci_clk);
> +			do_fixup_by_path(blob, path, "clock-frequency",
> +				&tmp, sizeof(tmp[0]), 1);
> +#endif /* CONFIG_OF_LIBFDT */
> +#endif/* CONFIG_PCI */
and this
> diff --git a/include/configs/ads5121.h b/include/configs/ads5121.h
> index 09c3140..21c60ae 100644
> --- a/include/configs/ads5121.h
> +++ b/include/configs/ads5121.h
> @@ -34,6 +34,9 @@
>   * 0x3000_0000 - 0x3001_FFFF	SRAM (128 KB)
>   * 0x8000_0000 - 0x803F_FFFF	IMMR (4 MB)
>   * 0x8200_0000 - 0x8200_001F	CPLD (32 B)
> + * 0x8400_0000 - 0x82FF_FFFF	PCI I/O space (16 MB)
> + * 0xA000_0000 - 0xAFFF_FFFF	PCI memory space (256 MB)
> + * 0xB000_0000 - 0xBFFF_FFFF	PCI memory mapped I/O space (256 MB)
>   * 0xFC00_0000 - 0xFFFF_FFFF	NOR Boot FLASH (64 MB)
>   */
>  
> @@ -43,7 +46,9 @@
>  #define CONFIG_E300		1	/* E300 Family */
>  #define CONFIG_MPC512X		1	/* MPC512X family */
>  

> -#undef CONFIG_PCI
> +#if 0 /* set at config time */
> +#define CONFIG_PCI
> +#endif

I think is not needed, just a simple comment will be enough

>  
>  #define CFG_MPC512X_CLKIN	66000000	/* in Hz */
>  
> @@ -217,6 +222,31 @@
>  #define CFG_PROMPT_HUSH_PS2 "> "
>  #endif

Best Regards,
J.




More information about the U-Boot mailing list