summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2017-05-10 21:40:11 (GMT)
committerTom Rini <trini@konsulko.com>2017-05-10 21:40:11 (GMT)
commit1f5541c8818d3ecd243f9bbf58db9ea5f55a3195 (patch)
tree83053c0f224f8fe641550492e95818033e5af7e2 /board
parent102d86552abc82818c22b39fdef4b3a280a60643 (diff)
parent2085de57f3928d72b27338f68d4250d1fb302d04 (diff)
downloadu-boot-1f5541c8818d3ecd243f9bbf58db9ea5f55a3195.tar.xz
Merge git://git.denx.de/u-boot-rockchip
This adds a new firefly-rk3399 board, MIPI support for rk3399 and rk3288, rk818 pmic support, mkimage improvements for rockchip and a few other things.
Diffstat (limited to 'board')
-rw-r--r--board/rockchip/evb_rk3399/evb-rk3399.c31
-rw-r--r--board/rockchip/tinker_rk3288/tinker-rk3288.c28
-rw-r--r--board/theobroma-systems/puma_rk3399/puma-rk3399.c26
3 files changed, 80 insertions, 5 deletions
diff --git a/board/rockchip/evb_rk3399/evb-rk3399.c b/board/rockchip/evb_rk3399/evb-rk3399.c
index 362fa0b..f63f003 100644
--- a/board/rockchip/evb_rk3399/evb-rk3399.c
+++ b/board/rockchip/evb_rk3399/evb-rk3399.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
#include <dm.h>
+#include <ram.h>
#include <dm/pinctrl.h>
#include <dm/uclass-internal.h>
#include <asm/arch/periph.h>
@@ -28,6 +29,13 @@ int board_init(void)
goto out;
}
+ /* Enable pwm0 for panel backlight */
+ ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_PWM0);
+ if (ret) {
+ debug("%s PWM0 pinctrl init fail! (ret=%d)\n", __func__, ret);
+ goto out;
+ }
+
ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_PWM2);
if (ret) {
debug("%s PWM2 pinctrl init fail!\n", __func__);
@@ -40,10 +48,9 @@ int board_init(void)
goto out;
}
- /* rk3399 need init vdd_center to get correct output voltage */
- ret = regulator_get_by_platname("vdd_center", &regulator);
+ ret = regulators_enable_boot_on(false);
if (ret)
- debug("%s: Cannot get vdd_center regulator\n", __func__);
+ debug("%s: Cannot enable boot on regulator\n", __func__);
ret = regulator_get_by_platname("vcc5v0_host", &regulator);
if (ret) {
@@ -63,7 +70,23 @@ out:
int dram_init(void)
{
- gd->ram_size = 0x80000000;
+ struct ram_info ram;
+ struct udevice *dev;
+ int ret;
+
+ ret = uclass_get_device(UCLASS_RAM, 0, &dev);
+ if (ret) {
+ debug("DRAM init failed: %d\n", ret);
+ return ret;
+ }
+ ret = ram_get_info(dev, &ram);
+ if (ret) {
+ debug("Cannot get DRAM size: %d\n", ret);
+ return ret;
+ }
+ debug("SDRAM base=%llx, size=%x\n", ram.base, (unsigned int)ram.size);
+ gd->ram_size = ram.size;
+
return 0;
}
diff --git a/board/rockchip/tinker_rk3288/tinker-rk3288.c b/board/rockchip/tinker_rk3288/tinker-rk3288.c
index 79541a3..c2872e7 100644
--- a/board/rockchip/tinker_rk3288/tinker-rk3288.c
+++ b/board/rockchip/tinker_rk3288/tinker-rk3288.c
@@ -5,3 +5,31 @@
*/
#include <common.h>
+#include <dm.h>
+#include <i2c_eeprom.h>
+#include <netdev.h>
+
+static int get_ethaddr_from_eeprom(u8 *addr)
+{
+ int ret;
+ struct udevice *dev;
+
+ ret = uclass_first_device_err(UCLASS_I2C_EEPROM, &dev);
+ if (ret)
+ return ret;
+
+ return i2c_eeprom_read(dev, 0, addr, 6);
+}
+
+int rk_board_late_init(void)
+{
+ u8 ethaddr[6];
+
+ if (get_ethaddr_from_eeprom(ethaddr))
+ return 0;
+
+ if (is_valid_ethaddr(ethaddr))
+ eth_setenv_enetaddr("ethaddr", ethaddr);
+
+ return 0;
+}
diff --git a/board/theobroma-systems/puma_rk3399/puma-rk3399.c b/board/theobroma-systems/puma_rk3399/puma-rk3399.c
index fb4d31e..0a8861a 100644
--- a/board/theobroma-systems/puma_rk3399/puma-rk3399.c
+++ b/board/theobroma-systems/puma_rk3399/puma-rk3399.c
@@ -5,10 +5,18 @@
*/
#include <common.h>
#include <dm.h>
+#include <misc.h>
+#include <ram.h>
#include <dm/pinctrl.h>
#include <dm/uclass-internal.h>
#include <asm/arch/periph.h>
#include <power/regulator.h>
+#include <u-boot/sha256.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#define RK3399_CPUID_OFF 0x7
+#define RK3399_CPUID_LEN 0x10
DECLARE_GLOBAL_DATA_PTR;
@@ -57,7 +65,23 @@ out:
int dram_init(void)
{
- gd->ram_size = 0x80000000;
+ struct ram_info ram;
+ struct udevice *dev;
+ int ret;
+
+ ret = uclass_get_device(UCLASS_RAM, 0, &dev);
+ if (ret) {
+ debug("DRAM init failed: %d\n", ret);
+ return ret;
+ }
+ ret = ram_get_info(dev, &ram);
+ if (ret) {
+ debug("Cannot get DRAM size: %d\n", ret);
+ return ret;
+ }
+ debug("SDRAM base=%llx, size=%x\n", ram.base, (unsigned int)ram.size);
+ gd->ram_size = ram.size;
+
return 0;
}