uboot-zynq: update to 2019.07
[openwrt/openwrt.git] / package / boot / uboot-zynq / patches / 110-zybo-z7-read-mac-address-from-SPI-flash-memory.patch
index f0ebc3323eabcaeaf2ae83465324c80bf56328be..00dce9a02e9b7cb06182a5d50c80c966dbbc3b31 100644 (file)
@@ -1,7 +1,7 @@
-From ac8fcc92d87436715ce85f39a4fe4f07c3bfa15e Mon Sep 17 00:00:00 2001
+From 67db0da72eb7ed87ebaaeb8a26891cb2cf916500 Mon Sep 17 00:00:00 2001
 From: Luis Araneda <luaraneda@gmail.com>
-Date: Sun, 22 Jul 2018 02:52:41 -0400
-Subject: [U-Boot] [RFC PATCH] arm: zynq: read mac address from SPI flash memory
+Date: Sun, 21 Jul 2019 23:24:12 -0400
+Subject: [U-Boot] [PATCH] arm: zynq: read mac address from SPI flash memory
 
 Implement a method for reading the MAC address from an
 SPI flash memory.
@@ -11,38 +11,34 @@ memory
 
 Signed-off-by: Luis Araneda <luaraneda@gmail.com>
 ---
-As of 2018-08-23, this patch has been sent to U-Boot's mailing list
-and is being reviewed. Some changes on the implementation are expected,
-but the functionality should not change
+As of 2019-08-18, this patch has not been accepted by upstream U-Boot.
+Keep this patch until an alternative is accepted by upstream.
 ---
- board/xilinx/zynq/board.c      | 28 ++++++++++++++++++++++++++++
+ board/xilinx/common/board.c    | 28 ++++++++++++++++++++++++++++
  configs/zynq_zybo_z7_defconfig |  3 +++
  drivers/misc/Kconfig           | 17 +++++++++++++++++
  3 files changed, 48 insertions(+)
 
---- a/board/xilinx/zynq/board.c
-+++ b/board/xilinx/zynq/board.c
-@@ -6,9 +6,12 @@
+--- a/board/xilinx/common/board.c
++++ b/board/xilinx/common/board.c
+@@ -6,7 +6,10 @@
  
  #include <common.h>
  #include <dm/uclass.h>
 +#include <dm/device.h>
 +#include <dm/device-internal.h>
- #include <fdtdec.h>
- #include <fpga.h>
- #include <mmc.h>
+ #include <i2c.h>
 +#include <spi_flash.h>
- #include <watchdog.h>
- #include <wdt.h>
- #include <zynqpl.h>
-@@ -83,6 +86,31 @@ int zynq_board_read_rom_ethaddr(unsigned
-               printf("I2C EEPROM MAC address read failed\n");
+ int zynq_board_read_rom_ethaddr(unsigned char *ethaddr)
+ {
+@@ -34,5 +37,30 @@ int zynq_board_read_rom_ethaddr(unsigned
+               debug("%s: I2C EEPROM MAC %pM\n", __func__, ethaddr);
  #endif
  
 +#if defined(CONFIG_MAC_ADDR_IN_SPI_FLASH)
 +      struct spi_flash *flash;
 +      struct udevice *dev;
-+      int ret;
 +
 +      ret = spi_flash_probe_bus_cs(CONFIG_SF_DEFAULT_BUS,
 +                                   CONFIG_SF_DEFAULT_CS,
@@ -55,7 +51,7 @@ but the functionality should not change
 +      }
 +
 +      flash = dev_get_uclass_priv(dev);
-+      flash->read_cmd = CONFIG_MAC_ADDR_SPI_FLASH_READ_CMD;
++      flash->read_opcode = CONFIG_MAC_ADDR_SPI_FLASH_READ_CMD;
 +
 +      if (spi_flash_read_dm(dev,
 +                            CONFIG_MAC_ADDR_SPI_FLASH_DATA_OFFSET,
@@ -64,15 +60,15 @@ but the functionality should not change
 +
 +      device_remove(dev, DM_REMOVE_NORMAL);
 +#endif
-       return 0;
++
+       return ret;
  }
 --- a/configs/zynq_zybo_z7_defconfig
 +++ b/configs/zynq_zybo_z7_defconfig
-@@ -44,6 +44,9 @@ CONFIG_DM_GPIO=y
- CONFIG_SYS_I2C_ZYNQ=y
- CONFIG_ZYNQ_I2C0=y
- CONFIG_ZYNQ_I2C1=y
+@@ -42,6 +42,9 @@ CONFIG_DFU_RAM=y
+ CONFIG_FPGA_XILINX=y
+ CONFIG_FPGA_ZYNQPL=y
+ CONFIG_DM_GPIO=y
 +CONFIG_MAC_ADDR_IN_SPI_FLASH=y
 +CONFIG_MAC_ADDR_SPI_FLASH_READ_CMD=0x4b
 +CONFIG_MAC_ADDR_SPI_FLASH_DATA_OFFSET=0x20
@@ -81,7 +77,7 @@ but the functionality should not change
  CONFIG_SPI_FLASH=y
 --- a/drivers/misc/Kconfig
 +++ b/drivers/misc/Kconfig
-@@ -272,6 +272,23 @@ config SYS_I2C_EEPROM_ADDR_OVERFLOW
+@@ -366,6 +366,23 @@ config SYS_I2C_EEPROM_ADDR_OVERFLOW
  
  endif