115-v6.5-arm64-dts-mt7622-declare-SPI-NAND-present-on-BPI-R64.patch 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. From d278f43f25beedfd0cb784d1dd0a9e7e8c8f123f Mon Sep 17 00:00:00 2001
  2. From: Daniel Golle <[email protected]>
  3. Date: Wed, 19 Apr 2023 20:15:53 +0100
  4. Subject: [PATCH] arm64: dts: mt7622: declare SPI-NAND present on BPI-R64
  5. The SPI-NOR node in the device tree of the BananaPi R64 has most likely
  6. been copied from the reference board's device tree even though the R64
  7. comes with an SPI-NAND chip rather than SPI-NOR.
  8. Setup the Serial NAND Flash Interface (SNFI) controller, enable
  9. hardware BCH error detection and correction engine and add the SPI-NAND
  10. chip including basic partitions,
  11. Signed-off-by: Daniel Golle <[email protected]>
  12. Link: https://lore.kernel.org/r/[email protected]
  13. Signed-off-by: Matthias Brugger <[email protected]>
  14. ---
  15. .../dts/mediatek/mt7622-bananapi-bpi-r64.dts | 38 ++++++++++++++++---
  16. 1 file changed, 33 insertions(+), 5 deletions(-)
  17. --- a/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
  18. +++ b/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
  19. @@ -253,14 +253,42 @@
  20. status = "disabled";
  21. };
  22. -&nor_flash {
  23. - pinctrl-names = "default";
  24. - pinctrl-0 = <&spi_nor_pins>;
  25. - status = "disabled";
  26. +&bch {
  27. + status = "okay";
  28. +};
  29. +&snfi {
  30. + pinctrl-names = "default";
  31. + pinctrl-0 = <&serial_nand_pins>;
  32. + status = "okay";
  33. flash@0 {
  34. - compatible = "jedec,spi-nor";
  35. + compatible = "spi-nand";
  36. reg = <0>;
  37. + spi-tx-bus-width = <4>;
  38. + spi-rx-bus-width = <4>;
  39. + nand-ecc-engine = <&snfi>;
  40. + partitions {
  41. + compatible = "fixed-partitions";
  42. + #address-cells = <1>;
  43. + #size-cells = <1>;
  44. +
  45. + partition@0 {
  46. + label = "bl2";
  47. + reg = <0x0 0x80000>;
  48. + read-only;
  49. + };
  50. +
  51. + partition@80000 {
  52. + label = "fip";
  53. + reg = <0x80000 0x200000>;
  54. + read-only;
  55. + };
  56. +
  57. + ubi: partition@280000 {
  58. + label = "ubi";
  59. + reg = <0x280000 0x7d80000>;
  60. + };
  61. + };
  62. };
  63. };