changeset 26:680f6fdb5e62

add target for Sony Ericsson K200/K220
author Vadim Yanitskiy <fixeria@osmocom.org>
date Wed, 20 Dec 2023 01:59:09 +0700
parents b51027daadb9
children cb3f6fe694e1
files make-all.sh src/cs/drivers/drv_app/ffs/board/dev.c src/cs/drivers/drv_app/ffs/board/drv.c targets/se_k2x0.h
diffstat 4 files changed, 23 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/make-all.sh	Wed Dec 02 21:19:21 2020 +0000
+++ b/make-all.sh	Wed Dec 20 01:59:09 2023 +0700
@@ -16,6 +16,7 @@
 scripts/config-one.sh fcfam irda
 scripts/config-one.sh fcfam modem
 scripts/config-one.sh pirelli irda
+scripts/config-one.sh se_k2x0 modem
 scripts/config-one.sh ti26 irda
 scripts/config-one.sh ti26 modem
 
@@ -33,5 +34,6 @@
 cp -p build-fcfam-irda/ramimage.srec       images/ffsagent-fcfam-irda.srec
 cp -p build-fcfam-modem/ramimage.srec      images/ffsagent-fcfam-modem.srec
 cp -p build-pirelli-irda/ramimage.srec     images/ffsagent-pirelli-am.srec
+cp -p build-se_k2x0-modem/ramimage.srec    images/ffsagent-se_k2x0.srec
 cp -p build-ti26-irda/ramimage.srec        images/ffsagent-ti26-irda.srec
 cp -p build-ti26-modem/ramimage.srec       images/ffsagent-ti26-modem.srec
--- a/src/cs/drivers/drv_app/ffs/board/dev.c	Wed Dec 02 21:19:21 2020 +0000
+++ b/src/cs/drivers/drv_app/ffs/board/dev.c	Wed Dec 20 01:59:09 2023 +0700
@@ -89,7 +89,8 @@
 // Note that does NOT support a flash definition with different sized blocks
 // so all blocks contained in the device definition MUST be the same size!
 
-#if defined(CONFIG_TARGET_PIRELLI) || defined(CONFIG_TARGET_FCFAM)
+#if defined(CONFIG_TARGET_PIRELLI) || defined(CONFIG_TARGET_FCFAM) || \
+    defined(CONFIG_TARGET_SE_K2X0)
 // 256 KiB sectors
 static const struct block_info_s flash_32x256[] =
 {
@@ -378,6 +379,16 @@
     { &flash_32x256[0], (char *) 0x02480000, MANUFACT_AMD,     0x2101,
       FFS_DRIVER_AMD,  6 },
 
+#elif defined(CONFIG_TARGET_SE_K2X0)
+
+    /* Spansion S71PL129N */
+    { &flash_32x256[0], (char *) 0x01800000, MANUFACT_AMD,     0x2101,
+      FFS_DRIVER_AMD, 13 },
+
+    /* Samsung K5L29xx */
+    { &flash_128x64[0], (char *) 0x01800000, MANUFACT_SAMSUNG, 0x0801,
+      FFS_DRIVER_AMD, 52 },
+
 #elif defined(CONFIG_TARGET_FCFAM)
 
     /*
--- a/src/cs/drivers/drv_app/ffs/board/drv.c	Wed Dec 02 21:19:21 2020 +0000
+++ b/src/cs/drivers/drv_app/ffs/board/drv.c	Wed Dec 20 01:59:09 2023 +0700
@@ -982,7 +982,7 @@
 void ffsdrv_device_id_read(uint16 *manufact, uint16 *device)
 {
 #if defined(CONFIG_TARGET_FCFAM) || defined(CONFIG_TARGET_PIRELLI) || \
-	defined(__GNUC__)
+    defined(CONFIG_TARGET_SE_K2X0) || defined(__GNUC__)
     /*
      * This new FreeCalypso version of the device ID read function
      * should work for all current targets, but we are being conservative
@@ -1174,9 +1174,10 @@
     return 0;
 }
 
-#if defined(CONFIG_TARGET_PIRELLI) || defined(CONFIG_TARGET_FCFAM)
+#if defined(CONFIG_TARGET_PIRELLI) || defined(CONFIG_TARGET_FCFAM) || \
+    defined(CONFIG_TARGET_SE_K2X0)
 
-#ifdef CONFIG_TARGET_FCFAM
+#if defined(CONFIG_TARGET_FCFAM) || defined(CONFIG_TARGET_SE_K2X0)
 #define	FLASH2_BASE_ADDR	0x01800000
 #elif defined(CONFIG_TARGET_PIRELLI)
 #define	FLASH2_BASE_ADDR	0x02000000
@@ -1380,7 +1381,9 @@
             device_id[0] == 0x227E) {
             // This is a multi-id device
             dev.device = (device_id[1] << 8) | (device_id[2] & 0xFF);
-          #if defined(CONFIG_TARGET_PIRELLI) || defined(CONFIG_TARGET_FCFAM)
+          #if defined(CONFIG_TARGET_PIRELLI) || \
+              defined(CONFIG_TARGET_FCFAM) || \
+              defined(CONFIG_TARGET_SE_K2X0)
             if (device_id[1] == 0x2221 && device_id[2] == 0x2200)
               dev.device += ffsdrv_is_new_spansion_flash();
           #endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/targets/se_k2x0.h	Wed Dec 20 01:59:09 2023 +0700
@@ -0,0 +1,2 @@
+#define	CONFIG_TARGET_SE_K2X0	1
+#define	VCXO_26MHZ		1