summaryrefslogtreecommitdiff
path: root/berry_fix/payload/src/agb_flash_le.c
diff options
context:
space:
mode:
authorPikalaxALT <PikalaxALT@users.noreply.github.com>2019-09-03 15:33:11 -0400
committerGitHub <noreply@github.com>2019-09-03 15:33:11 -0400
commit1f4c88c95243e8d75f25d5b7868c837c47aa578d (patch)
tree0ce1dd280b64c7b3677f22a457952746bb1196e9 /berry_fix/payload/src/agb_flash_le.c
parent5d30304f4e9ce26d4061cc3697439588126d6bdc (diff)
Copy Berry Fix MB dism from FR (#777)
* Copy Berry Fix MB dism from FR
Diffstat (limited to 'berry_fix/payload/src/agb_flash_le.c')
-rw-r--r--berry_fix/payload/src/agb_flash_le.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/berry_fix/payload/src/agb_flash_le.c b/berry_fix/payload/src/agb_flash_le.c
new file mode 100644
index 000000000..39d956e27
--- /dev/null
+++ b/berry_fix/payload/src/agb_flash_le.c
@@ -0,0 +1,31 @@
+#include "gba/gba.h"
+#include "gba/flash_internal.h"
+
+const u16 leMaxTime[] =
+{
+ 10, 65469, TIMER_ENABLE | TIMER_INTR_ENABLE | TIMER_256CLK,
+ 10, 65469, TIMER_ENABLE | TIMER_INTR_ENABLE | TIMER_256CLK,
+ 2000, 65469, TIMER_ENABLE | TIMER_INTR_ENABLE | TIMER_256CLK,
+ 2000, 65469, TIMER_ENABLE | TIMER_INTR_ENABLE | TIMER_256CLK,
+};
+
+const struct FlashSetupInfo LE26FV10N1TS =
+{
+ ProgramFlashByte_MX,
+ ProgramFlashSector_MX,
+ EraseFlashChip_MX,
+ EraseFlashSector_MX,
+ WaitForFlashWrite_Common,
+ leMaxTime,
+ {
+ 131072, // ROM size
+ {
+ 4096, // sector size
+ 12, // bit shift to multiply by sector size (4096 == 1 << 12)
+ 32, // number of sectors
+ 0 // appears to be unused
+ },
+ { 3, 1 }, // wait state setup data
+ { { 0x62, 0x13 } } // ID
+ }
+};