diff options
author | Beniamino Galvani <b.galvani@gmail.com> | 2014-04-27 11:30:44 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-04-29 08:15:41 +0200 |
commit | 3bef9916a3610e5323c0297ad78471d331c332d5 (patch) | |
tree | a2b10ad415c9920dbac9741b1f2a27cb2347d12c /arch/arm/boards/radxa-rock | |
parent | a9c8371a85eaac326946727c6eaa5ae49933f564 (diff) | |
download | barebox-3bef9916a3610e5323c0297ad78471d331c332d5.tar.gz barebox-3bef9916a3610e5323c0297ad78471d331c332d5.tar.xz |
ARM: rockchip: add radxa-rock board
Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/boards/radxa-rock')
-rw-r--r-- | arch/arm/boards/radxa-rock/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/boards/radxa-rock/board.c | 78 | ||||
-rw-r--r-- | arch/arm/boards/radxa-rock/env/config-board | 6 | ||||
-rw-r--r-- | arch/arm/boards/radxa-rock/lowlevel.c | 23 |
4 files changed, 109 insertions, 0 deletions
diff --git a/arch/arm/boards/radxa-rock/Makefile b/arch/arm/boards/radxa-rock/Makefile new file mode 100644 index 0000000000..79c8aec199 --- /dev/null +++ b/arch/arm/boards/radxa-rock/Makefile @@ -0,0 +1,2 @@ +obj-$(CONFIG_MACH_RADXA_ROCK) += board.o +lwl-y += lowlevel.o diff --git a/arch/arm/boards/radxa-rock/board.c b/arch/arm/boards/radxa-rock/board.c new file mode 100644 index 0000000000..55b4d23ef3 --- /dev/null +++ b/arch/arm/boards/radxa-rock/board.c @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2014 Beniamino Galvani <b.galvani@gmail.com> + * + * This program 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 program 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. + */ + +#include <common.h> +#include <init.h> +#include <io.h> +#include <i2c/i2c.h> +#include <i2c/i2c-gpio.h> +#include <mach/rockchip-pll.h> +#include <mfd/act8846.h> + +static struct i2c_board_info radxa_rock_i2c_devices[] = { + { + I2C_BOARD_INFO("act8846", 0x5a) + }, +}; + +static struct i2c_gpio_platform_data i2c_gpio_pdata = { + .sda_pin = 58, + .scl_pin = 59, + .udelay = 5, +}; + +static void radxa_rock_pmic_init(void) +{ + struct act8846 *pmic; + + pmic = act8846_get(); + if (pmic == NULL) + return; + + /* Power on ethernet PHY */ + act8846_set_bits(pmic, ACT8846_LDO9_CTRL, BIT(7), BIT(7)); +} + +static int setup_plls(void) +{ + /* Codec PLL frequency: 594 MHz */ + rk3188_pll_set_parameters(RK3188_CPLL, 2, 198, 4); + /* General PLL frequency: 300 MHz */ + rk3188_pll_set_parameters(RK3188_GPLL, 1, 50, 4); + + return 0; +} +coredevice_initcall(setup_plls); + +static int devices_init(void) +{ + i2c_register_board_info(0, radxa_rock_i2c_devices, + ARRAY_SIZE(radxa_rock_i2c_devices)); + add_generic_device_res("i2c-gpio", 0, NULL, 0, &i2c_gpio_pdata); + + radxa_rock_pmic_init(); + + /* Set mac_pll divisor to 6 (50MHz output) */ + writel((5 << 8) | (0x1f << 24), 0x20000098); + + return 0; +} +device_initcall(devices_init); + +static int hostname_init(void) +{ + barebox_set_hostname("radxa-rock"); + + return 0; +} +core_initcall(hostname_init); diff --git a/arch/arm/boards/radxa-rock/env/config-board b/arch/arm/boards/radxa-rock/env/config-board new file mode 100644 index 0000000000..d986e305dc --- /dev/null +++ b/arch/arm/boards/radxa-rock/env/config-board @@ -0,0 +1,6 @@ +#!/bin/sh + +# board defaults, do not change in running system. Change /env/config +# instead + +global.linux.bootargs.base="console=ttyS2,115200"
\ No newline at end of file diff --git a/arch/arm/boards/radxa-rock/lowlevel.c b/arch/arm/boards/radxa-rock/lowlevel.c new file mode 100644 index 0000000000..c68d229858 --- /dev/null +++ b/arch/arm/boards/radxa-rock/lowlevel.c @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2014 Beniamino Galvani <b.galvani@gmail.com> + * + * This program 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 program 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. + */ + +#include <common.h> +#include <sizes.h> +#include <asm/barebox-arm-head.h> +#include <asm/barebox-arm.h> + +void __naked barebox_arm_reset_vector(void) +{ + arm_cpu_lowlevel_init(); + barebox_arm_entry(0x60000000, SZ_2G, 0); +} |