Commit bf9012b808515bf1314538e8d423080951d012df

Authored by Álvaro Fernández Rojas
Committed by Daniel Schwierzeck
1 parent 5a0efcf78a

MIPS: add support for Broadcom MIPS BCM6348 SoC family

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

Showing 6 changed files with 215 additions and 1 deletions Side-by-side Diff

arch/mips/dts/brcm,bcm6348.dtsi
  1 +/*
  2 + * Copyright (C) 2017 Álvaro Fernández Rojas <noltari@gmail.com>
  3 + *
  4 + * SPDX-License-Identifier: GPL-2.0+
  5 + */
  6 +
  7 +#include <dt-bindings/clock/bcm6348-clock.h>
  8 +#include <dt-bindings/gpio/gpio.h>
  9 +#include <dt-bindings/reset/bcm6348-reset.h>
  10 +#include "skeleton.dtsi"
  11 +
  12 +/ {
  13 + compatible = "brcm,bcm6348";
  14 +
  15 + cpus {
  16 + reg = <0xfffe0000 0x4>;
  17 + #address-cells = <1>;
  18 + #size-cells = <0>;
  19 + u-boot,dm-pre-reloc;
  20 +
  21 + cpu@0 {
  22 + compatible = "brcm,bcm6348-cpu", "mips,mips4Kc";
  23 + device_type = "cpu";
  24 + reg = <0>;
  25 + u-boot,dm-pre-reloc;
  26 + };
  27 + };
  28 +
  29 + clocks {
  30 + compatible = "simple-bus";
  31 + #address-cells = <1>;
  32 + #size-cells = <1>;
  33 + u-boot,dm-pre-reloc;
  34 +
  35 + periph_osc: periph-osc {
  36 + compatible = "fixed-clock";
  37 + #clock-cells = <0>;
  38 + clock-frequency = <50000000>;
  39 + u-boot,dm-pre-reloc;
  40 + };
  41 +
  42 + periph_clk: periph-clk {
  43 + compatible = "brcm,bcm6345-clk";
  44 + reg = <0xfffe0004 0x4>;
  45 + #clock-cells = <1>;
  46 + };
  47 + };
  48 +
  49 + pflash: nor@1fc00000 {
  50 + compatible = "cfi-flash";
  51 + reg = <0x1fc00000 0x2000000>;
  52 + bank-width = <2>;
  53 + #address-cells = <1>;
  54 + #size-cells = <1>;
  55 +
  56 + status = "disabled";
  57 + };
  58 +
  59 + ubus {
  60 + compatible = "simple-bus";
  61 + #address-cells = <1>;
  62 + #size-cells = <1>;
  63 + u-boot,dm-pre-reloc;
  64 +
  65 + pll_cntl: syscon@fffe0008 {
  66 + compatible = "syscon";
  67 + reg = <0xfffe0008 0x4>;
  68 + };
  69 +
  70 + syscon-reboot {
  71 + compatible = "syscon-reboot";
  72 + regmap = <&pll_cntl>;
  73 + offset = <0x0>;
  74 + mask = <0x1>;
  75 + };
  76 +
  77 + periph_rst: reset-controller@fffe0028 {
  78 + compatible = "brcm,bcm6345-reset";
  79 + reg = <0xfffe0028 0x4>;
  80 + #reset-cells = <1>;
  81 + };
  82 +
  83 + wdt: watchdog@fffe021c {
  84 + compatible = "brcm,bcm6345-wdt";
  85 + reg = <0xfffe021c 0xc>;
  86 + clocks = <&periph_osc>;
  87 + };
  88 +
  89 + wdt-reboot {
  90 + compatible = "wdt-reboot";
  91 + wdt = <&wdt>;
  92 + };
  93 +
  94 + uart0: serial@fffe0300 {
  95 + compatible = "brcm,bcm6345-uart";
  96 + reg = <0xfffe0300 0x18>;
  97 + clocks = <&periph_osc>;
  98 +
  99 + status = "disabled";
  100 + };
  101 +
  102 + gpio1: gpio-controller@fffe0400 {
  103 + compatible = "brcm,bcm6345-gpio";
  104 + reg = <0xfffe0400 0x4>, <0xfffe0408 0x4>;
  105 + gpio-controller;
  106 + #gpio-cells = <2>;
  107 + ngpios = <5>;
  108 +
  109 + status = "disabled";
  110 + };
  111 +
  112 + gpio0: gpio-controller@fffe0404 {
  113 + compatible = "brcm,bcm6345-gpio";
  114 + reg = <0xfffe0404 0x4>, <0xfffe040c 0x4>;
  115 + gpio-controller;
  116 + #gpio-cells = <2>;
  117 +
  118 + status = "disabled";
  119 + };
  120 +
  121 + memory-controller@fffe2300 {
  122 + compatible = "brcm,bcm6338-mc";
  123 + reg = <0xfffe2300 0x38>;
  124 + u-boot,dm-pre-reloc;
  125 + };
  126 + };
  127 +};
arch/mips/mach-bmips/Kconfig
... ... @@ -3,6 +3,7 @@
3 3  
4 4 config SYS_SOC
5 5 default "bcm6328" if SOC_BMIPS_BCM6328
  6 + default "bcm6348" if SOC_BMIPS_BCM6348
