To support SPI flashes (via the device model) and enable loading of later-stage images from SPI in SPL, we need a few adjustments to the common configuration header for the RK3399: - enable SPL_SPI_LOAD if SPI is enabled for SPL (in rk3399_common) - move CONFIG_SPI and CONFIG_SPI_FLASH (from rk3399_common) to defconfig
Changes in v3: - replaced macro-pasting with a lookup table to improve readability (as requested by Simon) - increase the module input clock from 99MHz to 198MHz for the RK3399 (added in version 3) - change the top bitrate permissible (without generating a -EINVAL) from 48MHz/MBit to half the input clockrate (i.e. 49.5MHz/MBit for a 99MHz module input clock) Changes in v2: - fixes a wrong macro usage, which caused the SPI module input clock frequency to be significantly higher than intended - frequencies have now been validated using an oscilloscope (keep in mind that all frequencies are derived from a 99MHz module input clock) at the following measurement points (assuming the other fix for the usage of DIV_RATE from the series): * 1 MHz ... 0.99 MHz * 5 MHz ... 4.95 MHz * 10 MHz ... 9.9 MHz * 30 MHz ... 33 MHz * 50 MHz ... 49.5 MHz - fixes an off-by-one for the RK3399 that cause the SPI module input clock to be misstated as 84MHz (even though it was running at 99MHz) Jakob Unterwurzacher (1): rockchip: spi: enable support for the rk_spi driver for the RK3399 Philipp Tomsich (6): rockchip: clk: rk3399: add clock support for SCLK_SPI1 and SCLK_SPI5 rockchip: clk: rk3399: fix off-by one during rate calculation in i2c/spi_set_rate rockchip: spi: rk_spi: select 198MHz input to the SPI module for the RK3399 rockchip: spi: rk_spi: improve clocking code for the RK3399 rockchip: pinctrl: rk3399: add support for the SPI5 controller rockchip: spl: rk3399: spi: enable SPL_SPI_LOAD if SPI is enabled for SPL arch/arm/include/asm/arch-rockchip/grf_rk3399.h | 12 +++ arch/arm/include/asm/arch-rockchip/periph.h | 3 + drivers/clk/rockchip/clk_rk3399.c | 115 ++++++++++++++++++++++-- drivers/pinctrl/rockchip/pinctrl_rk3399.c | 17 ++++ drivers/spi/rk_spi.c | 17 +++- drivers/spi/rk_spi.h | 7 ++ include/configs/rk3399_common.h | 3 + 7 files changed, 163 insertions(+), 11 deletions(-) -- 1.9.1 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot