From a572fb6bdd6a6fba4892385009edd8a1dd5b9df3 Mon Sep 17 00:00:00 2001 From: Prabhakar Kushwaha Date: Wed, 11 Oct 2017 08:51:18 +0530 Subject: driver: fsl-mc: use calloc instead malloc Memory allocated via malloc is not guaranteed to be zeroized. So explicitly use calloc instead of malloc. Signed-off-by: Prabhakar Kushwaha Reviewed-by: York Sun --- drivers/net/fsl-mc/mc.c | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) (limited to 'drivers') diff --git a/drivers/net/fsl-mc/mc.c b/drivers/net/fsl-mc/mc.c index 12dbcd8cc50..be2b6117d77 100644 --- a/drivers/net/fsl-mc/mc.c +++ b/drivers/net/fsl-mc/mc.c @@ -725,9 +725,9 @@ int mc_init(u64 mc_fw_addr, u64 mc_dpc_addr) * Initialize the global default MC portal * And check that the MC firmware is responding portal commands: */ - root_mc_io = (struct fsl_mc_io *)malloc(sizeof(struct fsl_mc_io)); + root_mc_io = (struct fsl_mc_io *)calloc(sizeof(struct fsl_mc_io), 1); if (!root_mc_io) { - printf(" No memory: malloc() failed\n"); + printf(" No memory: calloc() failed\n"); return -ENOMEM; } @@ -879,11 +879,12 @@ static int dpio_init(void) struct dpio_cfg dpio_cfg; int err = 0; - dflt_dpio = (struct fsl_dpio_obj *)malloc(sizeof(struct fsl_dpio_obj)); + dflt_dpio = (struct fsl_dpio_obj *)calloc( + sizeof(struct fsl_dpio_obj), 1); if (!dflt_dpio) { - printf("No memory: malloc() failed\n"); + printf("No memory: calloc() failed\n"); err = -ENOMEM; - goto err_malloc; + goto err_calloc; } dpio_cfg.channel_mode = DPIO_LOCAL_CHANNEL; @@ -948,7 +949,7 @@ err_get_attr: dpio_destroy(dflt_mc_io, MC_CMD_NO_FLAGS, dflt_dpio->dpio_handle); err_create: free(dflt_dpio); -err_malloc: +err_calloc: return err; } @@ -1030,11 +1031,11 @@ static int dprc_init(void) goto err_create; } - dflt_mc_io = (struct fsl_mc_io *)malloc(sizeof(struct fsl_mc_io)); + dflt_mc_io = (struct fsl_mc_io *)calloc(sizeof(struct fsl_mc_io), 1); if (!dflt_mc_io) { err = -ENOMEM; - printf(" No memory: malloc() failed\n"); - goto err_malloc; + printf(" No memory: calloc() failed\n"); + goto err_calloc; } child_portal_id = MC_PORTAL_OFFSET_TO_PORTAL_ID(mc_portal_offset); @@ -1059,7 +1060,7 @@ static int dprc_init(void) return 0; err_child_open: free(dflt_mc_io); -err_malloc: +err_calloc: dprc_destroy_container(root_mc_io, MC_CMD_NO_FLAGS, root_dprc_handle, child_dprc_id); err_create: @@ -1110,11 +1111,12 @@ static int dpbp_init(void) struct dpbp_attr dpbp_attr; struct dpbp_cfg dpbp_cfg; - dflt_dpbp = (struct fsl_dpbp_obj *)malloc(sizeof(struct fsl_dpbp_obj)); + dflt_dpbp = (struct fsl_dpbp_obj *)calloc( + sizeof(struct fsl_dpbp_obj), 1); if (!dflt_dpbp) { - printf("No memory: malloc() failed\n"); + printf("No memory: calloc() failed\n"); err = -ENOMEM; - goto err_malloc; + goto err_calloc; } dpbp_cfg.options = 512; @@ -1164,7 +1166,7 @@ err_get_attr: dpbp_close(dflt_mc_io, MC_CMD_NO_FLAGS, dflt_dpbp->dpbp_handle); dpbp_destroy(dflt_mc_io, MC_CMD_NO_FLAGS, dflt_dpbp->dpbp_handle); err_create: -err_malloc: +err_calloc: return err; } @@ -1206,11 +1208,12 @@ static int dpni_init(void) struct dpni_extended_cfg dpni_extended_cfg; struct dpni_cfg dpni_cfg; - dflt_dpni = (struct fsl_dpni_obj *)malloc(sizeof(struct fsl_dpni_obj)); + dflt_dpni = (struct fsl_dpni_obj *)calloc( + sizeof(struct fsl_dpni_obj), 1); if (!dflt_dpni) { - printf("No memory: malloc() failed\n"); + printf("No memory: calloc() failed\n"); err = -ENOMEM; - goto err_malloc; + goto err_calloc; } memset(&dpni_extended_cfg, 0, sizeof(dpni_extended_cfg)); @@ -1272,7 +1275,7 @@ err_get_attr: err_create: err_prepare_extended_cfg: free(dflt_dpni); -err_malloc: +err_calloc: return err; } -- cgit v1.3.1 From 2af1b08a1a14749f7447e5b54a69936b25f2c4b0 Mon Sep 17 00:00:00 2001 From: Ashish Kumar Date: Thu, 12 Oct 2017 15:21:54 +0530 Subject: armv8: ls1088aqds: Change phy mode to PHY_INTERFACE_MODE_RGMII_ID Since TX delay is now enabled only in PHY_INTERFACE_MODE_RGMII_ID PHY_INTERFACE_MODE_RGMII_TXID. These change where introduced in phy driver in commit 05b29aa0cb68 ("net: phy: realtek: fix enabling of the TX-delay for RTL8211F"). Signed-off-by: Ashish Kumar Reviewed-by: York Sun --- board/freescale/ls1088a/eth_ls1088aqds.c | 1 + drivers/net/ldpaa_eth/ls1088a.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/board/freescale/ls1088a/eth_ls1088aqds.c b/board/freescale/ls1088a/eth_ls1088aqds.c index de70aee8677..7fe446e624c 100644 --- a/board/freescale/ls1088a/eth_ls1088aqds.c +++ b/board/freescale/ls1088a/eth_ls1088aqds.c @@ -634,6 +634,7 @@ int board_eth_init(bd_t *bis) for (i = WRIOP1_DPMAC1; i < NUM_WRIOP_PORTS; i++) { switch (wriop_get_enet_if(i)) { case PHY_INTERFACE_MODE_RGMII: + case PHY_INTERFACE_MODE_RGMII_ID: ls1088a_handle_phy_interface_rgmii(i); break; case PHY_INTERFACE_MODE_QSGMII: diff --git a/drivers/net/ldpaa_eth/ls1088a.c b/drivers/net/ldpaa_eth/ls1088a.c index 061935e51c5..780a23998ad 100644 --- a/drivers/net/ldpaa_eth/ls1088a.c +++ b/drivers/net/ldpaa_eth/ls1088a.c @@ -99,7 +99,7 @@ void fsl_rgmii_init(void) ec >>= FSL_CHASSIS3_RCWSR25_EC1_PRTCL_SHIFT; if (!ec) - wriop_init_dpmac_enet_if(4, PHY_INTERFACE_MODE_RGMII); + wriop_init_dpmac_enet_if(4, PHY_INTERFACE_MODE_RGMII_ID); #endif #ifdef CONFIG_SYS_FSL_EC2 @@ -108,7 +108,7 @@ void fsl_rgmii_init(void) ec >>= FSL_CHASSIS3_RCWSR25_EC2_PRTCL_SHIFT; if (!ec) - wriop_init_dpmac_enet_if(5, PHY_INTERFACE_MODE_RGMII); + wriop_init_dpmac_enet_if(5, PHY_INTERFACE_MODE_RGMII_ID); #endif } #endif -- cgit v1.3.1 From 420b0eba3c957d82c598fbb3dff8187ce5cf7313 Mon Sep 17 00:00:00 2001 From: Ran Wang Date: Mon, 23 Oct 2017 10:09:22 +0800 Subject: usb: host: Move CONFIG_XHCI_FSL to Kconfig use Kconfig to select xhci accordingly. Signed-off-by: Ran Wang Reviewed-by: Bin Meng Reviewed-by: York Sun --- drivers/usb/host/Kconfig | 6 ++++++ include/configs/ls1012afrdm.h | 1 - include/configs/ls1012aqds.h | 1 - include/configs/ls1012ardb.h | 1 - include/configs/ls1021aiot.h | 1 - include/configs/ls1021aqds.h | 1 - include/configs/ls1021atwr.h | 1 - include/configs/ls1043aqds.h | 1 - include/configs/ls1043ardb.h | 1 - include/configs/ls1046aqds.h | 1 - include/configs/ls1046ardb.h | 1 - include/configs/ls2080aqds.h | 1 - include/configs/ls2080ardb.h | 1 - scripts/config_whitelist.txt | 1 - 14 files changed, 6 insertions(+), 13 deletions(-) (limited to 'drivers') diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index f5f19ed775c..5264475fa52 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig @@ -71,6 +71,12 @@ config USB_XHCI_DRA7XX_INDEX Select the DRA7XX xHCI USB index. Current supported values: 0, 1. +config USB_XHCI_FSL + bool "Support for NXP Layerscape on-chip xHCI USB controller" + default y if ARCH_LS1021A || FSL_LSCH3 || FSL_LSCH2 + depends on !SPL_NO_USB + help + Enables support for the on-chip xHCI controller on NXP Layerscape SoCs. endif # USB_XHCI_HCD config USB_EHCI_HCD diff --git a/include/configs/ls1012afrdm.h b/include/configs/ls1012afrdm.h index 2e5af9cc4e2..2e9c619bd52 100644 --- a/include/configs/ls1012afrdm.h +++ b/include/configs/ls1012afrdm.h @@ -34,7 +34,6 @@ /* * USB */ -#define CONFIG_USB_XHCI_FSL #define CONFIG_USB_MAX_CONTROLLER_COUNT 1 #define CONFIG_CMD_MEMINFO diff --git a/include/configs/ls1012aqds.h b/include/configs/ls1012aqds.h index e0949d0b53d..70bf72c4314 100644 --- a/include/configs/ls1012aqds.h +++ b/include/configs/ls1012aqds.h @@ -119,7 +119,6 @@ #endif /*XHCI Support - enabled by default*/ -#define CONFIG_USB_XHCI_FSL #define CONFIG_USB_MAX_CONTROLLER_COUNT 1 /* MMC */ diff --git a/include/configs/ls1012ardb.h b/include/configs/ls1012ardb.h index 66ff0043848..110fcc63238 100644 --- a/include/configs/ls1012ardb.h +++ b/include/configs/ls1012ardb.h @@ -22,7 +22,6 @@ /* * USB */ -#define CONFIG_USB_XHCI_FSL #define CONFIG_USB_MAX_CONTROLLER_COUNT 1 /* diff --git a/include/configs/ls1021aiot.h b/include/configs/ls1021aiot.h index 02bfbd0a7db..7c7f82f215a 100644 --- a/include/configs/ls1021aiot.h +++ b/include/configs/ls1021aiot.h @@ -20,7 +20,6 @@ #define CONFIG_SYS_INIT_RAM_SIZE OCRAM_SIZE /* XHCI Support - enabled by default */ -#define CONFIG_USB_XHCI_FSL #define CONFIG_USB_MAX_CONTROLLER_COUNT 1 #define CONFIG_SYS_CLK_FREQ 100000000 diff --git a/include/configs/ls1021aqds.h b/include/configs/ls1021aqds.h index 0046ded536f..8346e3658f0 100644 --- a/include/configs/ls1021aqds.h +++ b/include/configs/ls1021aqds.h @@ -405,7 +405,6 @@ unsigned long get_board_ddr_clk(void); #endif /*XHCI Support - enabled by default*/ -#define CONFIG_USB_XHCI_FSL #define CONFIG_USB_MAX_CONTROLLER_COUNT 1 /* diff --git a/include/configs/ls1021atwr.h b/include/configs/ls1021atwr.h index 0172c9015d3..8ccc81642d6 100644 --- a/include/configs/ls1021atwr.h +++ b/include/configs/ls1021atwr.h @@ -45,7 +45,6 @@ #endif /* XHCI Support - enabled by default */ -#define CONFIG_USB_XHCI_FSL #define CONFIG_USB_MAX_CONTROLLER_COUNT 1 #define CONFIG_SYS_CLK_FREQ 100000000 diff --git a/include/configs/ls1043aqds.h b/include/configs/ls1043aqds.h index 607c289d179..641ffc1400e 100644 --- a/include/configs/ls1043aqds.h +++ b/include/configs/ls1043aqds.h @@ -371,7 +371,6 @@ unsigned long get_board_ddr_clk(void); #endif /* USB */ -#define CONFIG_USB_XHCI_FSL #define CONFIG_USB_MAX_CONTROLLER_COUNT 3 /* diff --git a/include/configs/ls1043ardb.h b/include/configs/ls1043ardb.h index 34be9960c16..489f50c5b13 100644 --- a/include/configs/ls1043ardb.h +++ b/include/configs/ls1043ardb.h @@ -286,7 +286,6 @@ /* USB */ #ifndef SPL_NO_USB -#define CONFIG_USB_XHCI_FSL #define CONFIG_USB_MAX_CONTROLLER_COUNT 3 #endif diff --git a/include/configs/ls1046aqds.h b/include/configs/ls1046aqds.h index b0d41b401e8..7778f86881b 100644 --- a/include/configs/ls1046aqds.h +++ b/include/configs/ls1046aqds.h @@ -137,7 +137,6 @@ unsigned long get_board_ddr_clk(void); #endif /* USB */ -#define CONFIG_USB_XHCI_FSL #define CONFIG_USB_MAX_CONTROLLER_COUNT 3 /* SATA */ diff --git a/include/configs/ls1046ardb.h b/include/configs/ls1046ardb.h index 32b08d8229a..40ce8ff4623 100644 --- a/include/configs/ls1046ardb.h +++ b/include/configs/ls1046ardb.h @@ -211,7 +211,6 @@ /* USB */ #ifndef SPL_NO_USB -#define CONFIG_USB_XHCI_FSL #define CONFIG_USB_MAX_CONTROLLER_COUNT 3 #endif diff --git a/include/configs/ls2080aqds.h b/include/configs/ls2080aqds.h index d594cc10687..5dd1ff20654 100644 --- a/include/configs/ls2080aqds.h +++ b/include/configs/ls2080aqds.h @@ -438,7 +438,6 @@ unsigned long get_board_ddr_clk(void); /* * USB */ -#define CONFIG_USB_XHCI_FSL #define CONFIG_USB_MAX_CONTROLLER_COUNT 2 #include diff --git a/include/configs/ls2080ardb.h b/include/configs/ls2080ardb.h index c368a566572..eef78f21b63 100644 --- a/include/configs/ls2080ardb.h +++ b/include/configs/ls2080ardb.h @@ -336,7 +336,6 @@ unsigned long get_board_sys_clk(void); /* * USB */ -#define CONFIG_USB_XHCI_FSL #define CONFIG_USB_MAX_CONTROLLER_COUNT 2 #undef CONFIG_CMDLINE_EDITING diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 76267495bed..776c116669d 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -5026,7 +5026,6 @@ CONFIG_USB_TTY CONFIG_USB_TUSB_OMAP_DMA CONFIG_USB_ULPI_TIMEOUT CONFIG_USB_XHCI_EXYNOS -CONFIG_USB_XHCI_FSL CONFIG_USB_XHCI_KEYSTONE CONFIG_USB_XHCI_OMAP CONFIG_USER_LOWLEVEL_INIT -- cgit v1.3.1