From eb8547650b4eba58cd82576d3b813341757d1e01 Mon Sep 17 00:00:00 2001 From: Dmitry Ermakov Date: Thu, 20 Apr 2023 23:52:24 +0300 Subject: [PATCH] [T20] Enable SDIO & Wyze V2 hacks --- .../board/t21/kernel/t20.generic.config | 6 +- .../0009-optional-disable-jz-gmac.patch | 70 +++++++++++++++++++ .../kernel/patches/0010-wyze-mmc-gpio.patch | 13 ++++ 3 files changed, 88 insertions(+), 1 deletion(-) diff --git a/br-ext-chip-ingenic/board/t21/kernel/t20.generic.config b/br-ext-chip-ingenic/board/t21/kernel/t20.generic.config index 2f692084..7d60516e 100644 --- a/br-ext-chip-ingenic/board/t21/kernel/t20.generic.config +++ b/br-ext-chip-ingenic/board/t21/kernel/t20.generic.config @@ -1601,7 +1601,11 @@ CONFIG_JZMMC_V12_MMC0=y CONFIG_JZMMC_V12_MMC0_PB_4BIT=y CONFIG_MMC0_MAX_FREQ=48000000 # CONFIG_MMC0_PIO_MODE is not set -# CONFIG_JZMMC_V12_MMC1 is not set +CONFIG_JZMMC_V12_MMC1=y +# CONFIG_JZMMC_V12_MMC1_PD_4BIT is not set +# CONFIG_JZMMC_V12_MMC1_PB_4BIT is not set +CONFIG_JZMMC_V12_MMC1_PC_4BIT=y +CONFIG_MMC1_MAX_FREQ=24000000 # CONFIG_JZMMC_V12_MMC2 is not set # CONFIG_MMC_SDHCI is not set # CONFIG_MMC_VUB300 is not set diff --git a/br-ext-chip-ingenic/board/t31/kernel/patches/0009-optional-disable-jz-gmac.patch b/br-ext-chip-ingenic/board/t31/kernel/patches/0009-optional-disable-jz-gmac.patch index cf86ac15..85fe41e0 100644 --- a/br-ext-chip-ingenic/board/t31/kernel/patches/0009-optional-disable-jz-gmac.patch +++ b/br-ext-chip-ingenic/board/t31/kernel/patches/0009-optional-disable-jz-gmac.patch @@ -24,6 +24,76 @@ jz = &jz_gpio_chips[g->port]; if (GPIO_AS_FUNC(g->func)) { if(jz->dev_map[0] & g->pins) { +--- a/arch/mips/xburst/soc-t10/common/platform.c ++++ b/arch/mips/xburst/soc-t10/common/platform.c +@@ -960,3 +960,13 @@ + return 1; + } + __setup("ispmem=", ispmem_parse); ++ ++int disable_gmac = 0; ++EXPORT_SYMBOL(disable_gmac); ++ ++static int __init extras_parse(char *str) ++{ ++ disable_gmac = 1; ++ return 0; ++} ++__setup("nogmac", extras_parse); +--- a/arch/mips/xburst/soc-t20/common/platform.c ++++ b/arch/mips/xburst/soc-t20/common/platform.c +@@ -927,3 +927,13 @@ + return 1; + } + __setup("ispmem=", ispmem_parse); ++ ++int disable_gmac = 0; ++EXPORT_SYMBOL(disable_gmac); ++ ++static int __init extras_parse(char *str) ++{ ++ disable_gmac = 1; ++ return 0; ++} ++__setup("nogmac", extras_parse); +--- a/arch/mips/xburst/soc-t21/common/platform.c ++++ b/arch/mips/xburst/soc-t21/common/platform.c +@@ -935,6 +935,16 @@ + *size = ispmem_size; + } + ++int disable_gmac = 0; ++EXPORT_SYMBOL(disable_gmac); ++ ++static int __init extras_parse(char *str) ++{ ++ disable_gmac = 1; ++ return 0; ++} ++__setup("nogmac", extras_parse); ++ + #ifndef CONFIG_PROC_FS + #error NOT config procfs + #endif +--- a/arch/mips/xburst/soc-t30/common/platform.c ++++ b/arch/mips/xburst/soc-t30/common/platform.c +@@ -936,6 +936,16 @@ + *size = ispmem_size; + } + ++int disable_gmac = 0; ++EXPORT_SYMBOL(disable_gmac); ++ ++static int __init extras_parse(char *str) ++{ ++ disable_gmac = 1; ++ return 0; ++} ++__setup("nogmac", extras_parse); ++ + #ifndef CONFIG_PROC_FS + #error NOT config procfs + #endif --- a/arch/mips/xburst/soc-t31/common/platform.c +++ b/arch/mips/xburst/soc-t31/common/platform.c @@ -1032,6 +1032,16 @@ diff --git a/br-ext-chip-ingenic/board/t31/kernel/patches/0010-wyze-mmc-gpio.patch b/br-ext-chip-ingenic/board/t31/kernel/patches/0010-wyze-mmc-gpio.patch index 3c0cbce8..cd06c3ac 100644 --- a/br-ext-chip-ingenic/board/t31/kernel/patches/0010-wyze-mmc-gpio.patch +++ b/br-ext-chip-ingenic/board/t31/kernel/patches/0010-wyze-mmc-gpio.patch @@ -24,3 +24,16 @@ #define MSC1_PORTC \ { .name = "msc1-pC", .port = GPIO_PORT_C, .func = GPIO_FUNC_0, .pins = (0x3f<<2), } #define I2S_PORTC \ +--- a/arch/mips/xburst/soc-t20/include/mach/platform.h ++++ b/arch/mips/xburst/soc-t20/include/mach/platform.h +@@ -21,8 +21,9 @@ + #define MSC0_PORTB_4BIT \ + { .name = "msc0-pb-4bit", .port = GPIO_PORT_B, .func = GPIO_FUNC_0, .pins = (0x3<<4|0xf<<0), } + #define MSC1_PORTC \ +- { .name = "msc1-pC", .port = GPIO_PORT_C, .func = GPIO_FUNC_0, .pins = (0x3f<<2), } +- ++ { .name = "msc1-pC", .port = GPIO_PORT_C, .func = GPIO_FUNC_0, .pins = (0x3f<<2), }, \ ++ { .name = "wyze-mmc-enable", .port = GPIO_PORT_B, .func = GPIO_OUTPUT0, .pins = 0x620<<10, }, \ ++ { .name = "wyze-mmc-detect", .port = GPIO_PORT_B, .func = GPIO_OUTPUT1, .pins = 0x20<<10, } + /*******************************************************************************************************************/ + /*****************************************************************************************************************/