Moritz Fischer has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/50625 )
Change subject: mainboard/pine64/rockpro64: Add initial Rockpro 64 support ......................................................................
mainboard/pine64/rockpro64: Add initial Rockpro 64 support
This adds initial support for the Pine64 Rockpro64 board.
So far only the bootblock part seems to work.
Signed-off-by: Moritz Fischer moritzf@google.com Change-Id: I47d0031fff8ee10b11ad74935eaeb05f1f7eb4b3 --- A src/mainboard/pine64/Kconfig A src/mainboard/pine64/Kconfig.name A src/mainboard/pine64/rockpro64/Kconfig A src/mainboard/pine64/rockpro64/Kconfig.name A src/mainboard/pine64/rockpro64/Makefile.inc A src/mainboard/pine64/rockpro64/board.h A src/mainboard/pine64/rockpro64/board_info.txt A src/mainboard/pine64/rockpro64/bootblock.c A src/mainboard/pine64/rockpro64/devicetree.cb 9 files changed, 126 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/25/50625/1
diff --git a/src/mainboard/pine64/Kconfig b/src/mainboard/pine64/Kconfig new file mode 100644 index 0000000..238192e --- /dev/null +++ b/src/mainboard/pine64/Kconfig @@ -0,0 +1,17 @@ +## SPDX-License-Identifier: GPL-2.0-only + +if VENDOR_PINE64 + +choice + prompt "Mainboard model" + +source "src/mainboard/pine64/*/Kconfig.name" + +endchoice + +source "src/mainboard/pine64/*/Kconfig" + +config MAINBOARD_VENDOR + default "Pine64" + +endif # VENDOR_PINE64 diff --git a/src/mainboard/pine64/Kconfig.name b/src/mainboard/pine64/Kconfig.name new file mode 100644 index 0000000..209cff9 --- /dev/null +++ b/src/mainboard/pine64/Kconfig.name @@ -0,0 +1,2 @@ +config VENDOR_PINE64 + bool "Pine64" diff --git a/src/mainboard/pine64/rockpro64/Kconfig b/src/mainboard/pine64/rockpro64/Kconfig new file mode 100644 index 0000000..055ac87 --- /dev/null +++ b/src/mainboard/pine64/rockpro64/Kconfig @@ -0,0 +1,37 @@ +## SPDX-License-Identifier: GPL-2.0-only + +if BOARD_PINE64_ROCKPRO64 + +config BOARD_SPECIFIC_OPTIONS + def_bool y + select BOARD_ROMSIZE_KB_16384 + select COMMON_CBFS_SPI_WRAPPER + select MISSING_BOARD_RESET + select SOC_ROCKCHIP_RK3399 + select SPI_FLASH + select SPI_FLASH_GIGADEVICE + +config MAINBOARD_DIR + string + default "pine64/rockpro64" + +config BOOT_DEVICE_SPI_FLASH_BUS + int + default 1 + +config CONSOLE_SERIAL_UART_ADDRESS + hex + depends on DRIVERS_UART + default 0xFF1A0000 + +########################################################## +#### Update below when adding a new derivative board. #### +########################################################## +config DEVICETREE + string + default "devicetree.cb" if BOARD_PINE64_ROCKPRO64 + +config MAINBOARD_PART_NUMBER + string + default "RockPro64" if BOARD_PINE64_ROCKPRO64 +endif # BOARD_PINE64_ROCKPRO64 diff --git a/src/mainboard/pine64/rockpro64/Kconfig.name b/src/mainboard/pine64/rockpro64/Kconfig.name new file mode 100644 index 0000000..d2f0f22 --- /dev/null +++ b/src/mainboard/pine64/rockpro64/Kconfig.name @@ -0,0 +1,2 @@ +config BOARD_PINE64_ROCKPRO64 + bool "RockPro64" diff --git a/src/mainboard/pine64/rockpro64/Makefile.inc b/src/mainboard/pine64/rockpro64/Makefile.inc new file mode 100644 index 0000000..45d8fa9 --- /dev/null +++ b/src/mainboard/pine64/rockpro64/Makefile.inc @@ -0,0 +1,5 @@ +## SPDX-License-Identifier: GPL-2.0-only + +subdirs-y += sdram_params/ + +bootblock-y += bootblock.c diff --git a/src/mainboard/pine64/rockpro64/board.h b/src/mainboard/pine64/rockpro64/board.h new file mode 100644 index 0000000..4cc1e02 --- /dev/null +++ b/src/mainboard/pine64/rockpro64/board.h @@ -0,0 +1,6 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef __COREBOOT_SRC_MAINBOARD_PINE64_ROCKPRO64_BOARD_H +#define __COREBOOT_SRC_MAINBOARD_PINE64_ROCKPRO64_BOARD_H + +#endif /* ! __COREBOOT_SRC_MAINBOARD_PINE64_ROCKPRO64_BOARD_H */ diff --git a/src/mainboard/pine64/rockpro64/board_info.txt b/src/mainboard/pine64/rockpro64/board_info.txt new file mode 100644 index 0000000..a5bcde7 --- /dev/null +++ b/src/mainboard/pine64/rockpro64/board_info.txt @@ -0,0 +1,6 @@ +Vendor name: Pine64 +Board name: RockPro64 +Category: eval +ROM protocol: SPI +ROM socketed: n +Flashrom support: n diff --git a/src/mainboard/pine64/rockpro64/bootblock.c b/src/mainboard/pine64/rockpro64/bootblock.c new file mode 100644 index 0000000..8ecc568 --- /dev/null +++ b/src/mainboard/pine64/rockpro64/bootblock.c @@ -0,0 +1,46 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <device/mmio.h> +#include <bootblock_common.h> +#include <delay.h> +#include <soc/grf.h> +#include <gpio.h> +#include <soc/clock.h> +#include <soc/i2c.h> +#include <soc/pwm.h> +#include <soc/spi.h> + +#include "board.h" + +void bootblock_mainboard_early_init(void) +{ + if (CONFIG(CONSOLE_SERIAL)) { + _Static_assert(CONFIG_CONSOLE_SERIAL_UART_ADDRESS == UART2_BASE, + "CONSOLE_SERIAL_UART should be UART2"); + + /* iomux: select gpio4c[4:3] as uart2 dbg port */ + write32(&rk3399_grf->iomux_uart2c, IOMUX_UART2C); + + /* grf soc_con7[11:10] use for uart2 select */ + write32(&rk3399_grf->soc_con7, UART2C_SEL); + } +} + +static void configure_spi_flash(void) +{ + gpio_input(GPIO(1, A, 7)); /* SPI1_MISO remove pull-up */ + gpio_input(GPIO(1, B, 0)); /* SPI1_MOSI remove pull-up */ + gpio_input(GPIO(1, B, 1)); /* SPI1_CLK remove pull-up */ + gpio_input(GPIO(1, B, 2)); /* SPI1_CS remove pull-up */ + + rockchip_spi_init(CONFIG_BOOT_DEVICE_SPI_FLASH_BUS, 33*MHz); + rockchip_spi_set_sample_delay(CONFIG_BOOT_DEVICE_SPI_FLASH_BUS, 5); + + write32(&rk3399_pmugrf->spi1_rxd, IOMUX_SPI1_RX); + write32(&rk3399_pmugrf->spi1_csclktx, IOMUX_SPI1_CSCLKTX); +} + +void bootblock_mainboard_init(void) +{ + configure_spi_flash(); +} diff --git a/src/mainboard/pine64/rockpro64/devicetree.cb b/src/mainboard/pine64/rockpro64/devicetree.cb new file mode 100644 index 0000000..5f01ccf --- /dev/null +++ b/src/mainboard/pine64/rockpro64/devicetree.cb @@ -0,0 +1,5 @@ +## SPDX-License-Identifier: GPL-2.0-only + +chip soc/rockchip/rk3399 + device cpu_cluster 0 on end +end