SHA256
1
0
forked from pool/u-boot
u-boot/rpi3.patch

151 lines
3.1 KiB
Diff

--- arch/arm/cpu/armv8/generic_timer.c
+++ arch/arm/cpu/armv8/generic_timer.c
@@ -9,6 +9,8 @@
#include <command.h>
#include <asm/system.h>
+#ifndef CONFIG_SYS_TIMER_COUNTER
+
/*
* Generic timer implementation of get_tbclk()
*/
@@ -51,3 +53,5 @@
return ticks;
}
+
+#endif
--- arch/arm/mach-bcm283x/Kconfig
+++ arch/arm/mach-bcm283x/Kconfig
@@ -13,11 +13,16 @@
bool "Raspberry Pi 2"
select CPU_V7
+config TARGET_RPI_3
+ bool "Raspberry Pi 3"
+ select ARM64
+
endchoice
config SYS_BOARD
default "rpi" if TARGET_RPI
default "rpi_2" if TARGET_RPI_2
+ default "rpi_3" if TARGET_RPI_3
config SYS_VENDOR
default "raspberrypi"
@@ -28,5 +33,6 @@
config SYS_CONFIG_NAME
default "rpi" if TARGET_RPI
default "rpi_2" if TARGET_RPI_2
+ default "rpi_3" if TARGET_RPI_3
endmenu
--- board/raspberrypi/rpi/rpi.c
+++ board/raspberrypi/rpi/rpi.c
@@ -21,6 +21,30 @@
DECLARE_GLOBAL_DATA_PTR;
+#ifdef CONFIG_ARM64
+#include <asm/armv8/mmu.h>
+
+static struct mm_region rpi_mem_map[] = {
+ {
+ .base = 0x0UL,
+ .size = 0x3f000000UL,
+ .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
+ PTE_BLOCK_INNER_SHARE
+ }, {
+ .base = 0x3f000000UL,
+ .size = 0xc1000000UL,
+ .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
+ PTE_BLOCK_NON_SHARE |
+ PTE_BLOCK_PXN | PTE_BLOCK_UXN
+ }, {
+ /* List terminator */
+ 0,
+ }
+};
+
+struct mm_region *mem_map = rpi_mem_map;
+#endif
+
static const struct bcm2835_gpio_platdata gpio_platdata = {
.base = BCM2835_GPIO_BASE,
};
@@ -37,7 +61,11 @@
.base = 0x20201000,
#endif
.type = TYPE_PL011,
+#ifdef CONFIG_TARGET_RPI_3
+ .clock = 48000000,
+#else
.clock = 3000000,
+#endif
};
U_BOOT_DEVICE(bcm2835_serials) = {
--- board/raspberrypi/rpi_3/Makefile
+++ board/raspberrypi/rpi_3/Makefile
@@ -0,0 +1,8 @@
+#
+# (C) Copyright 2012,2015 Stephen Warren
+#
+# SPDX-License-Identifier: GPL-2.0
+#
+
+obj-y := ../rpi/rpi.o
+
--- configs/rpi_3_defconfig
+++ configs/rpi_3_defconfig
@@ -0,0 +1,10 @@
+CONFIG_ARM=y
+CONFIG_ARCH_BCM283X=y
+CONFIG_TARGET_RPI_3=y
+CONFIG_SYS_PROMPT="U-Boot> "
+# CONFIG_CMD_IMLS is not set
+# CONFIG_CMD_FLASH is not set
+# CONFIG_CMD_FPGA is not set
+CONFIG_CMD_GPIO=y
+CONFIG_PHYS_TO_BUS=y
+CONFIG_ARMV8_MULTIENTRY=y
--- drivers/video/bcm2835.c
+++ drivers/video/bcm2835.c
@@ -106,6 +106,10 @@
gd->fb_base = bus_to_phys(
msg_setup->allocate_buffer.body.resp.fb_address);
+
+#ifdef CONFIG_ARM64
+ lcd_set_flush_dcache(1);
+#endif
}
void lcd_enable(void)
--- include/configs/rpi_3.h
+++ include/configs/rpi_3.h
@@ -0,0 +1,22 @@
+/*
+ * (C) Copyright 2012,2015 Stephen Warren
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#define CONFIG_SKIP_LOWLEVEL_INIT
+#define CONFIG_BCM2836
+#define CONFIG_SYS_CACHELINE_SIZE 64
+
+#include "rpi-common.h"
+
+#undef CONFIG_SYS_TEXT_BASE
+#define CONFIG_SYS_TEXT_BASE 0x00000000
+
+/* Have release address at the end of 256MB for now */
+#define CPU_RELEASE_ADDR 0xFFFFFF0
+
+#endif