From 2fdbf349bdab495dd2a33ebd44c02b24acc252b9 Mon Sep 17 00:00:00 2001 From: Ruixuan Li Date: Mon, 26 Nov 2018 15:16:55 +0800 Subject: [PATCH] arm: dts: tl1: config device on portB with dts [1/1] PD#172587 Problem: configuration for portB in dtsi can not support the sdcard and sdio at same time. Solution: move the device configuration into dts. SKT->SDCARD REF->SDIO Verify: test pass on tl1 skt and ref board Signed-off-by: Ruixuan Li Change-Id: I6d1da7a8d0d8d901c4a40a74f04973c155188ade Conflicts: arch/arm/boot/dts/amlogic/tl1_pxp.dts arch/arm/boot/dts/amlogic/tl1_t962x2_skt.dts arch/arm/boot/dts/amlogic/tl1_t962x2_x301.dts drivers/amlogic/mmc/amlsd.c --- arch/arm/boot/dts/amlogic/tl1_pxp.dts | 2 - arch/arm/boot/dts/amlogic/tl1_t962x2_skt.dts | 26 +-------- arch/arm/boot/dts/amlogic/tl1_t962x2_x301.dts | 56 +++++++++++++++---- drivers/amlogic/mmc/amlsd.c | 7 ++- 4 files changed, 50 insertions(+), 41 deletions(-) diff --git a/arch/arm/boot/dts/amlogic/tl1_pxp.dts b/arch/arm/boot/dts/amlogic/tl1_pxp.dts index 6506f548685a..15bf6a776194 100644 --- a/arch/arm/boot/dts/amlogic/tl1_pxp.dts +++ b/arch/arm/boot/dts/amlogic/tl1_pxp.dts @@ -599,7 +599,6 @@ f_min = <400000>; f_max = <200000000>; max_req_size = <0x20000>; /**128KB*/ - no_sduart = <1>; gpio_dat3 = <&gpio GPIOC_3 GPIO_ACTIVE_HIGH>; jtag_pin = <&gpio GPIOC_0 GPIO_ACTIVE_HIGH>; gpio_cd = <&gpio GPIOC_10 GPIO_ACTIVE_HIGH>; @@ -609,7 +608,6 @@ */ }; }; - }; /* end of / */ &audiobus { diff --git a/arch/arm/boot/dts/amlogic/tl1_t962x2_skt.dts b/arch/arm/boot/dts/amlogic/tl1_t962x2_skt.dts index 8c23c7170502..9bbe37348fff 100644 --- a/arch/arm/boot/dts/amlogic/tl1_t962x2_skt.dts +++ b/arch/arm/boot/dts/amlogic/tl1_t962x2_skt.dts @@ -1016,14 +1016,7 @@ tuner_xtal_cap_0 = <25>; /* when tuner_xtal_mode = 3, set 25 */ }; - bt-dev{ - compatible = "amlogic, bt-dev"; - status = "okay"; - gpio_reset = <&gpio GPIOC_13 GPIO_ACTIVE_HIGH>; - }; - - wifi{ - compatible = "amlogic, aml_wifi"; + sd_emmc_b: sd@ffe05000 { status = "okay"; compatible = "amlogic, meson-mmc-tl1"; reg = <0xffe05000 0x800>; @@ -1058,7 +1051,6 @@ f_min = <400000>; f_max = <200000000>; max_req_size = <0x20000>; /**128KB*/ - no_sduart = <1>; gpio_dat3 = <&gpio GPIOC_3 GPIO_ACTIVE_HIGH>; jtag_pin = <&gpio GPIOC_0 GPIO_ACTIVE_HIGH>; gpio_cd = <&gpio GPIOC_10 GPIO_ACTIVE_HIGH>; @@ -1461,18 +1453,6 @@ }; }; -&sd_emmc_b { - status = "okay"; - sd { - caps = "MMC_CAP_4_BIT_DATA", - "MMC_CAP_MMC_HIGHSPEED", - "MMC_CAP_SD_HIGHSPEED", - "MMC_CAP_NONREMOVABLE"; /**ptm debug */ - f_min = <400000>; - f_max = <200000000>; - }; -}; - &spifc { status = "disabled"; spi-nor@0 { @@ -1633,10 +1613,6 @@ }; }; -&pwm_ab { - status = "okay"; -}; - &efuse { status = "okay"; }; diff --git a/arch/arm/boot/dts/amlogic/tl1_t962x2_x301.dts b/arch/arm/boot/dts/amlogic/tl1_t962x2_x301.dts index d7b961dc9d2a..f2623c53ddeb 100644 --- a/arch/arm/boot/dts/amlogic/tl1_t962x2_x301.dts +++ b/arch/arm/boot/dts/amlogic/tl1_t962x2_x301.dts @@ -1096,6 +1096,51 @@ }; }; + sd_emmc_b: sdio@ffe05000 { + status = "okay"; + compatible = "amlogic, meson-mmc-tl1"; + reg = <0xffe05000 0x800>; + interrupts = <0 190 4>; + + pinctrl-names = "sdio_all_pins", + "sdio_clk_cmd_pins"; + pinctrl-0 = <&sdio_all_pins>; + pinctrl-1 = <&sdio_clk_cmd_pins>; + + clocks = <&clkc CLKID_SD_EMMC_B>, + <&clkc CLKID_SD_EMMC_B_P0_COMP>, + <&clkc CLKID_FCLK_DIV2>, + <&clkc CLKID_FCLK_DIV5>, + <&xtal>; + clock-names = "core", "clkin0", "clkin1", "clkin2", "xtal"; + + bus-width = <4>; + cap-sd-highspeed; + cap-mmc-highspeed; + max-frequency = <100000000>; + disable-wp; + sdio { + pinname = "sdio"; + ocr_avail = <0x200080>; /**VDD voltage 3.3 ~ 3.4 */ + caps = "MMC_CAP_4_BIT_DATA", + "MMC_CAP_MMC_HIGHSPEED", + "MMC_CAP_SD_HIGHSPEED", + "MMC_CAP_NONREMOVABLE", /**ptm debug */ + "MMC_CAP_UHS_SDR12", + "MMC_CAP_UHS_SDR25", + "MMC_CAP_UHS_SDR50", + "MMC_CAP_UHS_SDR104", + "MMC_PM_KEEP_POWER", + "MMC_CAP_SDIO_IRQ"; + f_min = <400000>; + f_max = <200000000>; + max_req_size = <0x20000>; /**128KB*/ + card_type = <3>; + /* 3:sdio device(ie:sdio-wifi), + * 4:SD combo (IO+mem) card + */ + }; + }; }; /* end of / */ &i2c0 { @@ -1547,17 +1592,6 @@ }; }; -&sd_emmc_b { - status = "okay"; - sd { - caps = "MMC_CAP_4_BIT_DATA", - "MMC_CAP_MMC_HIGHSPEED", - "MMC_CAP_SD_HIGHSPEED", - "MMC_CAP_NONREMOVABLE"; /**ptm debug */ - f_min = <400000>; - f_max = <200000000>; - }; -}; &spifc { status = "disabled"; diff --git a/drivers/amlogic/mmc/amlsd.c b/drivers/amlogic/mmc/amlsd.c index 3b9100677659..14b24fb62507 100644 --- a/drivers/amlogic/mmc/amlsd.c +++ b/drivers/amlogic/mmc/amlsd.c @@ -861,7 +861,8 @@ int aml_sd_uart_detect(struct amlsd_platform *pdata) return 1; pdata->is_in = true; pdata->gpio_cd_sta = true; - if (aml_is_sduart(pdata)) { + if ((host->data->chip_type < MMC_CHIP_TL1) + && aml_is_sduart(pdata)) { aml_uart_switch(pdata, 1); pr_info("Uart in\n"); mmc->caps &= ~MMC_CAP_4_BIT_DATA; @@ -876,7 +877,7 @@ int aml_sd_uart_detect(struct amlsd_platform *pdata) } } else { pr_info("normal card in\n"); - if (!pdata->no_sduart) { + if (host->data->chip_type < MMC_CHIP_TL1) { aml_uart_switch(pdata, 0); aml_jtag_switch_ao(pdata); } @@ -901,7 +902,7 @@ int aml_sd_uart_detect(struct amlsd_platform *pdata) host->is_sduart = 0; if (mmc && mmc->card) mmc_card_set_removed(mmc->card); - if (!pdata->no_sduart) { + if (host->data->chip_type < MMC_CHIP_TL1) { aml_uart_switch(pdata, 0); aml_jtag_switch_ao(pdata); }