summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards/radxa-rock3
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/boards/radxa-rock3')
-rw-r--r--arch/arm/boards/radxa-rock3/board.c13
-rw-r--r--arch/arm/boards/radxa-rock3/lowlevel.c41
2 files changed, 21 insertions, 33 deletions
diff --git a/arch/arm/boards/radxa-rock3/board.c b/arch/arm/boards/radxa-rock3/board.c
index cea00b9773..df99eded2c 100644
--- a/arch/arm/boards/radxa-rock3/board.c
+++ b/arch/arm/boards/radxa-rock3/board.c
@@ -3,14 +3,14 @@
#include <common.h>
#include <deep-probe.h>
#include <init.h>
-#include <mach/bbu.h>
+#include <mach/rockchip/bbu.h>
struct rock3_model {
const char *name;
const char *shortname;
};
-static int rock3_probe(struct device_d *dev)
+static int rock3_probe(struct device *dev)
{
enum bootsource bootsource = bootsource_get();
int instance = bootsource_get_instance();
@@ -21,14 +21,13 @@ static int rock3_probe(struct device_d *dev)
barebox_set_model(model->name);
barebox_set_hostname(model->shortname);
- if (bootsource == BOOTSOURCE_MMC && instance == 0)
+ if (bootsource == BOOTSOURCE_MMC && instance == 1)
of_device_enable_path("/chosen/environment-sd");
else
of_device_enable_path("/chosen/environment-emmc");
- rk3568_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT,
- "/dev/mmc1");
- rk3568_bbu_mmc_register("sd", 0, "/dev/mmc0");
+ rockchip_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT, "/dev/mmc0");
+ rockchip_bbu_mmc_register("sd", 0, "/dev/mmc1");
return 0;
}
@@ -46,7 +45,7 @@ static const struct of_device_id rock3_of_match[] = {
{ /* sentinel */ },
};
-static struct driver_d rock3_board_driver = {
+static struct driver rock3_board_driver = {
.name = "board-rock3",
.probe = rock3_probe,
.of_compatible = rock3_of_match,
diff --git a/arch/arm/boards/radxa-rock3/lowlevel.c b/arch/arm/boards/radxa-rock3/lowlevel.c
index 00a68889cd..ec407404b9 100644
--- a/arch/arm/boards/radxa-rock3/lowlevel.c
+++ b/arch/arm/boards/radxa-rock3/lowlevel.c
@@ -1,21 +1,27 @@
// SPDX-License-Identifier: GPL-2.0-only
+
#include <common.h>
-#include <linux/sizes.h>
-#include <asm/barebox-arm-head.h>
#include <asm/barebox-arm.h>
-#include <mach/hardware.h>
-#include <mach/atf.h>
+#include <mach/rockchip/hardware.h>
+#include <mach/rockchip/atf.h>
#include <debug_ll.h>
-#include <mach/rockchip.h>
extern char __dtb_rk3568_rock_3a_start[];
-static noinline void rk3568_start(void *fdt)
+ENTRY_FUNCTION(start_rock3a, r0, r1, r2)
{
/*
- * Image execution starts at 0x0, but this is used for ATF and
- * OP-TEE later, so move away from here.
+ * Enable vccio4 1.8V and vccio6 1.8V
+ * Needed for GMAC to work.
+ * FIXME: This is done by the io-domain driver as well, but there
+ * currently is no mechanism to make sure the driver gets probed
+ * before its consumers. Remove this setup once this issue is
+ * resolved.
*/
+ writel(RK_SETBITS(0x50), 0xfdc20140);
+
+ putc_ll('>');
+
if (current_el() == 3)
relocate_to_adr_full(RK3568_BAREBOX_LOAD_ADDRESS);
else
@@ -23,22 +29,5 @@ static noinline void rk3568_start(void *fdt)
setup_c();
- /*
- * Enable vccio4 1.8V and vccio6 1.8V
- * Needed for GMAC to work.
- */
- writel(RK_SETBITS(0x50), 0xfdc20140);
-
- if (current_el() == 3) {
- rk3568_lowlevel_init();
- rk3568_atf_load_bl31(fdt);
- /* not reached */
- }
-
- barebox_arm_entry(RK3568_DRAM_BOTTOM, 0x80000000 - RK3568_DRAM_BOTTOM, fdt);
-}
-
-ENTRY_FUNCTION(start_rock3a, r0, r1, r2)
-{
- rk3568_start(__dtb_rk3568_rock_3a_start);
+ rk3568_barebox_entry(__dtb_rk3568_rock_3a_start);
}