mirror of https://github.com/hak5/openwrt.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 <jonas.gorski@gmail.com>openwrt-18.06
parent
092ac42e1e
commit
334f8f4fc3
|
@ -1,38 +0,0 @@
|
||||||
From 3f650fc30aa0badf9d02842ce396cea3eef2eeaa Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jonas Gorski <jonas.gorski@gmail.com>
|
|
||||||
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 <jonas.gorski@gmail.com>
|
|
||||||
---
|
|
||||||
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 */
|
|
||||||
};
|
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
From c7c3c338cb25d7f55ddb3f6bfbf3572758ca3896 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jonas Gorski <jonas.gorski@gmail.com>
|
|
||||||
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 <jonas.gorski@gmail.com>
|
|
||||||
---
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -25,14 +25,10 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||||
#include <bcm63xx_regs.h>
|
#include <bcm63xx_regs.h>
|
||||||
#include <bcm63xx_io.h>
|
#include <bcm63xx_io.h>
|
||||||
|
|
||||||
@@ -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;
|
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[] = {
|
+static struct spi_board_info bcm63xx_spi_flash_info[] = {
|
||||||
+ {
|
+ {
|
||||||
+ .bus_num = 0,
|
+ .bus_num = 0,
|
||||||
|
@ -40,7 +36,6 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||||
+ .mode = 0,
|
+ .mode = 0,
|
||||||
+ .max_speed_hz = 781000,
|
+ .max_speed_hz = 781000,
|
||||||
+ .modalias = "m25p80",
|
+ .modalias = "m25p80",
|
||||||
+ .platform_data = &bcm63xx_flash_data,
|
|
||||||
+ },
|
+ },
|
||||||
+};
|
+};
|
||||||
+
|
+
|
||||||
|
@ -72,7 +67,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||||
static int __init bcm63xx_detect_flash_type(void)
|
static int __init bcm63xx_detect_flash_type(void)
|
||||||
{
|
{
|
||||||
u32 val;
|
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()) {
|
switch (bcm63xx_get_cpu_id()) {
|
||||||
case BCM6318_CPU_ID:
|
case BCM6318_CPU_ID:
|
||||||
/* only support serial flash */
|
/* only support serial flash */
|
||||||
|
@ -88,7 +83,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||||
if (val & STRAPBUS_6328_BOOT_SEL_SERIAL)
|
if (val & STRAPBUS_6328_BOOT_SEL_SERIAL)
|
||||||
return BCM63XX_FLASH_TYPE_SERIAL;
|
return BCM63XX_FLASH_TYPE_SERIAL;
|
||||||
else
|
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;
|
return BCM63XX_FLASH_TYPE_SERIAL;
|
||||||
case BCM6362_CPU_ID:
|
case BCM6362_CPU_ID:
|
||||||
val = bcm_misc_readl(MISC_STRAPBUS_6362_REG);
|
val = bcm_misc_readl(MISC_STRAPBUS_6362_REG);
|
||||||
|
@ -109,7 +104,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||||
switch (val & STRAPBUS_6368_BOOT_SEL_MASK) {
|
switch (val & STRAPBUS_6368_BOOT_SEL_MASK) {
|
||||||
case STRAPBUS_6368_BOOT_SEL_NAND:
|
case STRAPBUS_6368_BOOT_SEL_NAND:
|
||||||
return BCM63XX_FLASH_TYPE_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:
|
case BCM63268_CPU_ID:
|
||||||
val = bcm_misc_readl(MISC_STRAPBUS_63268_REG);
|
val = bcm_misc_readl(MISC_STRAPBUS_63268_REG);
|
||||||
|
@ -121,7 +116,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||||
if (val & STRAPBUS_63268_BOOT_SEL_SERIAL)
|
if (val & STRAPBUS_63268_BOOT_SEL_SERIAL)
|
||||||
return BCM63XX_FLASH_TYPE_SERIAL;
|
return BCM63XX_FLASH_TYPE_SERIAL;
|
||||||
else
|
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)
|
int __init bcm63xx_flash_register(void)
|
||||||
{
|
{
|
||||||
|
@ -129,7 +124,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||||
u32 val;
|
u32 val;
|
||||||
|
|
||||||
switch (flash_type) {
|
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);
|
return platform_device_register(&mtd_dev);
|
||||||
case BCM63XX_FLASH_TYPE_SERIAL:
|
case BCM63XX_FLASH_TYPE_SERIAL:
|
||||||
|
@ -141,14 +136,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||||
+ of_node_put(np);
|
+ of_node_put(np);
|
||||||
+ return 0;
|
+ return 0;
|
||||||
+ } else {
|
+ } else {
|
||||||
+ if (BCMCPU_IS_6318() || BCMCPU_IS_6328() ||
|
+ return -ENODEV;
|
||||||
+ 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));
|
|
||||||
+ }
|
+ }
|
||||||
case BCM63XX_FLASH_TYPE_NAND:
|
case BCM63XX_FLASH_TYPE_NAND:
|
||||||
pr_warn("unsupported NAND flash detected\n");
|
pr_warn("unsupported NAND flash detected\n");
|
||||||
|
|
|
@ -11,7 +11,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||||
|
|
||||||
--- a/arch/mips/bcm63xx/dev-flash.c
|
--- a/arch/mips/bcm63xx/dev-flash.c
|
||||||
+++ b/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;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,7 +77,7 @@
|
||||||
#include <bcm63xx_cpu.h>
|
#include <bcm63xx_cpu.h>
|
||||||
#include <bcm63xx_dev_flash.h>
|
#include <bcm63xx_dev_flash.h>
|
||||||
#include <bcm63xx_dev_hsspi.h>
|
#include <bcm63xx_dev_hsspi.h>
|
||||||
@@ -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 = bcm_mpi_readl(MPI_CSBASE_REG(0));
|
||||||
val &= MPI_CSBASE_BASE_MASK;
|
val &= MPI_CSBASE_BASE_MASK;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue