Files
openwrt_mitrastar/target/linux/econet/patches-6.12/301-spi-Airoha-adapt-to-support-en75-mips.patch
Caleb James DeLisle 546038c2ec kernel: Add new platform EcoNet MIPS
EcoNet EN75xx is a big endian MIPS platform used in XPON (fiber),
DSL, and SIM (3g/4g) applications. Complete GPL vender SDKs exist
for this platform, but are based on Linux 2.6.

The bulk of this submission has already been accepted upstream:
https://patchwork.kernel.org/project/linux-mips/list/?series=960479&state=*

This platform uses a bootloader that is derived from old TrendChip
code. This bootloader implements a frustratingly complex Bad Block
Table which is implemented here in en75_bmt.c

This BMT is not upstreamed because it depends on mtk_bmt framework
which likewise is not upstreamed.

This BMT system rewrites block indexes in flash and if the bootloader
considers it to be corrupted, it will attempt to automatically rebuild
on boot. So without implementing the algorithm, you can't safely use
the disk at all.

Signed-off-by: Caleb James DeLisle <cjd@cjdns.fr>
2025-06-12 16:41:18 +00:00

45 lines
1.1 KiB
Diff

--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -372,7 +372,7 @@ config SPI_DLN2
config SPI_AIROHA_EN7523
bool "Airoha EN7523 SPI controller support"
- depends on ARCH_AIROHA
+ depends on ARCH_AIROHA || ECONET
help
This enables SPI controller support for the Airoha EN7523 SoC.
--- a/drivers/spi/spi-en7523.c
+++ b/drivers/spi/spi-en7523.c
@@ -82,10 +82,11 @@ static void opfifo_write(u32 cmd, u32 le
static void set_cs(int state)
{
- if (state)
- opfifo_write(OP_CSH, 1);
- else
- opfifo_write(OP_CSL, 1);
+ u32 cmd = state ? OP_CSH : OP_CSL;
+
+ /* EN751221 drops writes if we don't send this twice. */
+ opfifo_write(cmd, 1);
+ opfifo_write(cmd, 1);
}
static void manual_begin_cmd(void)
@@ -226,12 +227,12 @@ static int xfer_write(struct spi_transfe
return xfer->len;
}
-size_t max_transfer_size(struct spi_device *spi)
+static size_t max_transfer_size(struct spi_device *spi)
{
return _ENSPI_MAX_XFER;
}
-int transfer_one_message(struct spi_controller *ctrl, struct spi_message *msg)
+static int transfer_one_message(struct spi_controller *ctrl, struct spi_message *msg)
{
struct spi_transfer *xfer;
int next_xfer_is_rx = 0;