bmips: ram: add an option to force the size of the ram
PATCH 1/3 bmips: ram: add an option to force the size of the ram
This adds an option to force the size of the ram, and avoid the detection of ram size.
--- drivers/ram/bmips_ram.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/ram/bmips_ram.c +7 -1
@@ -43,6 +43,7 @@ struct bmips_ram_hw {struct bmips_ram_priv {void __iomem *regs; +u32 force_size;const struct bmips_ram_hw *hw; };
@@ -104,7 +105,10 @@ static int bmips_ram_get_info(struct udevice *dev, struct ram_info *info)const struct bmips_ram_hw *hw = priv->hw; info->base =0x80000000 ; - info->size = hw->get_ram_size (priv); +if (priv->force_size) + info->size = priv->force_size; +else + info->size = hw->get_ram_size (priv);return 0 ; }
@@ -155,6 +159,8 @@ static int bmips_ram_probe(struct udevice *dev)if (!priv->regs)return -EINVAL ; +dev_read_u32 (dev,"force-size" , &priv->force_size); + priv->hw = hw;return 0 ;
Signature · 1 line
2.7.4
PATCH 2/3 bcm6838: add initial support
This adds the initial support of the Broadcom BCM6838 SoC familly, only cpu, dram, uart and leds are supported.
--- arch/mips/dts/brcm,bcm6838.dtsi | 75 +++++++++++++++++++++++++++++++++++++++++ arch/mips/mach-bmips/Kconfig | 13 +++++++ drivers/cpu/bmips_cpu.c | 33 ++++++++++++++++++ include/configs/bmips_bcm6838.h | 24 +++++++++++++ 4 files changed, 145 insertions(+) create mode 100644 arch/mips/dts/brcm,bcm6838.dtsi create mode 100644 include/configs/bmips_bcm6838.h
arch/mips/dts/brcm,bcm6838.dtsi new file +75 -0
@@ -0,0 +1,75 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2018 Philippe Reynes <[email protected]> + */ + +#include "skeleton.dtsi" + +/ { + compatible = "brcm,bcm6838"; + + cpus { + reg = <0x14e00000 0x4>; + #address-cells = <1>; + #size-cells = <0>; + u-boot,dm-pre-reloc; + + cpu at 0 { + compatible = "brcm,bcm6838-cpu", "mips,mips4Kc"; + device_type = "cpu"; + reg = <0>; + u-boot,dm-pre-reloc; + }; + + cpu at 1 { + compatible = "brcm,bcm6838-cpu", "mips,mips4Kc"; + device_type = "cpu"; + reg = <1>; + u-boot,dm-pre-reloc; + }; + }; + + clocks { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + u-boot,dm-pre-reloc; + + periph_osc: periph-osc { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <50000000>; + u-boot,dm-pre-reloc; + }; + }; + + ubus { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + u-boot,dm-pre-reloc; + + memory: memory-controller at 12000000 { + compatible = "brcm,bcm6328-mc"; + reg = <0x12000000 0x1000>; + u-boot,dm-pre-reloc; + }; + + uart0: serial at 14e00500 { + compatible = "brcm,bcm6345-uart"; + reg = <0x14e00500 0x18>; + clocks = <&periph_osc>; + + status = "disabled"; + }; + + leds: led-controller at 14e00f00 { + compatible = "brcm,bcm6328-leds"; + reg = <0x14e00f00 0x28>; + #address-cells = <1>; + #size-cells = <0>; + + status = "disabled"; + }; + }; +};
arch/mips/mach-bmips/Kconfig +13 -0
@@ -14,6 +14,7 @@ config SYS_SOC default "bcm6368" if SOC_BMIPS_BCM6368 default "bcm6362" if SOC_BMIPS_BCM6362 default "bcm63268" if SOC_BMIPS_BCM63268 + default "bcm6838" if SOC_BMIPS_BCM6838 choice prompt "Broadcom MIPS SoC select"
@@ -118,6 +119,18 @@ config SOC_BMIPS_BCM63268 This supports BMIPS BCM63268 family including BCM63168, BCM63169, BCM63268 and BCM63269. +config SOC_BMIPS_BCM6838 + bool "BMIPS BCM6838 family" + select SUPPORTS_BIG_ENDIAN + select SUPPORTS_CPU_MIPS32_R1 + select MIPS_TUNE_4KC + select MIPS_L1_CACHE_SHIFT_4 + select SWAP_IO_SPACE + select SYSRESET_SYSCON + help + This supports BMIPS BCM6838 family including BCM68380, BCM68381, + and BCM68385. + endchoice choice
drivers/cpu/bmips_cpu.c +33 -0
@@ -66,6 +66,10 @@#define STRAPBUS_63268_FCVO_SHIFT 21#define STRAPBUS_63268_FCVO_MASK (0xf << STRAPBUS_63268_FCVO_SHIFT) +#define REG_BCM6838_OTP_BRCMBITS0 0x440 +#define VIPER_6838_FREQ_SHIFT 18 +#define VIPER_6838_FREQ_MASK (0x7 << VIPER_6838_FREQ_SHIFT) +struct bmips_cpu_priv ;struct bmips_cpu_hw {
@@ -272,6 +276,26 @@ static ulong bcm63268_get_cpu_freq(struct bmips_cpu_priv *priv) } } +static ulong bcm6838_get_cpu_freq (struct bmips_cpu_priv *priv) +{ +unsigned int mips_viper_freq; + + mips_viper_freq =readl_be (priv->regs +REG_BCM6838_OTP_BRCMBITS0 ); + mips_viper_freq = (mips_viper_freq &VIPER_6838_FREQ_MASK ) + >>VIPER_6838_FREQ_SHIFT ; + +switch (mips_viper_freq) { +case 0x0 : +return 600000000 ; +case 0x1 : +return 400000000 ; +case 0x2 : +return 240000000 ; +default : +return 0 ; + } +} +static int bcm6328_get_cpu_count (struct bmips_cpu_priv *priv) {u32 val =readl_be (priv->regs +REG_BCM6328_OTP );
@@ -346,6 +370,12 @@ static const struct bmips_cpu_hw bmips_cpu_bcm63268 = { .get_cpu_count = bcm6358_get_cpu_count, }; +static const struct bmips_cpu_hw bmips_cpu_bcm6838 = { + .get_cpu_desc = bmips_short_cpu_desc, + .get_cpu_freq = bcm6838_get_cpu_freq, + .get_cpu_count = bcm6358_get_cpu_count, +}; +/* Generic CPU Ops */ static int bmips_cpu_get_desc (struct udevice *dev,char *buf,int size) {
@@ -444,6 +474,9 @@ static const struct udevice_id bmips_cpu_ids[] = { }, { .compatible = "brcm,bcm63268-cpu", .data = (ulong)&bmips_cpu_bcm63268, + }, { + .compatible = "brcm,bcm6838-cpu", + .data = (ulong)&bmips_cpu_bcm6838, }, {/* sentinel */ } };
include/configs/bmips_bcm6838.h new file +24 -0
@@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Copyright (C) 2018 Philippe Reynes <[email protected]> +*/ + +#ifndef __CONFIG_BMIPS_BCM6838_H +#define __CONFIG_BMIPS_BCM6838_H + +/* CPU */ +#define CONFIG_SYS_MIPS_TIMER_FREQ 160000000 + +/* RAM */ +#define CONFIG_NR_DRAM_BANKS 1 +#define CONFIG_SYS_SDRAM_BASE 0x80000000 + +/* U-Boot */ +#define CONFIG_SYS_LOAD_ADDR CONFIG_SYS_SDRAM_BASE + 0x100000 + +#if defined(CONFIG_BMIPS_BOOT_RAM ) +#define CONFIG_SKIP_LOWLEVEL_INIT +#define CONFIG_SYS_INIT_SP_OFFSET 0x2000 +#endif + +#endif /* __CONFIG_BMIPS_BCM6838_H */
Signature · 1 line
2.7.4
PATCH 2/3 bcm6838: add initial support
Quoted 4 lines · Philippe Reynes
This adds the initial support of the Broadcom BCM6838 SoC familly, only cpu, dram, uart and leds are supported.
Signed-off-by Philippe Reynes <[email protected]>
Quoted 9 lines
--- arch/mips/dts/brcm,bcm6838.dtsi | 75 +++++++++++++++++++++++++++++++++++++++++ arch/mips/mach-bmips/Kconfig | 13 +++++++ drivers/cpu/bmips_cpu.c | 33 ++++++++++++++++++ include/configs/bmips_bcm6838.h | 24 +++++++++++++ 4 files changed, 145 insertions(+) create mode 100644 arch/mips/dts/brcm,bcm6838.dtsi create mode 100644 include/configs/bmips_bcm6838.h
Signature · 9 lines
- Daniel -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180718/9c020c04/attachment.sig>
PATCH 3/3 bcm968380gerg: add initial support
In reply to Philippe ReynesThis add the initial support of the broadcom reference board bcm968380gerg with a bcm68380 SoC.
This board has 512 MB of RAM, 128 MB of flash (nand), 2 USB port, 1 UART, 4 ethernet ports and BCM43217 (wifi).
--- arch/mips/dts/brcm,bcm968380gerg.dts | 40 +++++++++++++++++++++++ arch/mips/mach-bmips/Kconfig | 12 +++++++ board/broadcom/bcm968380gerg/Kconfig | 12 +++++++ board/broadcom/bcm968380gerg/Makefile | 3 ++ board/broadcom/bcm968380gerg/bcm968380gerg.c | 6 ++++ board/broadcom/bcm968380gerg/board.c | 6 ++++ configs/bcm968380gerg_ram_defconfig | 48 ++++++++++++++++++++++++++++ include/configs/broadcom_bcm968380gerg.h | 9 ++++++ 8 files changed, 136 insertions(+) create mode 100644 arch/mips/dts/brcm,bcm968380gerg.dts create mode 100644 board/broadcom/bcm968380gerg/Kconfig create mode 100644 board/broadcom/bcm968380gerg/Makefile create mode 100644 board/broadcom/bcm968380gerg/bcm968380gerg.c create mode 100644 board/broadcom/bcm968380gerg/board.c create mode 100644 configs/bcm968380gerg_ram_defconfig create mode 100644 include/configs/broadcom_bcm968380gerg.h
arch/mips/dts/brcm,bcm968380gerg.dts new file +40 -0
@@ -0,0 +1,40 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2018 Philippe Reynes <[email protected]> + */ + +/dts-v1/; + +#include "brcm,bcm6838.dtsi" + +/ { + model = "Broadcom bcm68380gerg"; + compatible = "broadcom,bcm68380gerg", "brcm,bcm6838"; + + aliases { + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; +}; + +&memory { + force-size = <0x10000000>; +}; + +&uart0 { + u-boot,dm-pre-reloc; + status = "okay"; +}; + +&leds { + status = "okay"; + + led at 0 { + reg = <0>; + active-low; + label = "bcm968380gerg:green:usb"; + }; +};
arch/mips/mach-bmips/Kconfig +12 -0
@@ -136,6 +136,17 @@ endchoice choice prompt "Board select" +config BOARD_BROADCOM_BCM968380GERG + bool "Broadcom bcm968380gerg" + depends on SOC_BMIPS_BCM6838 + select BMIPS_SUPPORTS_BOOT_RAM + help + Broadcom BCM968380GERG reference board with BCM68380 SoC with 512 MB + of RAM and 128 MB of flash (nand). + Between its different peripherals there's an integrated switch with 4 + ethernet ports, 2 USB ports, 1 UART, GPIO buttons and LEDs, and + a BCM43217 (PCIe). + config BOARD_COMTREND_AR5315U bool "Comtrend AR-5315u" depends on SOC_BMIPS_BCM6318
@@ -264,6 +275,7 @@ endchoice config BMIPS_SUPPORTS_BOOT_RAM bool +source "board/broadcom/bcm968380gerg/Kconfig" source "board/comtrend/ar5315u/Kconfig" source "board/comtrend/ar5387un/Kconfig" source "board/comtrend/ct5361/Kconfig"
board/broadcom/bcm968380gerg/Kconfig new file +12 -0
@@ -0,0 +1,12 @@ +if BOARD_BROADCOM_BCM968380GERG + +config SYS_BOARD + default "bcm968380gerg" + +config SYS_VENDOR + default "broadcom" + +config SYS_CONFIG_NAME + default "broadcom_bcm968380gerg" + +endif
board/broadcom/bcm968380gerg/Makefile new file +3 -0
@@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0+ + +obj-y += bcm968380gerg.o
board/broadcom/bcm968380gerg/bcm968380gerg.c new file +6 -0
@@ -0,0 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Copyright (C) 2018 Philippe Reynes <[email protected]> +*/ + +#include <common.h>
board/broadcom/bcm968380gerg/board.c new file +6 -0
@@ -0,0 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Copyright (C) 2018 Philippe Reynes <[email protected]> +*/ + +#include <common.h>
configs/bcm968380gerg_ram_defconfig new file +48 -0
48 lines not on this page · raw message
include/configs/broadcom_bcm968380gerg.h new file +9 -0
@@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Copyright (C) 2018 Philippe Reynes <[email protected]> +*/ + +#include <configs/bmips_common.h> +#include <configs/bmips_bcm6838.h> + +#define CONFIG_ENV_SIZE (8 * 1024)
Signature · 1 line
2.7.4
PATCH 3/3 bcm968380gerg: add initial support
Quoted 16 lines · Philippe Reynes
This add the initial support of the broadcom reference board bcm968380gerg with a bcm68380 SoC.
This board has 512 MB of RAM, 128 MB of flash (nand), 2 USB port, 1 UART, 4 ethernet ports and BCM43217 (wifi).
Signed-off-by Philippe Reynes <[email protected]>--- arch/mips/dts/brcm,bcm968380gerg.dts | 40 +++++++++++++++++++++++ arch/mips/mach-bmips/Kconfig | 12 +++++++ board/broadcom/bcm968380gerg/Kconfig | 12 +++++++ board/broadcom/bcm968380gerg/Makefile | 3 ++ board/broadcom/bcm968380gerg/bcm968380gerg.c | 6 ++++ board/broadcom/bcm968380gerg/board.c | 6 ++++ configs/bcm968380gerg_ram_defconfig | 48 ++++++++++++++++++++++++++++ include/configs/broadcom_bcm968380gerg.h | 9 ++++++
Quoted 9 lines
8 files changed, 136 insertions(+) create mode 100644 arch/mips/dts/brcm,bcm968380gerg.dts create mode 100644 board/broadcom/bcm968380gerg/Kconfig create mode 100644 board/broadcom/bcm968380gerg/Makefile create mode 100644 board/broadcom/bcm968380gerg/bcm968380gerg.c create mode 100644 board/broadcom/bcm968380gerg/board.c create mode 100644 configs/bcm968380gerg_ram_defconfig create mode 100644 include/configs/broadcom_bcm968380gerg.h
Signature · 9 lines
- Daniel -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180718/e89cd377/attachment.sig>
PATCH 1/3 bmips: ram: add an option to force the size of the ram
In reply to Philippe ReynesQuoted 8 lines · Philippe Reynes
This adds an option to force the size of the ram, and avoid the detection of ram size.
Signed-off-by Philippe Reynes <[email protected]>--- drivers/ram/bmips_ram.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
Signature · 9 lines
- Daniel -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180718/be32dfc4/attachment.sig>