From: Jonas Gorski Date: Tue, 7 Feb 2017 13:28:07 +0000 (+0100) Subject: brcm63xx: drop support for specifying SPI flash part parsers X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=334f8f4fc33f5fbc52e08477f00971f1e66405ae;p=openwrt%2Fstaging%2Fjogo.git brcm63xx: drop support for specifying SPI flash part parsers No need to keep this since we set them from device-tree. Signed-off-by: Jonas Gorski --- diff --git a/target/linux/brcm63xx/patches-4.4/201-SPI-Allow-specifying-the-parsers-for-SPI-flash.patch b/target/linux/brcm63xx/patches-4.4/201-SPI-Allow-specifying-the-parsers-for-SPI-flash.patch deleted file mode 100644 index 00dc9c90ee..0000000000 --- a/target/linux/brcm63xx/patches-4.4/201-SPI-Allow-specifying-the-parsers-for-SPI-flash.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 3f650fc30aa0badf9d02842ce396cea3eef2eeaa Mon Sep 17 00:00:00 2001 -From: Jonas Gorski -Date: Fri, 1 Jul 2011 23:16:47 +0200 -Subject: [PATCH 49/79] SPI: Allow specifying the parsers for SPI flash - -Signed-off-by: Jonas Gorski ---- - include/linux/spi/flash.h | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - ---- a/include/linux/spi/flash.h -+++ b/include/linux/spi/flash.h -@@ -2,7 +2,7 @@ - #define LINUX_SPI_FLASH_H - - struct mtd_partition; -- -+struct mtd_part_parser_data; - /** - * struct flash_platform_data: board-specific flash data - * @name: optional flash device name (eg, as used with mtdparts=) -@@ -10,6 +10,8 @@ struct mtd_partition; - * @nr_parts: number of mtd_partitions for static partitoning - * @type: optional flash device type (e.g. m25p80 vs m25p64), for use - * with chips that can't be queried for JEDEC or other IDs -+ * @part_probe_types: optional list of MTD parser names to use for -+ * partitioning - * - * Board init code (in arch/.../mach-xxx/board-yyy.c files) can - * provide information about SPI flash parts (such as DataFlash) to -@@ -25,6 +27,7 @@ struct flash_platform_data { - - char *type; - -+ const char **part_probe_types; - /* we'll likely add more ... use JEDEC IDs, etc */ - }; - diff --git a/target/linux/brcm63xx/patches-4.4/202-MTD-DEVICES-m25p80-use-parsers-if-provided-in-flash-.patch b/target/linux/brcm63xx/patches-4.4/202-MTD-DEVICES-m25p80-use-parsers-if-provided-in-flash-.patch deleted file mode 100644 index b0c776a9a3..0000000000 --- a/target/linux/brcm63xx/patches-4.4/202-MTD-DEVICES-m25p80-use-parsers-if-provided-in-flash-.patch +++ /dev/null @@ -1,26 +0,0 @@ -From c7c3c338cb25d7f55ddb3f6bfbf3572758ca3896 Mon Sep 17 00:00:00 2001 -From: Jonas Gorski -Date: Thu, 10 Nov 2011 16:53:08 +0100 -Subject: [PATCH 50/79] MTD: DEVICES: m25p80: use parsers if provided in flash - platform data - -Signed-off-by: Jonas Gorski ---- - drivers/mtd/devices/m25p80.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/drivers/mtd/devices/m25p80.c -+++ b/drivers/mtd/devices/m25p80.c -@@ -260,8 +260,10 @@ static int m25p_probe(struct spi_device - if (ret) - return ret; - -- return mtd_device_register(&nor->mtd, data ? data->parts : NULL, -- data ? data->nr_parts : 0); -+ return mtd_device_parse_register(&nor->mtd, -+ data ? data->part_probe_types : NULL, NULL, -+ data ? data->parts : NULL, -+ data ? data->nr_parts : 0); - } - - diff --git a/target/linux/brcm63xx/patches-4.4/411-MIPS-BCM63XX-Register-SPI-flash-if-present.patch b/target/linux/brcm63xx/patches-4.4/411-MIPS-BCM63XX-Register-SPI-flash-if-present.patch index 9dfa834b20..6dab40d7e1 100644 --- a/target/linux/brcm63xx/patches-4.4/411-MIPS-BCM63XX-Register-SPI-flash-if-present.patch +++ b/target/linux/brcm63xx/patches-4.4/411-MIPS-BCM63XX-Register-SPI-flash-if-present.patch @@ -25,14 +25,10 @@ Signed-off-by: Jonas Gorski #include #include -@@ -66,6 +70,46 @@ void __init bcm63xx_flash_force_phys_bas +@@ -66,6 +70,41 @@ void __init bcm63xx_flash_force_phys_bas mtd_resources[0].end = end; } -+static struct flash_platform_data bcm63xx_flash_data = { -+ .part_probe_types = bcm63xx_part_types, -+}; -+ +static struct spi_board_info bcm63xx_spi_flash_info[] = { + { + .bus_num = 0, @@ -40,7 +36,6 @@ Signed-off-by: Jonas Gorski + .mode = 0, + .max_speed_hz = 781000, + .modalias = "m25p80", -+ .platform_data = &bcm63xx_flash_data, + }, +}; + @@ -72,7 +67,7 @@ Signed-off-by: Jonas Gorski static int __init bcm63xx_detect_flash_type(void) { u32 val; -@@ -73,9 +117,15 @@ static int __init bcm63xx_detect_flash_t +@@ -73,9 +112,15 @@ static int __init bcm63xx_detect_flash_t switch (bcm63xx_get_cpu_id()) { case BCM6318_CPU_ID: /* only support serial flash */ @@ -88,7 +83,7 @@ Signed-off-by: Jonas Gorski if (val & STRAPBUS_6328_BOOT_SEL_SERIAL) return BCM63XX_FLASH_TYPE_SERIAL; else -@@ -94,12 +144,20 @@ static int __init bcm63xx_detect_flash_t +@@ -94,12 +139,20 @@ static int __init bcm63xx_detect_flash_t return BCM63XX_FLASH_TYPE_SERIAL; case BCM6362_CPU_ID: val = bcm_misc_readl(MISC_STRAPBUS_6362_REG); @@ -109,7 +104,7 @@ Signed-off-by: Jonas Gorski switch (val & STRAPBUS_6368_BOOT_SEL_MASK) { case STRAPBUS_6368_BOOT_SEL_NAND: return BCM63XX_FLASH_TYPE_NAND; -@@ -110,6 +168,11 @@ static int __init bcm63xx_detect_flash_t +@@ -110,6 +163,11 @@ static int __init bcm63xx_detect_flash_t } case BCM63268_CPU_ID: val = bcm_misc_readl(MISC_STRAPBUS_63268_REG); @@ -121,7 +116,7 @@ Signed-off-by: Jonas Gorski if (val & STRAPBUS_63268_BOOT_SEL_SERIAL) return BCM63XX_FLASH_TYPE_SERIAL; else -@@ -176,6 +239,7 @@ void __init bcm63xx_flash_detect(void) +@@ -176,6 +234,7 @@ void __init bcm63xx_flash_detect(void) int __init bcm63xx_flash_register(void) { @@ -129,7 +124,7 @@ Signed-off-by: Jonas Gorski u32 val; switch (flash_type) { -@@ -195,8 +259,21 @@ int __init bcm63xx_flash_register(void) +@@ -195,8 +254,14 @@ int __init bcm63xx_flash_register(void) return platform_device_register(&mtd_dev); case BCM63XX_FLASH_TYPE_SERIAL: @@ -141,14 +136,7 @@ Signed-off-by: Jonas Gorski + of_node_put(np); + return 0; + } else { -+ if (BCMCPU_IS_6318() || BCMCPU_IS_6328() || -+ BCMCPU_IS_6362() || BCMCPU_IS_63268()) { -+ bcm63xx_spi_flash_info[0].bus_num = 1; -+ bcm63xx_spi_flash_info[0].mode = SPI_RX_DUAL; -+ } -+ -+ return spi_register_board_info(bcm63xx_spi_flash_info, -+ ARRAY_SIZE(bcm63xx_spi_flash_info)); ++ return -ENODEV; + } case BCM63XX_FLASH_TYPE_NAND: pr_warn("unsupported NAND flash detected\n"); diff --git a/target/linux/brcm63xx/patches-4.4/415-MIPS-BCM63XX-export-the-attached-flash-type.patch b/target/linux/brcm63xx/patches-4.4/415-MIPS-BCM63XX-export-the-attached-flash-type.patch index 68833f8c10..9eb4e5e09d 100644 --- a/target/linux/brcm63xx/patches-4.4/415-MIPS-BCM63XX-export-the-attached-flash-type.patch +++ b/target/linux/brcm63xx/patches-4.4/415-MIPS-BCM63XX-export-the-attached-flash-type.patch @@ -11,7 +11,7 @@ Signed-off-by: Jonas Gorski --- a/arch/mips/bcm63xx/dev-flash.c +++ b/arch/mips/bcm63xx/dev-flash.c -@@ -283,3 +283,8 @@ int __init bcm63xx_flash_register(void) +@@ -271,3 +271,8 @@ int __init bcm63xx_flash_register(void) return -ENODEV; } } diff --git a/target/linux/brcm63xx/patches-4.4/511-board_V2500V.patch b/target/linux/brcm63xx/patches-4.4/511-board_V2500V.patch index 5eca1b6f1d..3ac6c18003 100644 --- a/target/linux/brcm63xx/patches-4.4/511-board_V2500V.patch +++ b/target/linux/brcm63xx/patches-4.4/511-board_V2500V.patch @@ -77,7 +77,7 @@ #include #include #include -@@ -253,6 +254,13 @@ int __init bcm63xx_flash_register(void) +@@ -248,6 +249,13 @@ int __init bcm63xx_flash_register(void) val = bcm_mpi_readl(MPI_CSBASE_REG(0)); val &= MPI_CSBASE_BASE_MASK;