mirror of https://github.com/OpenIPC/firmware.git
[T31] Add cmdline option to disable GMAC (#618)
parent
8b4273303f
commit
bdd24c7dd8
|
@ -0,0 +1,71 @@
|
|||
--- a/arch/mips/xburst/soc-t31/common/gpio.c
|
||||
+++ b/arch/mips/xburst/soc-t31/common/gpio.c
|
||||
@@ -85,6 +85,7 @@
|
||||
#endif
|
||||
extern int __init gpio_customized_init(void);
|
||||
extern void __enable_irq(struct irq_desc *desc, unsigned int irq, bool resume);
|
||||
+extern int disable_gmac;
|
||||
|
||||
struct jzgpio_state {
|
||||
unsigned int pxint;
|
||||
@@ -972,6 +973,15 @@
|
||||
break;
|
||||
}
|
||||
|
||||
+ if (!strcmp(g->name,"gmac_pb") && disable_gmac){
|
||||
+ pr_info("Skipping GMAC GPIO setup\n");
|
||||
+ continue;
|
||||
+ }
|
||||
+ if (!strcmp(g->name,"msc1-pB") && !disable_gmac){
|
||||
+ pr_info("Skipping MSC1_PB GPIO setup\n");
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
jz = &jz_gpio_chips[g->port];
|
||||
if (GPIO_AS_FUNC(g->func)) {
|
||||
if(jz->dev_map[0] & g->pins) {
|
||||
--- a/arch/mips/xburst/soc-t31/common/platform.c
|
||||
+++ b/arch/mips/xburst/soc-t31/common/platform.c
|
||||
@@ -1032,6 +1032,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/drivers/net/ethernet/ingenic/jz_mac_v13.c
|
||||
+++ b/drivers/net/ethernet/ingenic/jz_mac_v13.c
|
||||
@@ -2392,8 +2392,11 @@
|
||||
|
||||
#define JZ_GMAC_BASE 0xb34b0000
|
||||
|
||||
+extern int disable_gmac;
|
||||
+
|
||||
static int __init jz_mac_init(void)
|
||||
{
|
||||
+if (!disable_gmac){
|
||||
#ifndef CONFIG_MDIO_GPIO
|
||||
int ret;
|
||||
#endif
|
||||
@@ -2420,6 +2423,11 @@
|
||||
|
||||
#endif
|
||||
}
|
||||
+else{
|
||||
+ pr_info("JZ GMAC disabled\n");
|
||||
+ return -ENODEV;
|
||||
+}
|
||||
+}
|
||||
|
||||
module_init(jz_mac_init);
|
||||
|
|
@ -1436,12 +1436,12 @@ CONFIG_JZMMC_V12_MMC0=y
|
|||
# CONFIG_JZMMC_V12_MMC0_PA_4BIT is not set
|
||||
# CONFIG_JZMMC_V12_MMC0_PA_8BIT is not set
|
||||
CONFIG_JZMMC_V12_MMC0_PB_4BIT=y
|
||||
CONFIG_MMC0_MAX_FREQ=24000000
|
||||
CONFIG_MMC0_MAX_FREQ=48000000
|
||||
# CONFIG_MMC0_PIO_MODE 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_JZMMC_V12_MMC1_PB_4BIT=y
|
||||
# CONFIG_JZMMC_V12_MMC1_PC_4BIT is not set
|
||||
CONFIG_MMC1_MAX_FREQ=24000000
|
||||
# CONFIG_MMC1_PIO_MODE is not set
|
||||
# CONFIG_JZMMC_V12_MMC2 is not set
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue