Skip to content
Snippets Groups Projects
Commit f46c2558 authored by Tom Rini's avatar Tom Rini
Browse files

Conflicts:
	arch/arm/Kconfig

Signed-off-by: default avatarTom Rini <trini@konsulko.com>
parents db18f548 f822d857
No related branches found
No related tags found
No related merge requests found
Showing
with 1371 additions and 114 deletions
...@@ -93,12 +93,14 @@ F: arch/arm/include/asm/arch-mx*/ ...@@ -93,12 +93,14 @@ F: arch/arm/include/asm/arch-mx*/
F: arch/arm/include/asm/arch-vf610/ F: arch/arm/include/asm/arch-vf610/
F: arch/arm/include/asm/imx-common/ F: arch/arm/include/asm/imx-common/
ARM MARVELL KIRKWOOD ARM MARVELL KIRKWOOD ARMADA-XP ARMADA-38X
M: Prafulla Wadaskar <prafulla@marvell.com> M: Prafulla Wadaskar <prafulla@marvell.com>
M: Luka Perkov <luka.perkov@sartura.hr> M: Luka Perkov <luka.perkov@sartura.hr>
M: Stefan Roese <sr@denx.de>
S: Maintained S: Maintained
T: git git://git.denx.de/u-boot-marvell.git T: git git://git.denx.de/u-boot-marvell.git
F: arch/arm/mach-kirkwood/ F: arch/arm/mach-kirkwood/
F: arch/arm/mach-mvebu/
ARM MARVELL PXA ARM MARVELL PXA
M: Marek Vasut <marex@denx.de> M: Marek Vasut <marex@denx.de>
......
...@@ -915,18 +915,8 @@ MKIMAGEFLAGS_u-boot.pbl = -n $(srctree)/$(CONFIG_SYS_FSL_PBL_RCW:"%"=%) \ ...@@ -915,18 +915,8 @@ MKIMAGEFLAGS_u-boot.pbl = -n $(srctree)/$(CONFIG_SYS_FSL_PBL_RCW:"%"=%) \
u-boot.img u-boot.kwb u-boot.pbl: u-boot.bin FORCE u-boot.img u-boot.kwb u-boot.pbl: u-boot.bin FORCE
$(call if_changed,mkimage) $(call if_changed,mkimage)
# If the kwboot xmodem protocol is used, to boot U-Boot on the MVEBU
# SoC's, the SPL U-Boot returns to the BootROM after it completes
# the SDRAM setup. The BootROM expects no U-Boot header in the main
# U-Boot image. So we need to combine SPL and u-boot.bin instead of
# u-boot.img in this case.
ifdef CONFIG_MVEBU_BOOTROM_UARTBOOT
u-boot-spl.kwb: u-boot-dtb.bin spl/u-boot-spl.bin FORCE
$(call if_changed,mkimage)
else
u-boot-spl.kwb: u-boot-dtb.img spl/u-boot-spl.bin FORCE u-boot-spl.kwb: u-boot-dtb.img spl/u-boot-spl.bin FORCE
$(call if_changed,mkimage) $(call if_changed,mkimage)
endif
MKIMAGEFLAGS_u-boot-dtb.img = $(MKIMAGEFLAGS_u-boot.img) MKIMAGEFLAGS_u-boot-dtb.img = $(MKIMAGEFLAGS_u-boot.img)
......
...@@ -5118,14 +5118,11 @@ If the system board that you have is not listed, then you will need ...@@ -5118,14 +5118,11 @@ If the system board that you have is not listed, then you will need
to port U-Boot to your hardware platform. To do this, follow these to port U-Boot to your hardware platform. To do this, follow these
steps: steps:
1. Add a new configuration option for your board to the toplevel 1. Create a new directory to hold your board specific code. Add any
"boards.cfg" file, using the existing entries as examples.
Follow the instructions there to keep the boards in order.
2. Create a new directory to hold your board specific code. Add any
files you need. In your board directory, you will need at least files you need. In your board directory, you will need at least
the "Makefile", a "<board>.c", "flash.c" and "u-boot.lds". the "Makefile" and a "<board>.c".
3. Create a new configuration file "include/configs/<board>.h" for 2. Create a new configuration file "include/configs/<board>.h" for
your board your board.
3. If you're porting U-Boot to a new CPU, then also create a new 3. If you're porting U-Boot to a new CPU, then also create a new
directory to hold your CPU specific code. Add any files you need. directory to hold your CPU specific code. Add any files you need.
4. Run "make <board>_defconfig" with your new name. 4. Run "make <board>_defconfig" with your new name.
......
...@@ -117,8 +117,14 @@ config ARCH_MVEBU ...@@ -117,8 +117,14 @@ config ARCH_MVEBU
select OF_CONTROL select OF_CONTROL
select OF_SEPARATE select OF_SEPARATE
select DM select DM
select DM_ETH
select DM_SERIAL select DM_SERIAL
select DM_SPI
select DM_SPI_FLASH
select SPL_DM
select SPL_DM_SEQ_ALIAS select SPL_DM_SEQ_ALIAS
select SPL_OF_CONTROL
select SPL_SIMPLE_BUS
config TARGET_DEVKIT3250 config TARGET_DEVKIT3250
bool "Support devkit3250" bool "Support devkit3250"
...@@ -770,8 +776,6 @@ source "board/BuR/kwb/Kconfig" ...@@ -770,8 +776,6 @@ source "board/BuR/kwb/Kconfig"
source "board/BuR/tseries/Kconfig" source "board/BuR/tseries/Kconfig"
source "board/CarMediaLab/flea3/Kconfig" source "board/CarMediaLab/flea3/Kconfig"
source "board/Marvell/aspenite/Kconfig" source "board/Marvell/aspenite/Kconfig"
source "board/Marvell/db-88f6820-gp/Kconfig"
source "board/Marvell/db-mv784mp-gp/Kconfig"
source "board/Marvell/gplugd/Kconfig" source "board/Marvell/gplugd/Kconfig"
source "board/armadeus/apf27/Kconfig" source "board/armadeus/apf27/Kconfig"
source "board/armltd/vexpress/Kconfig" source "board/armltd/vexpress/Kconfig"
...@@ -810,7 +814,6 @@ source "board/h2200/Kconfig" ...@@ -810,7 +814,6 @@ source "board/h2200/Kconfig"
source "board/hisilicon/hikey/Kconfig" source "board/hisilicon/hikey/Kconfig"
source "board/imx31_phycore/Kconfig" source "board/imx31_phycore/Kconfig"
source "board/isee/igep0033/Kconfig" source "board/isee/igep0033/Kconfig"
source "board/maxbcm/Kconfig"
source "board/mpl/vcma9/Kconfig" source "board/mpl/vcma9/Kconfig"
source "board/olimex/mx23_olinuxino/Kconfig" source "board/olimex/mx23_olinuxino/Kconfig"
source "board/phytec/pcm051/Kconfig" source "board/phytec/pcm051/Kconfig"
......
...@@ -49,7 +49,7 @@ machine-$(CONFIG_ARCH_HIGHBANK) += highbank ...@@ -49,7 +49,7 @@ machine-$(CONFIG_ARCH_HIGHBANK) += highbank
machine-$(CONFIG_ARCH_KEYSTONE) += keystone machine-$(CONFIG_ARCH_KEYSTONE) += keystone
# TODO: rename CONFIG_KIRKWOOD -> CONFIG_ARCH_KIRKWOOD # TODO: rename CONFIG_KIRKWOOD -> CONFIG_ARCH_KIRKWOOD
machine-$(CONFIG_KIRKWOOD) += kirkwood machine-$(CONFIG_KIRKWOOD) += kirkwood
machine-$(CONFIG_ARMADA_XP) += mvebu machine-$(CONFIG_ARCH_MVEBU) += mvebu
# TODO: rename CONFIG_TEGRA -> CONFIG_ARCH_TEGRA # TODO: rename CONFIG_TEGRA -> CONFIG_ARCH_TEGRA
# TODO: rename CONFIG_ORION5X -> CONFIG_ARCH_ORION5X # TODO: rename CONFIG_ORION5X -> CONFIG_ARCH_ORION5X
machine-$(CONFIG_ORION5X) += orion5x machine-$(CONFIG_ORION5X) += orion5x
......
...@@ -48,8 +48,11 @@ dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \ ...@@ -48,8 +48,11 @@ dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \
tegra210-p2571.dtb tegra210-p2571.dtb
dtb-$(CONFIG_ARCH_MVEBU) += \ dtb-$(CONFIG_ARCH_MVEBU) += \
armada-388-clearfog.dtb \
armada-388-gp.dtb \ armada-388-gp.dtb \
armada-xp-gp.dtb armada-xp-gp.dtb \
armada-xp-maxbcm.dtb \
armada-xp-synology-ds414.dtb
dtb-$(CONFIG_ARCH_UNIPHIER) += \ dtb-$(CONFIG_ARCH_UNIPHIER) += \
uniphier-ph1-ld4-ref.dtb \ uniphier-ph1-ld4-ref.dtb \
......
...@@ -141,6 +141,7 @@ ...@@ -141,6 +141,7 @@
#address-cells = <1>; #address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;
ranges = <0 MBUS_ID(0xf0, 0x01) 0 0x100000>; ranges = <0 MBUS_ID(0xf0, 0x01) 0 0x100000>;
u-boot,dm-pre-reloc;
rtc@10300 { rtc@10300 {
compatible = "marvell,orion-rtc"; compatible = "marvell,orion-rtc";
......
/*
* Device Tree file for SolidRun Clearfog revision A1 rev 2.0 (88F6828)
*
* Copyright (C) 2015 Russell King
*
* This board is in development; the contents of this file work with
* the A1 rev 2.0 of the board, which does not represent final
* production board. Things will change, don't expect this file to
* remain compatible info the future.
*
* This file is dual-licensed: you can use it either under the terms
* of the GPL or the X11 license, at your option. Note that this dual
* licensing only applies to this file, and not this project as a
* whole.
*
* a) This file is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*
* This file is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* Or, alternatively
*
* b) Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use
* copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
/dts-v1/;
#include <dt-bindings/input/input.h>
#include <dt-bindings/gpio/gpio.h>
#include "armada-388.dtsi"
/ {
model = "SolidRun Clearfog A1";
compatible = "solidrun,clearfog-a1", "marvell,armada388",
"marvell,armada385", "marvell,armada380";
aliases {
/* So that mvebu u-boot can update the MAC addresses */
ethernet1 = &eth0;
ethernet2 = &eth1;
ethernet3 = &eth2;
};
chosen {
stdout-path = "serial0:115200n8";
};
memory {
device_type = "memory";
reg = <0x00000000 0x10000000>; /* 256 MB */
};
reg_3p3v: regulator-3p3v {
compatible = "regulator-fixed";
regulator-name = "3P3V";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-always-on;
};
soc {
ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000
MBUS_ID(0x09, 0x19) 0 0xf1100000 0x10000
MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000>;
internal-regs {
ethernet@30000 {
mac-address = [00 50 43 02 02 02];
phy-mode = "sgmii";
status = "okay";
fixed-link {
speed = <1000>;
full-duplex;
};
};
ethernet@34000 {
mac-address = [00 50 43 02 02 03];
managed = "in-band-status";
phy-mode = "sgmii";
status = "okay";
};
ethernet@70000 {
mac-address = [00 50 43 02 02 01];
pinctrl-0 = <&ge0_rgmii_pins>;
pinctrl-names = "default";
phy = <&phy_dedicated>;
phy-mode = "rgmii-id";
status = "okay";
};
i2c@11000 {
/* Is there anything on this? */
clock-frequency = <100000>;
pinctrl-0 = <&i2c0_pins>;
pinctrl-names = "default";
status = "okay";
/*
* PCA9655 GPIO expander, up to 1MHz clock.
* 0-CON3 CLKREQ#
* 1-CON3 PERST#
* 2-CON2 PERST#
* 3-CON3 W_DISABLE
* 4-CON2 CLKREQ#
* 5-USB3 overcurrent
* 6-USB3 power
* 7-CON2 W_DISABLE
* 8-JP4 P1
* 9-JP4 P4
* 10-JP4 P5
* 11-m.2 DEVSLP
* 12-SFP_LOS
* 13-SFP_TX_FAULT
* 14-SFP_TX_DISABLE
* 15-SFP_MOD_DEF0
*/
expander0: gpio-expander@20 {
/*
* This is how it should be:
* compatible = "onnn,pca9655",
* "nxp,pca9555";
* but you can't do this because of
* the way I2C works.
*/
compatible = "nxp,pca9555";
gpio-controller;
#gpio-cells = <2>;
reg = <0x20>;
pcie1_0_clkreq {
gpio-hog;
gpios = <0 GPIO_ACTIVE_LOW>;
input;
line-name = "pcie1.0-clkreq";
};
pcie1_0_w_disable {
gpio-hog;
gpios = <3 GPIO_ACTIVE_LOW>;
output-low;
line-name = "pcie1.0-w-disable";
};
pcie2_0_clkreq {
gpio-hog;
gpios = <4 GPIO_ACTIVE_LOW>;
input;
line-name = "pcie2.0-clkreq";
};
pcie2_0_w_disable {
gpio-hog;
gpios = <7 GPIO_ACTIVE_LOW>;
output-low;
line-name = "pcie2.0-w-disable";
};
usb3_ilimit {
gpio-hog;
gpios = <5 GPIO_ACTIVE_LOW>;
input;
line-name = "usb3-current-limit";
};
usb3_power {
gpio-hog;
gpios = <6 GPIO_ACTIVE_HIGH>;
output-high;
line-name = "usb3-power";
};
m2_devslp {
gpio-hog;
gpios = <11 GPIO_ACTIVE_HIGH>;
output-low;
line-name = "m.2 devslp";
};
};
/* The MCP3021 is 100kHz clock only */
mikrobus_adc: mcp3021@4c {
compatible = "microchip,mcp3021";
reg = <0x4c>;
};
/* Also something at 0x64 */
};
i2c@11100 {
/*
* Routed to SFP, mikrobus, and PCIe.
* SFP limits this to 100kHz, and requires
* an AT24C01A/02/04 with address pins tied
* low, which takes addresses 0x50 and 0x51.
* Mikrobus doesn't specify beyond an I2C
* bus being present.
* PCIe uses ARP to assign addresses, or
* 0x63-0x64.
*/
clock-frequency = <100000>;
pinctrl-0 = <&clearfog_i2c1_pins>;
pinctrl-names = "default";
status = "okay";
};
mdio@72004 {
pinctrl-0 = <&mdio_pins>;
pinctrl-names = "default";
phy_dedicated: ethernet-phy@0 {
/*
* Annoyingly, the marvell phy driver
* configures the LED register, rather
* than preserving reset-loaded setting.
* We undo that rubbish here.
*/
marvell,reg-init = <3 16 0 0x101e>;
reg = <0>;
};
};
pinctrl@18000 {
clearfog_dsa0_clk_pins: clearfog-dsa0-clk-pins {
marvell,pins = "mpp46";
marvell,function = "ref";
};
clearfog_dsa0_pins: clearfog-dsa0-pins {
marvell,pins = "mpp23", "mpp41";
marvell,function = "gpio";
};
clearfog_i2c1_pins: i2c1-pins {
/* SFP, PCIe, mSATA, mikrobus */
marvell,pins = "mpp26", "mpp27";
marvell,function = "i2c1";
};
clearfog_sdhci_cd_pins: clearfog-sdhci-cd-pins {
marvell,pins = "mpp20";
marvell,function = "gpio";
};
clearfog_sdhci_pins: clearfog-sdhci-pins {
marvell,pins = "mpp21", "mpp28",
"mpp37", "mpp38",
"mpp39", "mpp40";
marvell,function = "sd0";
};
clearfog_spi1_cs_pins: spi1-cs-pins {
marvell,pins = "mpp55";
marvell,function = "spi1";
};
mikro_pins: mikro-pins {
/* int: mpp22 rst: mpp29 */
marvell,pins = "mpp22", "mpp29";
marvell,function = "gpio";
};
mikro_spi_pins: mikro-spi-pins {
marvell,pins = "mpp43";
marvell,function = "spi1";
};
mikro_uart_pins: mikro-uart-pins {
marvell,pins = "mpp24", "mpp25";
marvell,function = "ua1";
};
rear_button_pins: rear-button-pins {
marvell,pins = "mpp34";
marvell,function = "gpio";
};
};
rtc@a3800 {
/*
* If the rtc doesn't work, run "date reset"
* twice in u-boot.
*/
status = "okay";
};
sata@a8000 {
/* pinctrl? */
status = "okay";
};
sata@e0000 {
/* pinctrl? */
status = "okay";
};
sdhci@d8000 {
bus-width = <4>;
cd-gpios = <&gpio0 20 GPIO_ACTIVE_LOW>;
no-1-8-v;
pinctrl-0 = <&clearfog_sdhci_pins
&clearfog_sdhci_cd_pins>;
pinctrl-names = "default";
status = "okay";
vmmc = <&reg_3p3v>;
wp-inverted;
};
serial@12000 {
pinctrl-0 = <&uart0_pins>;
pinctrl-names = "default";
status = "okay";
u-boot,dm-pre-reloc;
};
serial@12100 {
/* mikrobus uart */
pinctrl-0 = <&mikro_uart_pins>;
pinctrl-names = "default";
status = "okay";
};
spi@10680 {
/*
* We don't seem to have the W25Q32 on the
* A1 Rev 2.0 boards, so disable SPI.
* CS0: W25Q32 (doesn't appear to be present)
* CS1:
* CS2: mikrobus
*/
pinctrl-0 = <&spi1_pins &clearfog_spi1_cs_pins &mikro_spi_pins>;
pinctrl-names = "default";
status = "okay";
spi-flash@0 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "w25q32", "jedec,spi-nor";
reg = <0>; /* Chip select 0 */
spi-max-frequency = <3000000>;
status = "disabled";
};
};
usb3@f8000 {
status = "okay";
};
};
pcie-controller {
status = "okay";
/*
* The two PCIe units are accessible through
* the mini-PCIe connectors on the board.
*/
pcie@2,0 {
/* Port 1, Lane 0. CONN3, nearest power. */
reset-gpios = <&expander0 1 GPIO_ACTIVE_LOW>;
status = "okay";
};
pcie@3,0 {
/* Port 2, Lane 0. CONN2, nearest CPU. */
reset-gpios = <&expander0 2 GPIO_ACTIVE_LOW>;
status = "okay";
};
};
};
sfp: sfp {
compatible = "sff,sfp";
i2c-bus = <&i2c1>;
los-gpio = <&expander0 12 GPIO_ACTIVE_HIGH>;
moddef0-gpio = <&expander0 15 GPIO_ACTIVE_LOW>;
sfp,ethernet = <&eth2>;
tx-disable-gpio = <&expander0 14 GPIO_ACTIVE_HIGH>;
tx-fault-gpio = <&expander0 13 GPIO_ACTIVE_HIGH>;
};
dsa@0 {
compatible = "marvell,dsa";
dsa,ethernet = <&eth1>;
dsa,mii-bus = <&mdio>;
pinctrl-0 = <&clearfog_dsa0_clk_pins &clearfog_dsa0_pins>;
pinctrl-names = "default";
#address-cells = <2>;
#size-cells = <0>;
switch@0 {
#address-cells = <1>;
#size-cells = <0>;
reg = <4 0>;
port@0 {
reg = <0>;
label = "lan1";
};
port@1 {
reg = <1>;
label = "lan2";
};
port@2 {
reg = <2>;
label = "lan3";
};
port@3 {
reg = <3>;
label = "lan4";
};
port@4 {
reg = <4>;
label = "lan5";
};
port@5 {
reg = <5>;
label = "cpu";
};
port@6 {
/* 88E1512 external phy */
reg = <6>;
label = "lan6";
fixed-link {
speed = <1000>;
full-duplex;
};
};
};
};
gpio-keys {
compatible = "gpio-keys";
pinctrl-0 = <&rear_button_pins>;
pinctrl-names = "default";
button_0 {
/* The rear SW3 button */
label = "Rear Button";
gpios = <&gpio1 2 GPIO_ACTIVE_LOW>;
linux,can-disable;
linux,code = <BTN_0>;
};
};
};
/*
+#define A38x_CUSTOMER_BOARD_1_MPP16_23 0x00400011
MPP18: gpio ? (pca9655 int?)
MPP19: gpio ? (clkreq?)
MPP20: gpio ? (sd0 detect)
MPP21: sd0:cmd x sd0
MPP22: gpio x mikro int
MPP23: gpio x switch irq
+#define A38x_CUSTOMER_BOARD_1_MPP24_31 0x22043333
MPP24: ua1:rxd x mikro rx
MPP25: ua1:txd x mikro tx
MPP26: i2c1:sck x mikro sck
MPP27: i2c1:sda x mikro sda
MPP28: sd0:clk x sd0
MPP29: gpio x mikro rst
MPP30: ge1:txd2 ? (config)
MPP31: ge1:txd3 ? (config)
+#define A38x_CUSTOMER_BOARD_1_MPP32_39 0x44400002
MPP32: ge1:txctl ? (unused)
MPP33: gpio ? (pic_com0)
MPP34: gpio x rear button (pic_com1)
MPP35: gpio ? (pic_com2)
MPP36: gpio ? (unused)
MPP37: sd0:d3 x sd0
MPP38: sd0:d0 x sd0
MPP39: sd0:d1 x sd0
+#define A38x_CUSTOMER_BOARD_1_MPP40_47 0x41144004
MPP40: sd0:d2 x sd0
MPP41: gpio x switch reset
MPP42: gpio ? sw1-1
MPP43: spi1:cs2 x mikro cs
MPP44: sata3:prsnt ? (unused)
MPP45: ref:clk_out0 ?
MPP46: ref:clk_out1 x switch clk
MPP47: 4 ? (unused)
+#define A38x_CUSTOMER_BOARD_1_MPP48_55 0x40333333
MPP48: tdm:pclk
MPP49: tdm:fsync
MPP50: tdm:drx
MPP51: tdm:dtx
MPP52: tdm:int
MPP53: tdm:rst
MPP54: gpio ? (pwm)
MPP55: spi1:cs1 x slic
+#define A38x_CUSTOMER_BOARD_1_MPP56_63 0x00004444
MPP56: spi1:mosi x mikro mosi
MPP57: spi1:sck x mikro sck
MPP58: spi1:miso x mikro miso
MPP59: spi1:cs0 x w25q32
*/
...@@ -51,6 +51,12 @@ ...@@ -51,6 +51,12 @@
stdout-path = "serial0:115200n8"; stdout-path = "serial0:115200n8";
}; };
aliases {
ethernet0 = &eth0;
ethernet1 = &eth1;
spi0 = &spi0;
};
memory { memory {
device_type = "memory"; device_type = "memory";
reg = <0x00000000 0x80000000>; /* 2 GB */ reg = <0x00000000 0x80000000>; /* 2 GB */
...@@ -65,8 +71,10 @@ ...@@ -65,8 +71,10 @@
pinctrl-names = "default"; pinctrl-names = "default";
pinctrl-0 = <&spi0_pins>; pinctrl-0 = <&spi0_pins>;
status = "okay"; status = "okay";
u-boot,dm-pre-reloc;
spi-flash@0 { spi-flash@0 {
u-boot,dm-pre-reloc;
#address-cells = <1>; #address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;
compatible = "st,m25p128", "jedec,spi-nor"; compatible = "st,m25p128", "jedec,spi-nor";
...@@ -122,6 +130,7 @@ ...@@ -122,6 +130,7 @@
pinctrl-names = "default"; pinctrl-names = "default";
pinctrl-0 = <&uart0_pins>; pinctrl-0 = <&uart0_pins>;
status = "okay"; status = "okay";
u-boot,dm-pre-reloc;
}; };
/* GE1 CON15 */ /* GE1 CON15 */
......
...@@ -70,6 +70,7 @@ ...@@ -70,6 +70,7 @@
soc { soc {
compatible = "marvell,armada380-mbus", "simple-bus"; compatible = "marvell,armada380-mbus", "simple-bus";
u-boot,dm-pre-reloc;
#address-cells = <2>; #address-cells = <2>;
#size-cells = <1>; #size-cells = <1>;
controller = <&mbusc>; controller = <&mbusc>;
...@@ -134,6 +135,7 @@ ...@@ -134,6 +135,7 @@
internal-regs { internal-regs {
compatible = "simple-bus"; compatible = "simple-bus";
u-boot,dm-pre-reloc;
#address-cells = <1>; #address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;
ranges = <0 MBUS_ID(0xf0, 0x01) 0 0x100000>; ranges = <0 MBUS_ID(0xf0, 0x01) 0 0x100000>;
......
...@@ -68,6 +68,10 @@ ...@@ -68,6 +68,10 @@
stdout-path = "serial0:115200n8"; stdout-path = "serial0:115200n8";
}; };
aliases {
spi0 = &spi0;
};
memory { memory {
device_type = "memory"; device_type = "memory";
/* /*
...@@ -148,6 +152,7 @@ ...@@ -148,6 +152,7 @@
internal-regs { internal-regs {
serial@12000 { serial@12000 {
status = "okay"; status = "okay";
u-boot,dm-pre-reloc;
}; };
serial@12100 { serial@12100 {
status = "okay"; status = "okay";
...@@ -223,8 +228,10 @@ ...@@ -223,8 +228,10 @@
spi0: spi@10600 { spi0: spi@10600 {
status = "okay"; status = "okay";
u-boot,dm-pre-reloc;
spi-flash@0 { spi-flash@0 {
u-boot,dm-pre-reloc;
#address-cells = <1>; #address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;
compatible = "n25q128a13", "jedec,spi-nor"; compatible = "n25q128a13", "jedec,spi-nor";
......
/*
* Device Tree file for Marvell Armada XP maxbcm board
*
* Copyright (C) 2013-2014 Marvell
*
* Lior Amsalem <alior@marvell.com>
* Gregory CLEMENT <gregory.clement@free-electrons.com>
* Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
*
* This file is dual-licensed: you can use it either under the terms
* of the GPL or the X11 license, at your option. Note that this dual
* licensing only applies to this file, and not this project as a
* whole.
*
* a) This file is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This file is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* Or, alternatively
*
* b) Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use
* copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Note: this Device Tree assumes that the bootloader has remapped the
* internal registers to 0xf1000000 (instead of the default
* 0xd0000000). The 0xf1000000 is the default used by the recent,
* DT-capable, U-Boot bootloaders provided by Marvell. Some earlier
* boards were delivered with an older version of the bootloader that
* left internal registers mapped at 0xd0000000. If you are in this
* situation, you should either update your bootloader (preferred
* solution) or the below Device Tree should be adjusted.
*/
/dts-v1/;
#include <dt-bindings/gpio/gpio.h>
#include "armada-xp-mv78460.dtsi"
/ {
model = "Marvell Armada XP MAXBCM";
compatible = "marvell,axp-gp", "marvell,armadaxp-mv78460", "marvell,armadaxp", "marvell,armada-370-xp";
chosen {
stdout-path = "serial0:115200n8";
};
aliases {
spi0 = &spi0;
};
memory {
device_type = "memory";
/*
* 8 GB of plug-in RAM modules by default.The amount
* of memory available can be changed by the
* bootloader according the size of the module
* actually plugged. However, memory between
* 0xF0000000 to 0xFFFFFFFF cannot be used, as it is
* the address range used for I/O (internal registers,
* MBus windows).
*/
reg = <0x00000000 0x00000000 0x00000000 0xf0000000>,
<0x00000001 0x00000000 0x00000001 0x00000000>;
};
cpus {
pm_pic {
ctrl-gpios = <&gpio0 16 GPIO_ACTIVE_LOW>,
<&gpio0 17 GPIO_ACTIVE_LOW>,
<&gpio0 18 GPIO_ACTIVE_LOW>;
};
};
soc {
ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xf1000000 0x100000
MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000
MBUS_ID(0x01, 0x2f) 0 0 0xf0000000 0x1000000>;
devbus-bootcs {
status = "okay";
/* Device Bus parameters are required */
/* Read parameters */
devbus,bus-width = <16>;
devbus,turn-off-ps = <60000>;
devbus,badr-skew-ps = <0>;
devbus,acc-first-ps = <124000>;
devbus,acc-next-ps = <248000>;
devbus,rd-setup-ps = <0>;
devbus,rd-hold-ps = <0>;
/* Write parameters */
devbus,sync-enable = <0>;
devbus,wr-high-ps = <60000>;
devbus,wr-low-ps = <60000>;
devbus,ale-wr-ps = <60000>;
/* NOR 16 MiB */
nor@0 {
compatible = "cfi-flash";
reg = <0 0x1000000>;
bank-width = <2>;
};
};
pcie-controller {
status = "okay";
/*
* The 3 slots are physically present as
* standard PCIe slots on the board.
*/
pcie@1,0 {
/* Port 0, Lane 0 */
status = "okay";
};
pcie@9,0 {
/* Port 2, Lane 0 */
status = "okay";
};
pcie@10,0 {
/* Port 3, Lane 0 */
status = "okay";
};
};
internal-regs {
serial@12000 {
status = "okay";
u-boot,dm-pre-reloc;
};
serial@12100 {
status = "okay";
};
serial@12200 {
status = "okay";
};
serial@12300 {
status = "okay";
};
pinctrl {
pinctrl-0 = <&pic_pins>;
pinctrl-names = "default";
pic_pins: pic-pins-0 {
marvell,pins = "mpp16", "mpp17",
"mpp18";
marvell,function = "gpio";
};
};
sata@a0000 {
nr-ports = <2>;
status = "okay";
};
mdio {
phy0: ethernet-phy@0 {
reg = <0>;
};
phy1: ethernet-phy@1 {
reg = <1>;
};
phy2: ethernet-phy@2 {
reg = <2>;
};
phy3: ethernet-phy@3 {
reg = <3>;
};
};
ethernet@70000 {
status = "okay";
phy = <&phy0>;
phy-mode = "sgmii";
};
ethernet@74000 {
status = "okay";
phy = <&phy1>;
phy-mode = "sgmii";
};
ethernet@30000 {
status = "okay";
phy = <&phy2>;
phy-mode = "sgmii";
};
ethernet@34000 {
status = "okay";
phy = <&phy3>;
phy-mode = "sgmii";
};
/* Front-side USB slot */
usb@50000 {
status = "okay";
};
/* Back-side USB slot */
usb@51000 {
status = "okay";
};
spi0: spi@10600 {
status = "okay";
spi-flash@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "n25q128a13", "jedec,spi-nor";
reg = <0>; /* Chip select 0 */
spi-max-frequency = <108000000>;
};
};
nand@d0000 {
status = "okay";
num-cs = <1>;
marvell,nand-keep-config;
marvell,nand-enable-arbiter;
nand-on-flash-bbt;
};
};
};
};
/*
* Device Tree file for Synology DS414
*
* Copyright (C) 2014, Arnaud EBALARD <arno@natisbad.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* Note: this Device Tree assumes that the bootloader has remapped the
* internal registers to 0xf1000000 (instead of the old 0xd0000000).
* The 0xf1000000 is the default used by the recent, DT-capable, U-Boot
* bootloaders provided by Marvell. It is used in recent versions of
* DSM software provided by Synology. Nonetheless, some earlier boards
* were delivered with an older version of u-boot that left internal
* registers mapped at 0xd0000000. If you have such a device you will
* not be able to directly boot a kernel based on this Device Tree. In
* that case, the preferred solution is to update your bootloader (e.g.
* by upgrading to latest version of DSM, or building a new one and
* installing it from u-boot prompt) or adjust the Devive Tree
* (s/0xf1000000/0xd0000000/ in 'ranges' below).
*/
/dts-v1/;
#include <dt-bindings/input/input.h>
#include <dt-bindings/gpio/gpio.h>
#include "armada-xp-mv78230.dtsi"
/ {
model = "Synology DS414";
compatible = "synology,ds414", "marvell,armadaxp-mv78230",
"marvell,armadaxp", "marvell,armada-370-xp";
chosen {
bootargs = "console=ttyS0,115200 earlyprintk";
stdout-path = &uart0;
};
aliases {
spi0 = &spi0;
};
memory {
device_type = "memory";
reg = <0 0x00000000 0 0x40000000>; /* 1GB */
};
soc {
ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xf1000000 0x100000
MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000>;
pcie-controller {
status = "okay";
/*
* Connected to Marvell 88SX7042 SATA-II controller
* handling the four disks.
*/
pcie@1,0 {
/* Port 0, Lane 0 */
status = "okay";
};
/*
* Connected to EtronTech EJ168A XHCI controller
* providing the two rear USB 3.0 ports.
*/
pcie@5,0 {
/* Port 1, Lane 0 */
status = "okay";
};
};
internal-regs {
/* RTC is provided by Seiko S-35390A below */
rtc@10300 {
status = "disabled";
};
spi0: spi@10600 {
status = "okay";
u-boot,dm-pre-reloc;
spi-flash@0 {
u-boot,dm-pre-reloc;
#address-cells = <1>;
#size-cells = <1>;
compatible = "micron,n25q064";
reg = <0>; /* Chip select 0 */
spi-max-frequency = <20000000>;
/*
* Warning!
*
* Synology u-boot uses its compiled-in environment
* and it seems Synology did not care to change u-boot
* default configuration in order to allow saving a
* modified environment at a sensible location. So,
* if you do a 'saveenv' under u-boot, your modified
* environment will be saved at 1MB after the start
* of the flash, i.e. in the middle of the uImage.
* For that reason, it is strongly advised not to
* change the default environment, unless you know
* what you are doing.
*/
partition@00000000 { /* u-boot */
label = "RedBoot";
reg = <0x00000000 0x000d0000>; /* 832KB */
};
partition@000c0000 { /* uImage */
label = "zImage";
reg = <0x000d0000 0x002d0000>; /* 2880KB */
};
partition@003a0000 { /* uInitramfs */
label = "rd.gz";
reg = <0x003a0000 0x00430000>; /* 4250KB */
};
partition@007d0000 { /* MAC address and serial number */
label = "vendor";
reg = <0x007d0000 0x00010000>; /* 64KB */
};
partition@007e0000 {
label = "RedBoot config";
reg = <0x007e0000 0x00010000>; /* 64KB */
};
partition@007f0000 {
label = "FIS directory";
reg = <0x007f0000 0x00010000>; /* 64KB */
};
};
};
i2c@11000 {
clock-frequency = <400000>;
status = "okay";
s35390a: s35390a@30 {
compatible = "sii,s35390a";
reg = <0x30>;
};
};
/* Connected to a header on device's PCB. This
* provides the main console for the device.
*
* Warning: the device may not boot with a 3.3V
* USB-serial converter connected when the power
* button is pressed. The converter needs to be
* connected a few seconds after pressing the
* power button. This is possibly due to UART0_TXD
* pin being sampled at reset (bit 0 of SAR).
*/
serial@12000 {
status = "okay";
u-boot,dm-pre-reloc;
};
/* Connected to a Microchip PIC16F883 for power control */
serial@12100 {
status = "okay";
};
poweroff@12100 {
compatible = "synology,power-off";
reg = <0x12100 0x100>;
clocks = <&coreclk 0>;
};
/* Front USB 2.0 port */
usb@50000 {
status = "okay";
};
mdio {
phy0: ethernet-phy@0 { /* Marvell 88E1512 */
reg = <0>;
};
phy1: ethernet-phy@1 { /* Marvell 88E1512 */
reg = <1>;
};
};
ethernet@70000 {
status = "okay";
pinctrl-0 = <&ge0_rgmii_pins>;
pinctrl-names = "default";
phy = <&phy1>;
phy-mode = "rgmii-id";
};
ethernet@74000 {
pinctrl-0 = <&ge1_rgmii_pins>;
pinctrl-names = "default";
status = "okay";
phy = <&phy0>;
phy-mode = "rgmii-id";
};
};
};
regulators {
compatible = "simple-bus";
#address-cells = <1>;
#size-cells = <0>;
pinctrl-0 = <&sata1_pwr_pin &sata2_pwr_pin
&sata3_pwr_pin &sata4_pwr_pin>;
pinctrl-names = "default";
sata1_regulator: sata1-regulator {
compatible = "regulator-fixed";
reg = <1>;
regulator-name = "SATA1 Power";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
startup-delay-us = <2000000>;
enable-active-high;
regulator-always-on;
regulator-boot-on;
gpio = <&gpio1 10 GPIO_ACTIVE_HIGH>;
};
sata2_regulator: sata2-regulator {
compatible = "regulator-fixed";
reg = <2>;
regulator-name = "SATA2 Power";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
startup-delay-us = <4000000>;
enable-active-high;
regulator-always-on;
regulator-boot-on;
gpio = <&gpio1 12 GPIO_ACTIVE_HIGH>;
};
sata3_regulator: sata3-regulator {
compatible = "regulator-fixed";
reg = <3>;
regulator-name = "SATA3 Power";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
startup-delay-us = <6000000>;
enable-active-high;
regulator-always-on;
regulator-boot-on;
gpio = <&gpio1 13 GPIO_ACTIVE_HIGH>;
};
sata4_regulator: sata4-regulator {
compatible = "regulator-fixed";
reg = <4>;
regulator-name = "SATA4 Power";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
startup-delay-us = <8000000>;
enable-active-high;
regulator-always-on;
regulator-boot-on;
gpio = <&gpio1 14 GPIO_ACTIVE_HIGH>;
};
};
};
&pinctrl {
sata1_pwr_pin: sata1-pwr-pin {
marvell,pins = "mpp42";
marvell,function = "gpio";
};
sata2_pwr_pin: sata2-pwr-pin {
marvell,pins = "mpp44";
marvell,function = "gpio";
};
sata3_pwr_pin: sata3-pwr-pin {
marvell,pins = "mpp45";
marvell,function = "gpio";
};
sata4_pwr_pin: sata4-pwr-pin {
marvell,pins = "mpp46";
marvell,function = "gpio";
};
sata1_pres_pin: sata1-pres-pin {
marvell,pins = "mpp34";
marvell,function = "gpio";
};
sata2_pres_pin: sata2-pres-pin {
marvell,pins = "mpp35";
marvell,function = "gpio";
};
sata3_pres_pin: sata3-pres-pin {
marvell,pins = "mpp40";
marvell,function = "gpio";
};
sata4_pres_pin: sata4-pres-pin {
marvell,pins = "mpp41";
marvell,function = "gpio";
};
syno_id_bit0_pin: syno-id-bit0-pin {
marvell,pins = "mpp26";
marvell,function = "gpio";
};
syno_id_bit1_pin: syno-id-bit1-pin {
marvell,pins = "mpp28";
marvell,function = "gpio";
};
syno_id_bit2_pin: syno-id-bit2-pin {
marvell,pins = "mpp29";
marvell,function = "gpio";
};
fan1_alarm_pin: fan1-alarm-pin {
marvell,pins = "mpp33";
marvell,function = "gpio";
};
fan2_alarm_pin: fan2-alarm-pin {
marvell,pins = "mpp32";
marvell,function = "gpio";
};
};
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
soc { soc {
compatible = "marvell,armadaxp-mbus", "simple-bus"; compatible = "marvell,armadaxp-mbus", "simple-bus";
u-boot,dm-pre-reloc;
bootrom { bootrom {
compatible = "marvell,bootrom"; compatible = "marvell,bootrom";
......
...@@ -135,4 +135,9 @@ ...@@ -135,4 +135,9 @@
#define CONFIG_SYS_I2C_SPEED 100000 #define CONFIG_SYS_I2C_SPEED 100000
#endif #endif
/* Use common timer */
#define CONFIG_SYS_TIMER_COUNTS_DOWN
#define CONFIG_SYS_TIMER_COUNTER (MVEBU_TIMER_BASE + 0x14)
#define CONFIG_SYS_TIMER_RATE CONFIG_SYS_TCLK
#endif /* _KW_CONFIG_H */ #endif /* _KW_CONFIG_H */
if ARCH_MVEBU if ARCH_MVEBU
config ARMADA_38X
bool
config ARMADA_XP
bool
config MV78230
bool
select ARMADA_XP
config MV78260
bool
select ARMADA_XP
config MV78460
bool
select ARMADA_XP
config DB_88F6820_GP
bool
select ARMADA_38X
choice choice
prompt "Marvell MVEBU (Armada XP/38x) board select" prompt "Marvell MVEBU (Armada XP/38x) board select"
optional optional
config TARGET_CLEARFOG
bool "Support ClearFog"
select DB_88F6820_GP
config TARGET_DB_88F6820_GP config TARGET_DB_88F6820_GP
bool "Support DB-88F6820-GP" bool "Support DB-88F6820-GP"
select DB_88F6820_GP
config TARGET_DB_MV784MP_GP config TARGET_DB_MV784MP_GP
bool "Support db-mv784mp-gp" bool "Support db-mv784mp-gp"
select MV78460
config TARGET_DS414
bool "Support Synology DS414"
select MV78230
config TARGET_MAXBCM config TARGET_MAXBCM
bool "Support maxbcm" bool "Support maxbcm"
select MV78460
endchoice endchoice
config SYS_SOC config SYS_BOARD
default "mvebu" default "clearfog" if TARGET_CLEARFOG
default "db-88f6820-gp" if TARGET_DB_88F6820_GP
default "db-mv784mp-gp" if TARGET_DB_MV784MP_GP
default "ds414" if TARGET_DS414
default "maxbcm" if TARGET_MAXBCM
config MVEBU_BOOTROM_UARTBOOT config SYS_CONFIG_NAME
bool "Use kwboot to boot via BootROM xmodem protocol" default "clearfog" if TARGET_CLEARFOG
help default "db-88f6820-gp" if TARGET_DB_88F6820_GP
This option provides support for booting via the Marvell default "db-mv784mp-gp" if TARGET_DB_MV784MP_GP
xmodem protocol, used by the kwboot tool. default "ds414" if TARGET_DS414
default "maxbcm" if TARGET_MAXBCM
Please don't forget to configure the boot device in config SYS_VENDOR
the board specific kwbimage.cfg file this way: default "Marvell" if TARGET_DB_MV784MP_GP
BOOT_FROM uart default "Marvell" if TARGET_DB_88F6820_GP
default "solidrun" if TARGET_CLEARFOG
default "Synology" if TARGET_DS414
config SYS_SOC
default "mvebu"
endif endif
...@@ -15,8 +15,8 @@ else ...@@ -15,8 +15,8 @@ else
obj-y = cpu.o obj-y = cpu.o
obj-y += dram.o obj-y += dram.o
ifndef CONFIG_SPL_BUILD ifndef CONFIG_SPL_BUILD
obj-$(CONFIG_SYS_MVEBU_DDR_A38X) += ../../../drivers/ddr/marvell/a38x/xor.o obj-$(CONFIG_ARMADA_38X) += ../../../drivers/ddr/marvell/a38x/xor.o
obj-$(CONFIG_SYS_MVEBU_DDR_AXP) += ../../../drivers/ddr/marvell/axp/xor.o obj-$(CONFIG_ARMADA_XP) += ../../../drivers/ddr/marvell/axp/xor.o
endif endif
obj-y += gpio.o obj-y += gpio.o
obj-y += mbus.o obj-y += mbus.o
...@@ -24,7 +24,7 @@ obj-y += timer.o ...@@ -24,7 +24,7 @@ obj-y += timer.o
obj-$(CONFIG_SPL_BUILD) += spl.o obj-$(CONFIG_SPL_BUILD) += spl.o
obj-$(CONFIG_SPL_BUILD) += lowlevel_spl.o obj-$(CONFIG_SPL_BUILD) += lowlevel_spl.o
obj-$(CONFIG_SYS_MVEBU_DDR_A38X) += serdes/a38x/ obj-$(CONFIG_ARMADA_38X) += serdes/a38x/
obj-$(CONFIG_SYS_MVEBU_DDR_AXP) += serdes/axp/ obj-$(CONFIG_ARMADA_XP) += serdes/axp/
endif endif
/* /*
* Copyright (C) 2014-2015 Stefan Roese <sr@denx.de> * Copyright (C) 2014-2016 Stefan Roese <sr@denx.de>
* *
* SPDX-License-Identifier: GPL-2.0+ * SPDX-License-Identifier: GPL-2.0+
*/ */
#include <common.h> #include <common.h>
#include <netdev.h>
#include <ahci.h> #include <ahci.h>
#include <linux/mbus.h> #include <linux/mbus.h>
#include <asm/io.h> #include <asm/io.h>
...@@ -50,25 +49,106 @@ int mvebu_soc_family(void) ...@@ -50,25 +49,106 @@ int mvebu_soc_family(void)
{ {
u16 devid = (readl(MVEBU_REG_PCIE_DEVID) >> 16) & 0xffff; u16 devid = (readl(MVEBU_REG_PCIE_DEVID) >> 16) & 0xffff;
if (devid == SOC_MV78460_ID) switch (devid) {
case SOC_MV78230_ID:
case SOC_MV78260_ID:
case SOC_MV78460_ID:
return MVEBU_SOC_AXP; return MVEBU_SOC_AXP;
case SOC_88F6810_ID:
if (devid == SOC_88F6810_ID || devid == SOC_88F6820_ID || case SOC_88F6820_ID:
devid == SOC_88F6828_ID) case SOC_88F6828_ID:
return MVEBU_SOC_A38X; return MVEBU_SOC_A38X;
}
return MVEBU_SOC_UNKNOWN; return MVEBU_SOC_UNKNOWN;
} }
#if defined(CONFIG_DISPLAY_CPUINFO) #if defined(CONFIG_DISPLAY_CPUINFO)
#if defined(CONFIG_ARMADA_38X)
/* SAR frequency values for Armada 38x */
static const struct sar_freq_modes sar_freq_tab[] = {
{ 0x0, 0x0, 666, 333, 333 },
{ 0x2, 0x0, 800, 400, 400 },
{ 0x4, 0x0, 1066, 533, 533 },
{ 0x6, 0x0, 1200, 600, 600 },
{ 0x8, 0x0, 1332, 666, 666 },
{ 0xc, 0x0, 1600, 800, 800 },
{ 0xff, 0xff, 0, 0, 0 } /* 0xff marks end of array */
};
#else
/* SAR frequency values for Armada XP */
static const struct sar_freq_modes sar_freq_tab[] = {
{ 0xa, 0x5, 800, 400, 400 },
{ 0x1, 0x5, 1066, 533, 533 },
{ 0x2, 0x5, 1200, 600, 600 },
{ 0x2, 0x9, 1200, 600, 400 },
{ 0x3, 0x5, 1333, 667, 667 },
{ 0x4, 0x5, 1500, 750, 750 },
{ 0x4, 0x9, 1500, 750, 500 },
{ 0xb, 0x9, 1600, 800, 533 },
{ 0xb, 0xa, 1600, 800, 640 },
{ 0xb, 0x5, 1600, 800, 800 },
{ 0xff, 0xff, 0, 0, 0 } /* 0xff marks end of array */
};
#endif
void get_sar_freq(struct sar_freq_modes *sar_freq)
{
u32 val;
u32 freq;
int i;
val = readl(CONFIG_SAR_REG); /* SAR - Sample At Reset */
freq = (val & SAR_CPU_FREQ_MASK) >> SAR_CPU_FREQ_OFFS;
#if !defined(CONFIG_ARMADA_38X)
/*
* Shift CPU0 clock frequency select bit from SAR2 register
* into correct position
*/
freq |= ((readl(CONFIG_SAR2_REG) & SAR2_CPU_FREQ_MASK)
>> SAR2_CPU_FREQ_OFFS) << 3;
#endif
for (i = 0; sar_freq_tab[i].val != 0xff; i++) {
if (sar_freq_tab[i].val == freq) {
#if defined(CONFIG_ARMADA_38X)
*sar_freq = sar_freq_tab[i];
return;
#else
int k;
u8 ffc;
ffc = (val & SAR_FFC_FREQ_MASK) >>
SAR_FFC_FREQ_OFFS;
for (k = i; sar_freq_tab[k].ffc != 0xff; k++) {
if (sar_freq_tab[k].ffc == ffc) {
*sar_freq = sar_freq_tab[k];
return;
}
}
i = k;
#endif
}
}
/* SAR value not found, return 0 for frequencies */
*sar_freq = sar_freq_tab[i - 1];
}
int print_cpuinfo(void) int print_cpuinfo(void)
{ {
u16 devid = (readl(MVEBU_REG_PCIE_DEVID) >> 16) & 0xffff; u16 devid = (readl(MVEBU_REG_PCIE_DEVID) >> 16) & 0xffff;
u8 revid = readl(MVEBU_REG_PCIE_REVID) & 0xff; u8 revid = readl(MVEBU_REG_PCIE_REVID) & 0xff;
struct sar_freq_modes sar_freq;
puts("SoC: "); puts("SoC: ");
switch (devid) { switch (devid) {
case SOC_MV78230_ID:
puts("MV78230-");
break;
case SOC_MV78260_ID:
puts("MV78260-");
break;
case SOC_MV78460_ID: case SOC_MV78460_ID:
puts("MV78460-"); puts("MV78460-");
break; break;
...@@ -89,13 +169,13 @@ int print_cpuinfo(void) ...@@ -89,13 +169,13 @@ int print_cpuinfo(void)
if (mvebu_soc_family() == MVEBU_SOC_AXP) { if (mvebu_soc_family() == MVEBU_SOC_AXP) {
switch (revid) { switch (revid) {
case 1: case 1:
puts("A0\n"); puts("A0");
break; break;
case 2: case 2:
puts("B0\n"); puts("B0");
break; break;
default: default:
printf("?? (%x)\n", revid); printf("?? (%x)", revid);
break; break;
} }
} }
...@@ -103,17 +183,20 @@ int print_cpuinfo(void) ...@@ -103,17 +183,20 @@ int print_cpuinfo(void)
if (mvebu_soc_family() == MVEBU_SOC_A38X) { if (mvebu_soc_family() == MVEBU_SOC_A38X) {
switch (revid) { switch (revid) {
case MV_88F68XX_Z1_ID: case MV_88F68XX_Z1_ID:
puts("Z1\n"); puts("Z1");
break; break;
case MV_88F68XX_A0_ID: case MV_88F68XX_A0_ID:
puts("A0\n"); puts("A0");
break; break;
default: default:
printf("?? (%x)\n", revid); printf("?? (%x)", revid);
break; break;
} }
} }
get_sar_freq(&sar_freq);
printf(" at %d MHz\n", sar_freq.p_clk);
return 0; return 0;
} }
#endif /* CONFIG_DISPLAY_CPUINFO */ #endif /* CONFIG_DISPLAY_CPUINFO */
...@@ -199,10 +282,10 @@ static void setup_usb_phys(void) ...@@ -199,10 +282,10 @@ static void setup_usb_phys(void)
clrsetbits_le32(MV_USB_PHY_PLL_REG(1), 0x3ff, 0x605); clrsetbits_le32(MV_USB_PHY_PLL_REG(1), 0x3ff, 0x605);
/* Power up PLL and PHY channel */ /* Power up PLL and PHY channel */
clrsetbits_le32(MV_USB_PHY_PLL_REG(2), 0, BIT(9)); setbits_le32(MV_USB_PHY_PLL_REG(2), BIT(9));
/* Assert VCOCAL_START */ /* Assert VCOCAL_START */
clrsetbits_le32(MV_USB_PHY_PLL_REG(1), 0, BIT(21)); setbits_le32(MV_USB_PHY_PLL_REG(1), BIT(21));
mdelay(1); mdelay(1);
...@@ -211,18 +294,20 @@ static void setup_usb_phys(void) ...@@ -211,18 +294,20 @@ static void setup_usb_phys(void)
*/ */
for (dev = 0; dev < 3; dev++) { for (dev = 0; dev < 3; dev++) {
clrsetbits_le32(MV_USB_X3_PHY_CHANNEL(dev, 3), 0, BIT(15)); setbits_le32(MV_USB_X3_PHY_CHANNEL(dev, 3), BIT(15));
/* Assert REG_RCAL_START in channel REG 1 */ /* Assert REG_RCAL_START in channel REG 1 */
clrsetbits_le32(MV_USB_X3_PHY_CHANNEL(dev, 1), 0, BIT(12)); setbits_le32(MV_USB_X3_PHY_CHANNEL(dev, 1), BIT(12));
udelay(40); udelay(40);
clrsetbits_le32(MV_USB_X3_PHY_CHANNEL(dev, 1), BIT(12), 0); clrbits_le32(MV_USB_X3_PHY_CHANNEL(dev, 1), BIT(12));
} }
} }
/*
* This function is not called from the SPL U-Boot version
*/
int arch_cpu_init(void) int arch_cpu_init(void)
{ {
#if !defined(CONFIG_SPL_BUILD)
struct pl310_regs *const pl310 = struct pl310_regs *const pl310 =
(struct pl310_regs *)CONFIG_SYS_PL310_BASE; (struct pl310_regs *)CONFIG_SYS_PL310_BASE;
...@@ -233,27 +318,26 @@ int arch_cpu_init(void) ...@@ -233,27 +318,26 @@ int arch_cpu_init(void)
* still locked to cache. * still locked to cache.
*/ */
mmu_disable(); mmu_disable();
#endif
/* Linux expects the internal registers to be at 0xf1000000 */ /* Linux expects the internal registers to be at 0xf1000000 */
writel(SOC_REGS_PHY_BASE, INTREG_BASE_ADDR_REG); writel(SOC_REGS_PHY_BASE, INTREG_BASE_ADDR_REG);
set_cbar(SOC_REGS_PHY_BASE + 0xC000); set_cbar(SOC_REGS_PHY_BASE + 0xC000);
#if !defined(CONFIG_SPL_BUILD)
/* /*
* From this stage on, the SoC detection is working. As we have * From this stage on, the SoC detection is working. As we have
* configured the internal register base to the value used * configured the internal register base to the value used
* in the macros / defines in the U-Boot header (soc.h). * in the macros / defines in the U-Boot header (soc.h).
*/ */
/* if (mvebu_soc_family() == MVEBU_SOC_A38X) {
* To fully release / unlock this area from cache, we need /*
* to flush all caches and disable the L2 cache. * To fully release / unlock this area from cache, we need
*/ * to flush all caches and disable the L2 cache.
icache_disable(); */
dcache_disable(); icache_disable();
clrbits_le32(&pl310->pl310_ctrl, L2X0_CTRL_EN); dcache_disable();
#endif clrbits_le32(&pl310->pl310_ctrl, L2X0_CTRL_EN);
}
/* /*
* We need to call mvebu_mbus_probe() before calling * We need to call mvebu_mbus_probe() before calling
...@@ -326,30 +410,6 @@ int arch_misc_init(void) ...@@ -326,30 +410,6 @@ int arch_misc_init(void)
} }
#endif /* CONFIG_ARCH_MISC_INIT */ #endif /* CONFIG_ARCH_MISC_INIT */
#ifdef CONFIG_MVNETA
int cpu_eth_init(bd_t *bis)
{
u32 enet_base[] = { MVEBU_EGIGA0_BASE, MVEBU_EGIGA1_BASE,
MVEBU_EGIGA2_BASE, MVEBU_EGIGA3_BASE };
u8 phy_addr[] = CONFIG_PHY_ADDR;
int i;
/*
* Only Armada XP supports all 4 ethernet interfaces. A38x has
* slightly different base addresses for its 2-3 interfaces.
*/
if (mvebu_soc_family() != MVEBU_SOC_AXP) {
enet_base[1] = MVEBU_EGIGA2_BASE;
enet_base[2] = MVEBU_EGIGA3_BASE;
}
for (i = 0; i < ARRAY_SIZE(phy_addr); i++)
mvneta_initialize(bis, enet_base[i], i, phy_addr[i]);
return 0;
}
#endif
#ifdef CONFIG_MV_SDHCI #ifdef CONFIG_MV_SDHCI
int board_mmc_init(bd_t *bis) int board_mmc_init(bd_t *bis)
{ {
...@@ -413,20 +473,43 @@ void scsi_init(void) ...@@ -413,20 +473,43 @@ void scsi_init(void)
} }
#endif #endif
#ifndef CONFIG_SYS_DCACHE_OFF
void enable_caches(void) void enable_caches(void)
{ {
struct pl310_regs *const pl310 =
(struct pl310_regs *)CONFIG_SYS_PL310_BASE;
/* First disable L2 cache - may still be enable from BootROM */
if (mvebu_soc_family() == MVEBU_SOC_A38X)
clrbits_le32(&pl310->pl310_ctrl, L2X0_CTRL_EN);
/* Avoid problem with e.g. neta ethernet driver */ /* Avoid problem with e.g. neta ethernet driver */
invalidate_dcache_all(); invalidate_dcache_all();
/* Enable D-cache. I-cache is already enabled in start.S */ /* Enable D-cache. I-cache is already enabled in start.S */
dcache_enable(); dcache_enable();
} }
#endif
void v7_outer_cache_enable(void)
{
if (mvebu_soc_family() == MVEBU_SOC_AXP) {
struct pl310_regs *const pl310 =
(struct pl310_regs *)CONFIG_SYS_PL310_BASE;
u32 u;
/* The L2 cache is already disabled at this point */
/*
* For Aurora cache in no outer mode, enable via the CP15
* coprocessor broadcasting of cache commands to L2.
*/
asm volatile("mrc p15, 1, %0, c15, c2, 0" : "=r" (u));
u |= BIT(8); /* Set the FW bit */
asm volatile("mcr p15, 1, %0, c15, c2, 0" : : "r" (u));
isb();
/* Enable the L2 cache */
setbits_le32(&pl310->pl310_ctrl, L2X0_CTRL_EN);
}
}
void v7_outer_cache_disable(void)
{
struct pl310_regs *const pl310 =
(struct pl310_regs *)CONFIG_SYS_PL310_BASE;
clrbits_le32(&pl310->pl310_ctrl, L2X0_CTRL_EN);
}
...@@ -12,11 +12,8 @@ ...@@ -12,11 +12,8 @@
#include <asm/arch/cpu.h> #include <asm/arch/cpu.h>
#include <asm/arch/soc.h> #include <asm/arch/soc.h>
#ifdef CONFIG_SYS_MVEBU_DDR_A38X #if defined(CONFIG_ARCH_MVEBU)
#include "../../../drivers/ddr/marvell/axp/xor.h" /* Use common XOR definitions for A3x and AXP */
#include "../../../drivers/ddr/marvell/axp/xor_regs.h"
#endif
#ifdef CONFIG_SYS_MVEBU_DDR_AXP
#include "../../../drivers/ddr/marvell/axp/xor.h" #include "../../../drivers/ddr/marvell/axp/xor.h"
#include "../../../drivers/ddr/marvell/axp/xor_regs.h" #include "../../../drivers/ddr/marvell/axp/xor_regs.h"
#endif #endif
...@@ -112,7 +109,7 @@ void mvebu_sdram_size_adjust(enum memory_bank bank) ...@@ -112,7 +109,7 @@ void mvebu_sdram_size_adjust(enum memory_bank bank)
mvebu_sdram_bs_set(bank, size); mvebu_sdram_bs_set(bank, size);
} }
#if defined(CONFIG_SYS_MVEBU_DDR_A38X) || defined(CONFIG_SYS_MVEBU_DDR_AXP) #if defined(CONFIG_ARCH_MVEBU)
static u32 xor_ctrl_save; static u32 xor_ctrl_save;
static u32 xor_base_save; static u32 xor_base_save;
static u32 xor_mask_save; static u32 xor_mask_save;
...@@ -292,11 +289,18 @@ void dram_init_banksize(void) ...@@ -292,11 +289,18 @@ void dram_init_banksize(void)
} }
} }
#if defined(CONFIG_ARCH_MVEBU)
void board_add_ram_info(int use_default) void board_add_ram_info(int use_default)
{ {
struct sar_freq_modes sar_freq;
get_sar_freq(&sar_freq);
printf(" (%d MHz, ", sar_freq.d_clk);
if (ecc_enabled()) if (ecc_enabled())
printf(" (ECC"); printf("ECC");
else else
printf(" (ECC not"); printf("ECC not");
printf(" enabled)"); printf(" enabled)");
} }
#endif
...@@ -17,12 +17,22 @@ ...@@ -17,12 +17,22 @@
#include <asm/arch/soc.h> #include <asm/arch/soc.h>
#if defined(CONFIG_ARMADA_XP) #if defined(CONFIG_ARMADA_XP) || defined(CONFIG_ARMADA_38X)
/*
* Set this for the common xor register definitions needed in dram.c
* for A38x as well here.
*/
#define MV88F78X60 /* for the DDR training bin_hdr code */ #define MV88F78X60 /* for the DDR training bin_hdr code */
#endif #endif
#define CONFIG_SYS_CACHELINE_SIZE 32 #define CONFIG_SYS_CACHELINE_SIZE 32
#define CONFIG_SYS_L2_PL310
#ifdef CONFIG_SPL_BUILD
#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */
#endif
/* /*
* By default kwbimage.cfg from board specific folder is used * By default kwbimage.cfg from board specific folder is used
* If for some board, different configuration file need to be used, * If for some board, different configuration file need to be used,
...@@ -47,8 +57,7 @@ ...@@ -47,8 +57,7 @@
* SPI Flash configuration * SPI Flash configuration
*/ */
#ifdef CONFIG_CMD_SF #ifdef CONFIG_CMD_SF
#define CONFIG_HARD_SPI 1 #define CONFIG_KIRKWOOD_SPI
#define CONFIG_KIRKWOOD_SPI 1
#ifndef CONFIG_ENV_SPI_BUS #ifndef CONFIG_ENV_SPI_BUS
# define CONFIG_ENV_SPI_BUS 0 # define CONFIG_ENV_SPI_BUS 0
#endif #endif
...@@ -60,6 +69,9 @@ ...@@ -60,6 +69,9 @@
#endif #endif
#endif #endif
/* Needed for SPI NOR booting in SPL */
#define CONFIG_DM_SEQ_ALIAS 1
/* /*
* Ethernet Driver configuration * Ethernet Driver configuration
*/ */
...@@ -85,9 +97,9 @@ ...@@ -85,9 +97,9 @@
#define CONFIG_SYS_I2C_SPEED 100000 #define CONFIG_SYS_I2C_SPEED 100000
#endif #endif
/* Common SPL configuration */ /* Use common timer */
#ifndef CONFIG_SPL_LDSCRIPT #define CONFIG_SYS_TIMER_COUNTS_DOWN
#define CONFIG_SPL_LDSCRIPT "arch/arm/mach-mvebu/u-boot-spl.lds" #define CONFIG_SYS_TIMER_COUNTER (MVEBU_TIMER_BASE + 0x14)
#endif #define CONFIG_SYS_TIMER_RATE 25000000
#endif /* __MVEBU_CONFIG_H */ #endif /* __MVEBU_CONFIG_H */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment