Merge git://git.denx.de/u-boot-marvell

- Add DM based generic watchdog start and reset implementation
  and remove all ad-hoc implementations (Stefan)
- Move mv_sdhci to DM (Pierre)
- Misc turris_omnia updates (Pierre)
- Change openrd targets to correctly build again (size changes
  and fixes to the dts targets) and bring it back into Travis
  builds (Stefan)
- Add Kirkwood db-88f6281-bp board (Chris)
This commit is contained in:
Tom Rini
2019-04-26 13:50:00 -04:00
45 changed files with 743 additions and 345 deletions

View File

@@ -37,6 +37,8 @@ dtb-$(CONFIG_KIRKWOOD) += \
kirkwood-atl-sbx81lifxcat.dtb \
kirkwood-blackarmor-nas220.dtb \
kirkwood-d2net.dtb \
kirkwood-db-88f6281.dtb \
kirkwood-db-88f6281-spi.dtb \
kirkwood-dns325.dtb \
kirkwood-dockstar.dtb \
kirkwood-dreamplug.dtb \
@@ -54,6 +56,9 @@ dtb-$(CONFIG_KIRKWOOD) += \
kirkwood-ns2lite.dtb \
kirkwood-ns2max.dtb \
kirkwood-ns2mini.dtb \
kirkwood-openrd-base.dtb \
kirkwood-openrd-client.dtb \
kirkwood-openrd-ultimate.dtb \
kirkwood-pogo_e02.dtb \
kirkwood-sheevaplug.dtb

View File

@@ -0,0 +1,48 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Marvell DB-88F6281-BP Development Board Setup
*
* Saeed Bishara <saeed@marvell.com>
* Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
*
*/
/dts-v1/;
#include "kirkwood-db-88f6281.dts"
/ {
aliases {
spi0 = &spi0;
};
};
&spi0 {
status = "okay";
flash@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "st,m25p128", "jedec,spi-nor", "spi-flash";
reg = <0>;
spi-max-frequency = <50000000>;
mode = <0>;
partition@u-boot {
reg = <0x00000000 0x00c00000>;
label = "u-boot";
};
partition@u-boot-env {
reg = <0x00c00000 0x00040000>;
label = "u-boot-env";
};
partition@unused {
reg = <0x00100000 0x00f00000>;
label = "unused";
};
};
};
&nand {
status = "disabled";
};

View File

@@ -0,0 +1,26 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Marvell DB-88F6281-BP Development Board Setup
*
* Saeed Bishara <saeed@marvell.com>
* Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
*
*/
/dts-v1/;
#include "kirkwood-db.dtsi"
#include "kirkwood-6281.dtsi"
/ {
model = "Marvell DB-88F6281-BP Development Board";
compatible = "marvell,db-88f6281-bp", "marvell,kirkwood-88f6281", "marvell,kirkwood";
};
&pciec {
status = "okay";
};
&pcie0 {
status = "okay";
};

View File

@@ -0,0 +1,94 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Marvell DB-{88F6281,88F6282}-BP Development Board Setup
*
* Saeed Bishara <saeed@marvell.com>
* Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
*
* This file contains the definitions that are common between the 6281
* and 6282 variants of the Marvell Kirkwood Development Board.
*/
#include "kirkwood.dtsi"
/ {
memory {
device_type = "memory";
reg = <0x00000000 0x20000000>; /* 512 MB */
};
chosen {
bootargs = "console=ttyS0,115200n8 earlyprintk";
stdout-path = &uart0;
};
aliases {
ethernet0 = &eth0;
spi0 = &spi0;
};
ocp@f1000000 {
pin-controller@10000 {
pmx_sdio_gpios: pmx-sdio-gpios {
marvell,pins = "mpp37", "mpp38";
marvell,function = "gpio";
};
};
serial@12000 {
status = "okay";
};
sata@80000 {
nr-ports = <2>;
status = "okay";
};
ehci@50000 {
status = "okay";
};
mvsdio@90000 {
pinctrl-0 = <&pmx_sdio_gpios>;
pinctrl-names = "default";
wp-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>;
cd-gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>;
status = "okay";
};
};
};
&nand {
chip-delay = <25>;
status = "okay";
partition@0 {
label = "uboot";
reg = <0x0 0x100000>;
};
partition@100000 {
label = "uImage";
reg = <0x100000 0x400000>;
};
partition@500000 {
label = "root";
reg = <0x500000 0x1fb00000>;
};
};
&mdio {
status = "okay";
ethphy0: ethernet-phy@8 {
reg = <8>;
};
};
&eth0 {
status = "okay";
ethernet0-port@0 {
phy-handle = <&ethphy0>;
};
};

View File

