mpc85xx: Add support for the Varisys Cyrus board
PATCH v3 1/1 mpc85xx: Add support for the Varisys Cyrus board
This board runs a P5020 or P5040 chip, and utilizes an EEPROM with similar formatting to the Freescale P5020DS.
Large amounts of this code were developed by
Adrian Cox <adrian@humboldt dot co dot uk>
---
v3:
* Clarified sys_eeprom.c comments
* Removed errant whitespace
* Added MAINTAINERS file
v2:
* Cleaned up sys_eeprom.c
* Removed redundant CONFIG_CMD_ELF, CONFIG_SYS_GENERIC_BOARD
arch/powerpc/cpu/mpc85xx/Kconfig | 4 + board/varisys/common/Makefile | 23 ++ board/varisys/common/eeprom.h | 6 + board/varisys/common/sys_eeprom.c | 498 +++++++++++++++++++++++++++++ board/varisys/cyrus/Kconfig | 12 + board/varisys/cyrus/MAINTAINERS | 7 + board/varisys/cyrus/Makefile | 8 + board/varisys/cyrus/README | 19 ++ board/varisys/cyrus/cyrus.c | 116 +++++++ board/varisys/cyrus/cyrus.h | 11 + board/varisys/cyrus/ddr.c | 188 +++++++++++ board/varisys/cyrus/eth.c | 100 ++++++ board/varisys/cyrus/law.c | 27 ++ board/varisys/cyrus/pbi.cfg | 35 +++ board/varisys/cyrus/pci.c | 23 ++ board/varisys/cyrus/rcw_p5020_v2.cfg | 11 + board/varisys/cyrus/rcw_p5040.cfg | 11 + board/varisys/cyrus/tlb.c | 106 +++++++ configs/Cyrus_P5020_defconfig | 9 + configs/Cyrus_P5040_defconfig | 9 + include/configs/cyrus.h | 587 +++++++++++++++++++++++++++++++++++ 21 files changed, 1810 insertions(+) create mode 100644 board/varisys/common/Makefile create mode 100644 board/varisys/common/eeprom.h create mode 100644 board/varisys/common/sys_eeprom.c create mode 100644 board/varisys/cyrus/Kconfig create mode 100644 board/varisys/cyrus/MAINTAINERS create mode 100644 board/varisys/cyrus/Makefile create mode 100644 board/varisys/cyrus/README create mode 100644 board/varisys/cyrus/cyrus.c create mode 100644 board/varisys/cyrus/cyrus.h create mode 100644 board/varisys/cyrus/ddr.c create mode 100644 board/varisys/cyrus/eth.c create mode 100644 board/varisys/cyrus/law.c create mode 100644 board/varisys/cyrus/pbi.cfg create mode 100644 board/varisys/cyrus/pci.c create mode 100644 board/varisys/cyrus/rcw_p5020_v2.cfg create mode 100644 board/varisys/cyrus/rcw_p5040.cfg create mode 100644 board/varisys/cyrus/tlb.c create mode 100644 configs/Cyrus_P5020_defconfig create mode 100644 configs/Cyrus_P5040_defconfig create mode 100644 include/configs/cyrus.h
arch/powerpc/cpu/mpc85xx/Kconfig +4 -0
@@ -149,6 +149,9 @@ config TARGET_XPEDITE550X config TARGET_UCP1020 bool "Support uCP1020" +config TARGET_CYRUS + bool "Support Varisys Cyrus" + endchoice source "board/freescale/b4860qds/Kconfig"
@@ -185,6 +188,7 @@ source "board/gdsys/p1022/Kconfig" source "board/keymile/kmp204x/Kconfig" source "board/sbc8548/Kconfig" source "board/socrates/Kconfig" +source "board/varisys/cyrus/Kconfig" source "board/xes/xpedite520x/Kconfig" source "board/xes/xpedite537x/Kconfig" source "board/xes/xpedite550x/Kconfig"
board/varisys/common/Makefile new file +23 -0
@@ -0,0 +1,23 @@ +# +# (C) Copyright 2006 +# Wolfgang Denk, DENX Software Engineering, wd at denx.de. +# +# SPDX-License-Identifier: GPL-2.0+ +# + +MINIMAL= + +ifdef CONFIG_SPL_BUILD +ifdef CONFIG_SPL_INIT_MINIMAL +MINIMAL=y +endif +endif + +ifdef MINIMAL +# necessary to create built-in.o +obj- := __dummy__.o +else +ifndef CONFIG_SPL_BUILD +obj-$(CONFIG_ID_EEPROM) += sys_eeprom.o +endif +endif
board/varisys/common/eeprom.h new file +6 -0
@@ -0,0 +1,6 @@ +/* EEPROM init functions for Cyrus */ + + +void init_eeprom (int bus_num,int addr,int addr_len); +void mac_read_from_fixed_id (void ); +int mac_read_from_eeprom_common (void );
board/varisys/common/sys_eeprom.c new file +498 -0
498 lines not on this page · raw message
board/varisys/cyrus/Kconfig new file +12 -0
@@ -0,0 +1,12 @@ +if TARGET_CYRUS + +config SYS_BOARD + default "cyrus" + +config SYS_VENDOR + default "varisys" + +config SYS_CONFIG_NAME + default "cyrus" + +endif
board/varisys/cyrus/MAINTAINERS new file +7 -0
@@ -0,0 +1,7 @@ +Cyrus BOARD +M: Andy Fleming <[email protected]> +S: Maintained +F: board/varisys/cyrus/ +F: include/configs/cyrus.h +F: configs/Cyrus_P5020_defconfig +F: configs/Cyrus_P5040_defconfig
board/varisys/cyrus/Makefile new file +8 -0
@@ -0,0 +1,8 @@ +# + +obj-y += $(BOARD).o +obj-y += ddr.o +obj-y += law.o +obj-y += tlb.o +obj-y += eth.o +obj-$(CONFIG_PCI) += pci.o
board/varisys/cyrus/README new file +19 -0
@@ -0,0 +1,19 @@ +Rebuilding u-boot for Cyrus + +The Cyrus defconfigs are Cyrus_P5020_defconfig and Cyrus_P5040_defconfig. + +They currently disable size optimization in order to avoid a relocation +bug in some versions of GCC. As the output size is a constant, the size +optimization is not currently important. + +Cyrus boots off a microSD card in a slot on the motherboard. This requires +that the u-boot is built for the Pre-Boot Loader on the P5020/P5040. +In order to reflash u-boot, you must download u-boot.pbl, then write it +onto the card. To do that from u-boot: + +> tftp 1000000 u-boot.pbl +> mmc write 1000000 8 672 + +If you want to do this via a card reader in linux: + +> dd if=u-boot.pbl of=/dev/sdX bs=512 oseek=8
board/varisys/cyrus/cyrus.c new file +116 -0
116 lines not on this page · raw message
board/varisys/cyrus/cyrus.h new file +11 -0
@@ -0,0 +1,11 @@ +/* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#ifndef __CYRUS_H +#define __CYRUS_H + +void fdt_fixup_board_enet (void *blob); +void pci_of_setup (void *blob,bd_t *bd); + +#endif
board/varisys/cyrus/ddr.c new file +188 -0
188 lines not on this page · raw message
board/varisys/cyrus/eth.c new file +100 -0
100 lines not on this page · raw message
board/varisys/cyrus/law.c new file +27 -0
@@ -0,0 +1,27 @@ +/* +* Author: Adrian Cox +* Based on corenet_ds law files. +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#include <common.h> +#include <asm/fsl_law.h> +#include <asm/mmu.h> + +struct law_entry law_table[] = { +SET_LAW (CONFIG_SYS_LBC0_BASE_PHYS ,LAW_SIZE_64K ,LAW_TRGT_IF_LBC ), +SET_LAW (CONFIG_SYS_LBC1_BASE_PHYS ,LAW_SIZE_4K ,LAW_TRGT_IF_LBC ), +#ifdef CONFIG_SYS_BMAN_MEM_PHYS +SET_LAW (CONFIG_SYS_BMAN_MEM_PHYS ,LAW_SIZE_2M ,LAW_TRGT_IF_BMAN ), +#endif +#ifdef CONFIG_SYS_QMAN_MEM_PHYS +SET_LAW (CONFIG_SYS_QMAN_MEM_PHYS ,LAW_SIZE_2M ,LAW_TRGT_IF_QMAN ), +#endif +#ifdef CONFIG_SYS_DCSRBAR_PHYS +/* Limit DCSR to 32M to access NPC Trace Buffer */ +SET_LAW (CONFIG_SYS_DCSRBAR_PHYS ,LAW_SIZE_32M ,LAW_TRGT_IF_DCSR ), +#endif +}; + +int num_law_entries =ARRAY_SIZE (law_table);
board/varisys/cyrus/pbi.cfg new file +35 -0
@@ -0,0 +1,35 @@ +# +# Copyright 2012 Freescale Semiconductor, Inc. +# +# Refer docs/README.pblimage for more details about how-to configure +# and create PBL boot image +# +# SPDX-License-Identifier: GPL-2.0+ +# + +#PBI commands +#Initialize CPC1 as 1MB SRAM +09010000 00200400 +09138000 00000000 +091380c0 00000100 +09010100 00000000 +09010104 fff0000b +09010f00 08000000 +09010000 80000000 +#Configure LAW for CPC1 +09000d00 00000000 +09000d04 fff00000 +09000d08 81000013 +09000010 00000000 +09000014 ff000000 +09000018 81000000 +#Initialize eSPI controller, default configuration is slow for eSPI to +#load data, this configuration comes from u-boot eSPI driver. +09110000 80000403 +09110020 2d170008 +09110024 00100008 +09110028 00100008 +0911002c 00100008 +#Flush PBL data +09138000 00000000 +091380c0 00000000
board/varisys/cyrus/pci.c new file +23 -0
@@ -0,0 +1,23 @@ +/* +* Copyright 2007-2011 Freescale Semiconductor, Inc. +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#include <common.h> +#include <command.h> +#include <pci.h> +#include <asm/fsl_pci.h> +#include <libfdt.h> +#include <fdt_support.h> +#include <asm/fsl_serdes.h> + +void pci_init_board (void ) +{ +fsl_pcie_init_board (0 ); +} + +void pci_of_setup (void *blob,bd_t *bd) +{ +FT_FSL_PCI_SETUP ; +}
board/varisys/cyrus/rcw_p5020_v2.cfg new file +11 -0
@@ -0,0 +1,11 @@ +# +# Default RCW for Cyrus P5020 +# + +#PBL preamble and RCW header +aa55aa55 010e0100 +#64 bytes RCW data +0c540000 00000000 1e1e0000 00000000 +44808c00 ff002000 68000000 45000000 +00000000 00000000 00000000 0003000f +a0000000 00000000 00000000 00000000
board/varisys/cyrus/rcw_p5040.cfg new file +11 -0
@@ -0,0 +1,11 @@ +# +# Default RCW for Cyrus P5040 +# + +#PBL preamble and RCW header +aa55aa55 010e0100 +#64 bytes RCW data +90e00000 00000000 acac9800 00440000 +44808c00 ff29a000 68000000 61000000 +00000000 00000000 00000000 0003000f +a0000000 00000000 00000000 00000000
board/varisys/cyrus/tlb.c new file +106 -0
106 lines not on this page · raw message
configs/Cyrus_P5020_defconfig new file +9 -0
@@ -0,0 +1,9 @@ +CONFIG_PPC=y +CONFIG_MPC85xx=y +CONFIG_TARGET_CYRUS=y +CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SYS_TEXT_BASE=0xFFF40000,PPC_P5020" +# CONFIG_CMD_IMLS is not set +# CONFIG_CMD_FLASH is not set +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_NETDEVICES=y +CONFIG_E1000=y
configs/Cyrus_P5040_defconfig new file +9 -0
@@ -0,0 +1,9 @@ +CONFIG_PPC=y +CONFIG_MPC85xx=y +CONFIG_TARGET_CYRUS=y +CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SYS_TEXT_BASE=0xFFF40000,PPC_P5040" +# CONFIG_CMD_IMLS is not set +# CONFIG_CMD_FLASH is not set +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_NETDEVICES=y +CONFIG_E1000=y
include/configs/cyrus.h new file +587 -0
587 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v3 1/1 mpc85xx: Add support for the Varisys Cyrus board
Quoted 7 lines · Andy Fleming
This board runs a P5020 or P5040 chip, and utilizes an EEPROM with similar formatting to the Freescale P5020DS.
Large amounts of this code were developed by
Adrian Cox <adrian@humboldt dot co dot uk>Signed-off-by Andy Fleming <[email protected]>
Quoted 8 lines
---
v3:
* Clarifiedsys_eeprom.ccomments
* Removed errant whitespace
* AddedMAINTAINERSfile
v2:
* Cleaned upsys_eeprom.c
* Removed redundantCONFIG_CMD_ELF,CONFIG_SYS_GENERIC_BOARD
Applied to u-boot-mpc85xx, awaiting upstream.
York