summaryrefslogtreecommitdiff
path: root/firmware/target/mips/ingenic_x1000/spl-x1000.c
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2022-03-04 16:30:33 +0000
committerAidan MacDonald <amachronic@protonmail.com>2022-03-25 21:36:51 +0000
commit7cb49cfb33647941d4a706675832bfc57a4e27cf (patch)
treebc558b9be3f8ca856adafe6b00af45e87adb6679 /firmware/target/mips/ingenic_x1000/spl-x1000.c
parentbd8cd58568a845b876861e81af9f13a07f563060 (diff)
downloadrockbox-7cb49cfb33647941d4a706675832bfc57a4e27cf.tar.gz
rockbox-7cb49cfb33647941d4a706675832bfc57a4e27cf.zip
x1000: spl: split off NAND storage to separate file
Just tidying. No functional changes. Change-Id: I8aa85c789d1a6bd357797c6c95e38a7325eba809
Diffstat (limited to 'firmware/target/mips/ingenic_x1000/spl-x1000.c')
-rw-r--r--firmware/target/mips/ingenic_x1000/spl-x1000.c25
1 files changed, 0 insertions, 25 deletions
diff --git a/firmware/target/mips/ingenic_x1000/spl-x1000.c b/firmware/target/mips/ingenic_x1000/spl-x1000.c
index 499b46ce62..ac3a17f69f 100644
--- a/firmware/target/mips/ingenic_x1000/spl-x1000.c
+++ b/firmware/target/mips/ingenic_x1000/spl-x1000.c
@@ -47,7 +47,6 @@
47#endif 47#endif
48 48
49static void* heap = (void*)(X1000_SDRAM_BASE + X1000_SDRAM_SIZE); 49static void* heap = (void*)(X1000_SDRAM_BASE + X1000_SDRAM_SIZE);
50static nand_drv* ndrv = NULL;
51 50
52void* spl_alloc(size_t count) 51void* spl_alloc(size_t count)
53{ 52{
@@ -56,30 +55,6 @@ void* spl_alloc(size_t count)
56 return heap; 55 return heap;
57} 56}
58 57
59int spl_storage_open(void)
60{
61 /* We need to assign the GPIOs manually */
62 gpioz_configure(GPIO_A, 0x3f << 26, GPIOF_DEVICE(1));
63
64 /* Allocate NAND driver manually in DRAM */
65 ndrv = spl_alloc(sizeof(nand_drv));
66 ndrv->page_buf = spl_alloc(NAND_DRV_MAXPAGESIZE);
67 ndrv->scratch_buf = spl_alloc(NAND_DRV_SCRATCHSIZE);
68 ndrv->refcount = 0;
69
70 return nand_open(ndrv);
71}
72
73void spl_storage_close(void)
74{
75 nand_close(ndrv);
76}
77
78int spl_storage_read(uint32_t addr, uint32_t length, void* buffer)
79{
80 return nand_read_bytes(ndrv, addr, length, buffer);
81}
82
83/* Used by: 58/* Used by:
84 * - FiiO M3K 59 * - FiiO M3K
85 * - Shanling Q1 60 * - Shanling Q1