@@ -14,8 +14,6 @@
#define EN_UPLL_TIMEOUT 500
static struct udevice *watchdog_dev __attribute__((section(".data"))) = NULL;
void at91_periph_clk_enable(int id)
{
struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
@@ -123,46 +121,3 @@ void at91_pllicpr_init(u32 icpr)
writel(icpr, &pmc->pllicpr);
}
/* Called by macro WATCHDOG_RESET */
void watchdog_reset(void)
{
static ulong next_reset;
ulong now;
if (!watchdog_dev)
return;
now = get_timer(0);
/* Do not reset the watchdog too often */
if (now > next_reset) {
next_reset = now + 1000; /* reset every 1000ms */
wdt_reset(watchdog_dev);
}
}
int arch_early_init_r(void)
{
struct at91_wdt_priv *priv;
/* Init watchdog */
if (uclass_get_device_by_seq(UCLASS_WDT, 0, &watchdog_dev)) {
debug("Watchdog: Not found by seq!\n");
if (uclass_get_device(UCLASS_WDT, 0, &watchdog_dev)) {
puts("Watchdog: Not found!\n");
return 0;
}
}
priv = dev_get_priv(watchdog_dev);
if (!priv) {
printf("Watchdog: priv not available!\n");
return 0;
}
wdt_start(watchdog_dev, priv->timeout * 1000, 0);
printf("Watchdog: Started\n");
return 0;
}

View File

@@ -28,7 +28,6 @@ typedef struct at91_wdt {
struct at91_wdt_priv {
void __iomem *regs;
u32 regval;
u32 timeout;
};
#endif
@@ -51,6 +50,5 @@ struct at91_wdt_priv {
/* Hardware timeout in seconds */
#define WDT_MAX_TIMEOUT 16
#define WDT_DEFAULT_TIMEOUT 2
#endif

View File

@@ -65,6 +65,9 @@ config TARGET_SBx81LIFKW
config TARGET_SBx81LIFXCAT
bool "Allied Telesis SBx81GP24/SBx81GT24"
config TARGET_DB_88F6281_BP
bool "Marvell DB-88F6281-BP"
endchoice
config SYS_SOC
@@ -89,5 +92,6 @@ source "board/Seagate/nas220/Kconfig"
source "board/zyxel/nsa310s/Kconfig"
source "board/alliedtelesis/SBx81LIFKW/Kconfig"
source "board/alliedtelesis/SBx81LIFXCAT/Kconfig"
source "board/Marvell/db-88f6281-bp/Kconfig"
endif

View File

@@ -520,7 +520,7 @@ int arch_misc_init(void)
}
#endif /* CONFIG_ARCH_MISC_INIT */
#ifdef CONFIG_MMC_SDHCI_MV
#if defined(CONFIG_MMC_SDHCI_MV) && !defined(CONFIG_DM_MMC)
int board_mmc_init(bd_t *bis)
{
mv_sdh_init(MVEBU_SDIO_BASE, 0, 0,

View File

@@ -144,7 +144,9 @@ u32 mvebu_get_nand_clock(void);
void return_to_bootrom(void);
#ifndef CONFIG_DM_MMC
int mv_sdh_init(unsigned long regbase, u32 max_clk, u32 min_clk, u32 quirks);
#endif
void get_sar_freq(struct sar_freq_modes *sar_freq);

View File

@@ -69,28 +69,6 @@ int print_cpuinfo(void)
return 0;
}
#ifdef CONFIG_WATCHDOG
static struct udevice *watchdog_dev __attribute__((section(".data"))) = NULL;
/* Called by macro WATCHDOG_RESET */
void watchdog_reset(void)
{
static ulong next_reset;
ulong now;
if (!watchdog_dev)
return;
now = get_timer(0);
/* Do not reset the watchdog too often */
if (now > next_reset) {
next_reset = now + 1000; /* reset every 1000ms */
wdt_reset(watchdog_dev);
}
}
#endif
int arch_misc_init(void)
{
/*
@@ -103,19 +81,5 @@ int arch_misc_init(void)
flush_dcache_range(gd->bd->bi_memstart,
gd->bd->bi_memstart + gd->ram_size - 1);
#ifdef CONFIG_WATCHDOG
/* Init watchdog */
if (uclass_get_device_by_seq(UCLASS_WDT, 0, &watchdog_dev)) {
debug("Watchdog: Not found by seq!\n");
if (uclass_get_device(UCLASS_WDT, 0, &watchdog_dev)) {
puts("Watchdog: Not found!\n");
return 0;
}
}
wdt_start(watchdog_dev, 60000, 0); /* 60 seconds */
printf("Watchdog: Started\n");
#endif
return 0;
}

View File

@@ -35,7 +35,7 @@ config MPC8xx
bool "MPC8xx"
select BOARD_EARLY_INIT_F
imply CMD_REGINFO
imply MPC8xx_WATCHDOG
imply WDT_MPC8xx
endchoice

View File

@@ -25,9 +25,9 @@ config MPC885
endchoice
config MPC8xx_WATCHDOG
bool "Watchdog"
select HW_WATCHDOG
#config MPC8xx_WATCHDOG
# bool "Watchdog"
# select HW_WATCHDOG
config 8xx_GCLK_FREQ
int "CPU GCLK Frequency"