6 7 default "bcm6358" if SOC_BMIPS_BCM6358
7 8 default "bcm63268" if SOC_BMIPS_BCM63268
8 9  
... ... @@ -19,6 +20,17 @@
19 20 select SYSRESET_SYSCON
20 21 help
21 22 This supports BMIPS BCM6328 family including BCM63281 and BCM63283.
  23 +
  24 +config SOC_BMIPS_BCM6348
  25 + bool "BMIPS BCM6348 family"
  26 + select SUPPORTS_BIG_ENDIAN
  27 + select SUPPORTS_CPU_MIPS32_R1
  28 + select MIPS_TUNE_4KC
  29 + select MIPS_L1_CACHE_SHIFT_4
  30 + select SWAP_IO_SPACE
  31 + select SYSRESET_WATCHDOG
  32 + help
  33 + This supports BMIPS BCM6348 family.
22 34  
23 35 config SOC_BMIPS_BCM6358
24 36 bool "BMIPS BCM6358 family"
arch/mips/mach-bmips/include/ioremap.h
... ... @@ -18,7 +18,8 @@
18 18  
19 19 static inline int is_bmips_internal_registers(phys_addr_t offset)
20 20 {
21   -#if defined(CONFIG_SOC_BMIPS_BCM6358)
  21 +#if defined(CONFIG_SOC_BMIPS_BCM6348) || \
  22 + defined(CONFIG_SOC_BMIPS_BCM6358)
22 23 if (offset >= 0xfffe0000)
23 24 return 1;
24 25 #endif
include/configs/bmips_bcm6348.h
  1 +/*
  2 + * Copyright (C) 2017 Álvaro Fernández Rojas <noltari@gmail.com>
  3 + *
  4 + * SPDX-License-Identifier: GPL-2.0+
  5 + */
  6 +
  7 +#ifndef __CONFIG_BMIPS_BCM6348_H
  8 +#define __CONFIG_BMIPS_BCM6348_H
  9 +
  10 +/* CPU */
  11 +#define CONFIG_SYS_MIPS_TIMER_FREQ 128000000
  12 +
  13 +/* RAM */
  14 +#define CONFIG_NR_DRAM_BANKS 1
  15 +#define CONFIG_SYS_SDRAM_BASE 0x80000000
  16 +
  17 +/* U-Boot */
  18 +#define CONFIG_SYS_LOAD_ADDR CONFIG_SYS_SDRAM_BASE + 0x100000
  19 +
  20 +#if defined(CONFIG_BMIPS_BOOT_RAM)
  21 +#define CONFIG_SKIP_LOWLEVEL_INIT
  22 +#define CONFIG_SYS_INIT_SP_OFFSET 0x2000
  23 +#endif
  24 +
  25 +#define CONFIG_SYS_FLASH_BASE 0xbfc00000
  26 +#define CONFIG_SYS_FLASH_EMPTY_INFO
  27 +#define CONFIG_SYS_FLASH_PROTECTION
  28 +#define CONFIG_SYS_MAX_FLASH_BANKS_DETECT 1
  29 +
  30 +#endif /* __CONFIG_BMIPS_BCM6348_H */
include/dt-bindings/clock/bcm6348-clock.h
  1 +/*
  2 + * Copyright (C) 2017 Álvaro Fernández Rojas <noltari@gmail.com>
  3 + *
  4 + * Derived from linux/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
  5 + *
  6 + * SPDX-License-Identifier: GPL-2.0+
  7 + */
  8 +
  9 +#ifndef __DT_BINDINGS_CLOCK_BCM6348_H
  10 +#define __DT_BINDINGS_CLOCK_BCM6348_H
  11 +
  12 +#define BCM6348_CLK_ADSL 0
  13 +#define BCM6348_CLK_MPI 1
  14 +#define BCM6348_CLK_SDRAM 2
  15 +#define BCM6348_CLK_M2M 3
  16 +#define BCM6348_CLK_ENET 4
  17 +#define BCM6348_CLK_SAR 5
  18 +#define BCM6348_CLK_USBS 6
  19 +#define BCM6348_CLK_USBH 8
  20 +#define BCM6348_CLK_SPI 9
  21 +
  22 +#endif /* __DT_BINDINGS_CLOCK_BCM6348_H */
include/dt-bindings/reset/bcm6348-reset.h
  1 +/*
  2 + * Copyright (C) 2017 Álvaro Fernández Rojas <noltari@gmail.com>
  3 + *
  4 + * Derived from linux/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
  5 + *
  6 + * SPDX-License-Identifier: GPL-2.0+
  7 + */
  8 +
  9 +#ifndef __DT_BINDINGS_RESET_BCM6348_H
  10 +#define __DT_BINDINGS_RESET_BCM6348_H
  11 +
  12 +#define BCM6348_RST_SPI 0
  13 +#define BCM6348_RST_ENET 2
  14 +#define BCM6348_RST_USBH 3
  15 +#define BCM6348_RST_USBS 4
  16 +#define BCM6348_RST_ADSL 5
  17 +#define BCM6348_RST_DMAMEM 6
  18 +#define BCM6348_RST_SAR 7
  19 +#define BCM6348_RST_ACLC 8
  20 +#define BCM6348_RST_ADSL_MIPS 10
  21 +
  22 +#endif /* __DT_BINDINGS_RESET_BCM6348_H */