diff options
author | Tom Rini <trini@konsulko.com> | 2018-10-05 21:17:21 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-10-05 21:17:21 -0400 |
commit | 1b484736ce47cb220cb523f00ebe77025cab219f (patch) | |
tree | e82ad573068ff2f6be390bacfc2d43c6ed6f8218 | |
parent | a4b38fca7e83f0556c0afc96492741e4464444df (diff) | |
parent | 8be11fb3c1d8d89ff6b60bd3937efcea2dc9c91d (diff) | |
download | u-boot-1b484736ce47cb220cb523f00ebe77025cab219f.tar.gz |
Merge branch 'master' of git://git.denx.de/u-boot-socfpga
-rw-r--r-- | arch/arm/mach-socfpga/include/mach/reset_manager_s10.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-socfpga/misc_s10.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-socfpga/reset_manager_s10.c | 35 | ||||
-rw-r--r-- | drivers/gpio/dwapb_gpio.c | 11 | ||||
-rw-r--r-- | tools/socfpgaimage.c | 1 |
5 files changed, 6 insertions, 48 deletions
diff --git a/arch/arm/mach-socfpga/include/mach/reset_manager_s10.h b/arch/arm/mach-socfpga/include/mach/reset_manager_s10.h index 6182d5fa3f..31b73edabe 100644 --- a/arch/arm/mach-socfpga/include/mach/reset_manager_s10.h +++ b/arch/arm/mach-socfpga/include/mach/reset_manager_s10.h @@ -108,8 +108,6 @@ struct socfpga_reset_manager { #define RSTMGR_GPIO1 RSTMGR_DEFINE(2, 25) #define RSTMGR_SDR RSTMGR_DEFINE(3, 6) -void socfpga_emac_manage_reset(const unsigned int of_reset_id, u32 state); - /* Create a human-readable reference to SoCFPGA reset. */ #define SOCFPGA_RESET(_name) RSTMGR_##_name diff --git a/arch/arm/mach-socfpga/misc_s10.c b/arch/arm/mach-socfpga/misc_s10.c index 918baac502..e599362f14 100644 --- a/arch/arm/mach-socfpga/misc_s10.c +++ b/arch/arm/mach-socfpga/misc_s10.c @@ -36,7 +36,8 @@ static u32 socfpga_phymode_setup(u32 gmac_index, const char *phymode) if (!phymode) return -EINVAL; - if (!strcmp(phymode, "mii") || !strcmp(phymode, "gmii")) + if (!strcmp(phymode, "mii") || !strcmp(phymode, "gmii") || + !strcmp(phymode, "sgmii")) modereg = SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_GMII_MII; else if (!strcmp(phymode, "rgmii")) modereg = SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_RGMII; @@ -58,7 +59,7 @@ static int socfpga_set_phymode(void) struct fdtdec_phandle_args args; const char *phy_mode; u32 gmac_index; - int nodes[2]; /* Max. 3 GMACs */ + int nodes[3]; /* Max. 3 GMACs */ int ret, count; int i, node; diff --git a/arch/arm/mach-socfpga/reset_manager_s10.c b/arch/arm/mach-socfpga/reset_manager_s10.c index 5cc8336740..f176c38495 100644 --- a/arch/arm/mach-socfpga/reset_manager_s10.c +++ b/arch/arm/mach-socfpga/reset_manager_s10.c @@ -93,41 +93,6 @@ void socfpga_bridges_reset(int enable) } } -/* of_reset_id: emac reset id - * state: 0 - disable reset, !0 - enable reset - */ -void socfpga_emac_manage_reset(const unsigned int of_reset_id, u32 state) -{ - u32 reset_emac; - u32 reset_emacocp; - - /* hardcode this now */ - switch (of_reset_id) { - case EMAC0_RESET: - reset_emac = SOCFPGA_RESET(EMAC0); - reset_emacocp = SOCFPGA_RESET(EMAC0_OCP); - break; - case EMAC1_RESET: - reset_emac = SOCFPGA_RESET(EMAC1); - reset_emacocp = SOCFPGA_RESET(EMAC1_OCP); - break; - case EMAC2_RESET: - reset_emac = SOCFPGA_RESET(EMAC2); - reset_emacocp = SOCFPGA_RESET(EMAC2_OCP); - break; - default: - printf("GMAC: Invalid reset ID (%i)!\n", of_reset_id); - hang(); - break; - } - - /* Reset ECC OCP first */ - socfpga_per_reset(reset_emacocp, state); - - /* Release the EMAC controller from reset */ - socfpga_per_reset(reset_emac, state); -} - /* * Release peripherals from reset based on handoff */ diff --git a/drivers/gpio/dwapb_gpio.c b/drivers/gpio/dwapb_gpio.c index 0f6574d5da..68836a7902 100644 --- a/drivers/gpio/dwapb_gpio.c +++ b/drivers/gpio/dwapb_gpio.c @@ -171,8 +171,7 @@ static int gpio_dwapb_bind(struct udevice *dev) if (!fdtdec_get_bool(blob, node, "gpio-controller")) continue; - plat = NULL; - plat = calloc(1, sizeof(*plat)); + plat = devm_kcalloc(dev, 1, sizeof(*plat), GFP_KERNEL); if (!plat) return -ENOMEM; @@ -181,23 +180,17 @@ static int gpio_dwapb_bind(struct udevice *dev) plat->pins = fdtdec_get_int(blob, node, "snps,nr-gpios", 0); plat->name = fdt_stringlist_get(blob, node, "bank-name", 0, NULL); - if (ret) - goto err; ret = device_bind(dev, dev->driver, plat->name, plat, -1, &subdev); if (ret) - goto err; + return ret; dev_set_of_offset(subdev, node); bank++; } return 0; - -err: - free(plat); - return ret; } static int gpio_dwapb_remove(struct udevice *dev) diff --git a/tools/socfpgaimage.c b/tools/socfpgaimage.c index 390c9bb402..72d8b96f54 100644 --- a/tools/socfpgaimage.c +++ b/tools/socfpgaimage.c @@ -191,6 +191,7 @@ static int sfp_verify_header(const uint8_t *buf, uint8_t *ver) if (hdr_csum != sfp_csum) return -EINVAL; + *ver = header_v0.version; return img_len; } |