rk3328 broken between v2022.04 and v2022.07 - still not working with v2023.01

Peter Robinson pbrobinson at gmail.com
Fri Feb 10 13:41:17 CET 2023


On Fri, Feb 10, 2023 at 12:31 PM Janpieter Sollie
<janpieter.sollie at kabelmail.de> wrote:
>
> Hello,
>
> After a few years, I tried updating my u-boot 2021 to a more recent version, as the linux kernel
> complained "ATF needs update".
> The device I'm using is a nanopi neo3 2GB (more or less the same compared to NanoPi R2S, both
> RK3328 platform).
>
> Starting from 2023.04-rc1, I couldn't get it running: in TPL, it complained "out of memory".
> A hint on IRC made me pull back to v2022.04, which works with a few mods, but there's one
> (minor) thing not working:
> board_misc_init() causes a function call failed.  Probably because efuse isn't working properly?
> I also had to modify the device tree a bit:

I have the Rock64 running 2022.10 without issues.

> --- a/arch/arm/dts/rk3328-nanopi-r2s.dts
> +++ b/arch/arm/dts/rk3328-nanopi-r2s.dts
> @@ -166,6 +166,35 @@
>          };
>   };
>
> +&saradc {
> +       status = "okay";
> +};
> +
> +&efuse {
> +       status = "okay";
> +};
> +
> +
> +&spi0 {
> +        status = "okay";
> +
> +        spiflash at 0 {
> +                compatible = "jedec,spi-nor";
> +                reg = <0>;
> +
> +//                maximum speed for Rockchip SPI
> +                spi-max-frequency = <50000000>;
> +        };
> +};
> +
> +&rng {
> +       status = "okay";
> +};
> +
> +&pdm {
> +       status = "okay";
> +};
> +
> --- a/arch/arm/dts/rk3328.dtsi
> +++ b/arch/arm/dts/rk3328.dtsi
> @@ -279,6 +279,17 @@
>                  status = "disabled";
>          };
>
> +       rng: rng at ff060000 {
> +               compatible = "rockchip,cryptov1-rng";
> +               reg = <0x0 0xff060000 0x0 0x4000>;
> +
> +               clocks = <&cru SCLK_CRYPTO>, <&cru HCLK_CRYPTO_SLV>;
> +               clock-names = "clk_crypto", "hclk_crypto";
> +               assigned-clocks = <&cru SCLK_CRYPTO>, <&cru HCLK_CRYPTO_SLV>;
> +               assigned-clock-rates = <150000000>, <100000000>;
> +               status = "disabled";
> +       };
> +
>
> The sdram controller needs to be patched as well to compile:
>
> --- a/drivers/ram/rockchip/sdram_rk3328.c
> +++ b/drivers/ram/rockchip/sdram_rk3328.c
> @@ -561,7 +561,7 @@ static int rk3328_dmc_of_to_plat(struct udevice *dev)
>                         __func__, ret);
>                  return ret;
>          }
> -       ret = regmap_init_mem(dev, &plat->map);
> +       ret = regmap_init_mem(dev->node_, &plat->map);
>          if (ret)
>                  printf("%s: regmap failed %d\n", __func__, ret);
>   #endif
>
> And ultimately, rockchip SFC also needs an update:
>
> --- a/drivers/spi/rockchip_sfc.c
> +++ b/drivers/spi/rockchip_sfc.c
> @@ -17,6 +17,7 @@
>   #include <linux/iopoll.h>
>   #include <spi.h>
>   #include <spi-mem.h>
> +#include <dm/device_compat.h>
>
> But starting from 2022.07, the system simply prints (in TPL) "data training error" and gives up
> (using default values in "make oldconfig".
> I have the config files of both 2022.04 and 2022.07 attached, any clue why it's no longer working?
>
> Kind regards,
>
> Janpieter Sollie


More information about the U-Boot mailing list