From a59a2062c01282639f7a51225a86b0b2049ad828 Mon Sep 17 00:00:00 2001 From: vojo Date: Tue, 9 Jan 2018 14:12:58 +0100 Subject: M.2 SATA tested diff --git a/arch/arm/dts/grapeboard.dts b/arch/arm/dts/grapeboard.dts index 18ee0d3..3331285 100644 --- a/arch/arm/dts/grapeboard.dts +++ b/arch/arm/dts/grapeboard.dts @@ -1,7 +1,6 @@ /* - * Device Tree file for Freescale Layerscape-1012A family SoC. - * - * Copyright 2016, Freescale Semiconductor + * Copyright 2017 Scalys B.V. + * opensource@scalys.com * * SPDX-License-Identifier: GPL-2.0+ */ diff --git a/arch/arm/dts/grapeboard.dtsi b/arch/arm/dts/grapeboard.dtsi index bb53f24..5389b30 100644 --- a/arch/arm/dts/grapeboard.dtsi +++ b/arch/arm/dts/grapeboard.dtsi @@ -1,11 +1,8 @@ /* - * Device Tree Include file for Freescale Layerscape-1012A family SoC. + * Copyright 2017 Scalys B.V. + * opensource@scalys.com * - * Copyright 2016, Freescale Semiconductor - * - * This file is licensed under the terms of the GNU General Public - * License version 2. This program is licensed "as is" without any - * warranty of any kind, whether express or implied. + * SPDX-License-Identifier: GPL-2.0+ */ /include/ "fsl-ls1012a.dtsi" diff --git a/board/scalys/grapeboard/Kconfig b/board/scalys/grapeboard/Kconfig index 4eb17aa..72d67ca 100644 --- a/board/scalys/grapeboard/Kconfig +++ b/board/scalys/grapeboard/Kconfig @@ -14,20 +14,6 @@ config SYS_CONFIG_NAME menu "Grapeboard configuration options" depends on TARGET_GRAPEBOARD - -choice - prompt "SERDES configuration for PCIE or SATA" - default SERDES_D_TO_SATA - -config SERDES_D_TO_PCIE - bool - prompt "Support PCIe" - -config SERDES_D_TO_SATA - bool - prompt "Support SATA (Eth1 disabled)" - -endchoice choice prompt "U-boot environment configuration" diff --git a/board/scalys/grapeboard/PBL_0x33_0x05_800_250_1000.bin b/board/scalys/grapeboard/PBL_0x33_0x05_800_250_1000.bin index 994511d..5487ff6 100644 Binary files a/board/scalys/grapeboard/PBL_0x33_0x05_800_250_1000.bin and b/board/scalys/grapeboard/PBL_0x33_0x05_800_250_1000.bin differ diff --git a/board/scalys/grapeboard/PBL_0x33_0x08_800_250_1000.bin b/board/scalys/grapeboard/PBL_0x33_0x08_800_250_1000.bin new file mode 100644 index 0000000..2a12fd0 Binary files /dev/null and b/board/scalys/grapeboard/PBL_0x33_0x08_800_250_1000.bin differ diff --git a/board/scalys/grapeboard/PBL_0x35_0x08_800_250_1000.bin b/board/scalys/grapeboard/PBL_0x35_0x08_800_250_1000.bin index 86d6227..11db49f 100644 Binary files a/board/scalys/grapeboard/PBL_0x35_0x08_800_250_1000.bin and b/board/scalys/grapeboard/PBL_0x35_0x08_800_250_1000.bin differ diff --git a/board/scalys/grapeboard/grapeboard.c b/board/scalys/grapeboard/grapeboard.c index eade1bd..a0c0a9e 100644 --- a/board/scalys/grapeboard/grapeboard.c +++ b/board/scalys/grapeboard/grapeboard.c @@ -42,6 +42,7 @@ int checkboard(void) int ret; #endif int m2_config = 0; + int serdes_cfg = get_serdes_protocol(); puts("Board: Grape board\n"); @@ -63,28 +64,26 @@ int checkboard(void) /* Configure USB hub */ usb_hx3_hub_init(); - /* Scanning for M.2 module */ + /* Check for an M.2 module */ clrbits_be32(&pgpio->gpdir, (M2_CFG0 | M2_CFG1 | M2_CFG2 | M2_CFG3)); m2_config = (in_be32(&pgpio->gpdat) & (M2_CFG0 | M2_CFG1 | M2_CFG2 | M2_CFG3)); switch(m2_config >> 17) { case 0: - printf("M.2: SATA SSD module found on M.2 port\n"); -#if defined(CONFIG_SERDES_D_TO_PCIE) && defined(CONFIG_PBL_IMAGE) - printf("Warning: SERDES has not been configured in RCW for SATA!\n"); -#endif + printf("M.2: SATA SSD module found\n"); + if (serdes_cfg & 0x5) + printf("Warning: SERDES has not been configured in RCW for SATA!\n"); break; case 1: - printf("M.2: PCIe SSD module found on M.2 port\n"); -#if defined(CONFIG_SERDES_D_TO_SATA) && defined(CONFIG_PBL_IMAGE) - printf("Warning: SERDES has not been configured in RCW for PCIe!\n"); -#endif + printf("M.2: PCIe SSD module found\n"); + if (serdes_cfg & 0x8) + printf("Warning: SERDES has not been configured in RCW for PCIe!\n"); break; case 0xf: - printf("M.2: No module detected on M.2 port\n"); + printf("M.2: No module detected\n"); break; default: - printf("M.2: A module has been detected on M.2 port(TODO: add module type)\n"); + printf("M.2: A module has been detected (TODO: add module type and support)\n"); break; } @@ -93,8 +92,6 @@ int checkboard(void) int misc_init_r(void) { - - return 0; } @@ -162,31 +159,6 @@ int board_init(void) return 0; } -int esdhc_status_fixup(void *blob, const char *compat) -{ - /*char esdhc0_path[] = "/soc/esdhc@1560000";*/ - - return 0; -} - -void scsi_init(void) -{ -#if defined(CONFIG_SCSI_AHCI_PLAT) && defined(CONFIG_SERDES_D_TO_SATA) - struct ccsr_ahci __iomem *ccsr_ahci = (void *)CONFIG_SYS_SATA; - - /* Disable SATA ECC */ - out_le32((void *)CONFIG_SYS_DCSR_DCFG_ADDR + 0x520, 0x80000000); - out_le32(&ccsr_ahci->ppcfg, AHCI_PORT_PHY_1_CFG); - out_le32(&ccsr_ahci->ptc, AHCI_PORT_TRANS_CFG); - out_le32(&ccsr_ahci->axicc, AHCI_PORT_AXICC_CFG); - - ahci_init((void __iomem *)CONFIG_SYS_SATA); - scsi_scan(0); -#else - printf("Disabled\n"); -#endif -} - int ft_board_setup(void *blob, bd_t *bd) { arch_fixup_fdt(blob); diff --git a/board/scalys/grapeboard/usb_grapeboard.c b/board/scalys/grapeboard/usb_grapeboard.c index 5a75f99..f4d443e 100644 --- a/board/scalys/grapeboard/usb_grapeboard.c +++ b/board/scalys/grapeboard/usb_grapeboard.c @@ -24,18 +24,18 @@ const uint8_t hx3_settings[5 + HX3_SETTINGS_SIZE] = { HX3_SETTINGS_SIZE, /* payload size (192) */ 0xb4, 0x04, /* VID */ 0x04, 0x65, /* PID */ - 0x0a, 0x50, /* DID */ + 10, 50, /* DID */ 0x00, /* Reserved */ - 0x0f, /* 4 SuperSpeed ports, no shared link */ + 0x07, /* DS4 has no SuperSpeed port, DS4 is in shared link mode */ 0x32, /* bPwrOn2PwrGood : 100 ms */ 0x7f, /* 4 Downstream ports : DS4 is non-removable (MCU) */ - 0xe1, /* LEDs disabled, Ganged power switching */ - 0xa0, /* suspend indicator disabled, power switch control is active high */ - 0x04, /* BC v1.2 disabled, apple charging 1A, ghost charging disabled */ - 0x00, /* port charging, cdp & dcp disabled */ - 0xd8, /* US is embedded port, overcurrent input is active high */ + 0x11, /* Ganged power switching */ + 0x20, /* suspend indicator disabled, power switch control is active high */ + 0x11, /* BC v1.2 and ghost charging enabled */ + 0xf0, /* cdp enabled */ + 0x78, /* overcurrent input is active high */ 0x00, /* reserved */ - 0x08, /* USB String descriptors enabled */ + 0x00, /* USB String descriptors enabled */ 0x00, 0x00, 0x12, 0x00, 0x2c, 0x66, 0x66, /* USB3.0 TX driver de-emphasis */ @@ -93,6 +93,14 @@ int usb_hx3_hub_init(void) { data += length; } + /* Suspend USB2.0 PHY */ + /*unsigned int val; + + val = in_be32(0x2f0c200); + setbits_be32(0x2f0c200, val & (64 << 24)); + mdelay(10);*/ + + puts("Done!\n"); return 0; } @@ -101,3 +109,9 @@ int usb_hx3_hub_reset(void) { /* USB hub cannot be reset in software without resetting the ls1012a */ return 1; } + +/*void usb_hub_reset_devices(int port) +{ + udelay(100); + return; +}*/ diff --git a/board/scalys/grapeboard/usb_grapeboard.h b/board/scalys/grapeboard/usb_grapeboard.h index ae6289b..6bffe41 100644 --- a/board/scalys/grapeboard/usb_grapeboard.h +++ b/board/scalys/grapeboard/usb_grapeboard.h @@ -10,5 +10,6 @@ int usb_hx3_hub_init(void); int usb_hx3_hub_reset(void); +void usb_hub_reset_devices(int); #endif /* USB_GRAPEBOARD_H_ */ diff --git a/configs/grapeboard_pcie_qspi_defconfig b/configs/grapeboard_pcie_qspi_defconfig index cbb149e..a2a03d9 100644 --- a/configs/grapeboard_pcie_qspi_defconfig +++ b/configs/grapeboard_pcie_qspi_defconfig @@ -3,7 +3,6 @@ CONFIG_TARGET_GRAPEBOARD=y CONFIG_FSL_LS_PPA=y CONFIG_QSPI_AHB_INIT=y CONFIG_DEFAULT_DEVICE_TREE="grapeboard" -CONFIG_SERDES_D_TO_PCIE=y CONFIG_STANDARD_UBOOT_CONFIG=y CONFIG_SYS_LS_PPA_FW_ADDR=0x40240000 CONFIG_SYS_LS_PFE_FW_ADDR=0x40280000 diff --git a/configs/grapeboard_sata_qspi_defconfig b/configs/grapeboard_sata_qspi_defconfig index 90f7f36..f1476bc 100644 --- a/configs/grapeboard_sata_qspi_defconfig +++ b/configs/grapeboard_sata_qspi_defconfig @@ -3,7 +3,6 @@ CONFIG_TARGET_GRAPEBOARD=y CONFIG_FSL_LS_PPA=y CONFIG_QSPI_AHB_INIT=y CONFIG_DEFAULT_DEVICE_TREE="grapeboard" -CONFIG_SERDES_D_TO_SATA=y CONFIG_STANDARD_UBOOT_CONFIG=y CONFIG_SYS_LS_PPA_FW_ADDR=0x40240000 CONFIG_SYS_LS_PFE_FW_ADDR=0x40280000 diff --git a/include/configs/grapeboard.h b/include/configs/grapeboard.h index 0d5c21e..78b5447 100644 --- a/include/configs/grapeboard.h +++ b/include/configs/grapeboard.h @@ -20,6 +20,7 @@ #define CONFIG_SUPPORT_RAW_INITRD +#define CONFIG_BOARD_LATE_INIT #define CONFIG_DISPLAY_BOARDINFO_LATE /* Match the following u-boot offsets with the value in the PBI instructions! */ @@ -139,13 +140,27 @@ #define EMAC2_PHY_ADDR 0x2 #endif +/* +* USB +*/ +/* EHCI Support - disbaled by default */ +/*#define CONFIG_HAS_FSL_DR_USB*/ + +#ifdef CONFIG_HAS_FSL_DR_USB +#define CONFIG_USB_EHCI_FSL +#define CONFIG_USB_ULPI +#define CONFIG_USB_ULPI_VIEWPORT +#define CONFIG_USB_EHCI_HCD +#define CONFIG_EHCI_HCD_INIT_AFTER_RESET +#endif + /* USB XHCI */ /* todo: fix hx3 hub configuration errors */ #define CONFIG_HAS_FSL_XHCI_USB #ifdef CONFIG_HAS_FSL_XHCI_USB #define CONFIG_USB_XHCI_FSL -#define CONFIG_USB_XHCI_PCI +/*#define CONFIG_USB_XHCI_PCI*/ #define CONFIG_USB_MAX_CONTROLLER_COUNT 1 #endif @@ -217,8 +232,6 @@ "eth1addr=02:00:00:ba:be:02\0" \ "tftp_path=.\0" \ "autoload=no\0" \ - "hwconfig=" \ - "usb0:dr_mode=host\0" /* Default flash specific environment variables */ #if CONFIG_RESCUE_UBOOT_CONFIG -- cgit v0.10.2