diff options
Diffstat (limited to 'firmware/target/mips/ingenic_x1000/fiiom3k/nand-fiiom3k.c')
-rw-r--r-- | firmware/target/mips/ingenic_x1000/fiiom3k/nand-fiiom3k.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/firmware/target/mips/ingenic_x1000/fiiom3k/nand-fiiom3k.c b/firmware/target/mips/ingenic_x1000/fiiom3k/nand-fiiom3k.c new file mode 100644 index 0000000000..7c8a306bae --- /dev/null +++ b/firmware/target/mips/ingenic_x1000/fiiom3k/nand-fiiom3k.c | |||
@@ -0,0 +1,53 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2021 Aidan MacDonald | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #include "nand-x1000.h" | ||
23 | #include "nand-target.h" | ||
24 | #include "sfc-x1000.h" | ||
25 | |||
26 | /* Unbelievably FiiO has completely disabled the use of ECC for this chip | ||
27 | * in their Linux kernel, even though it has perfectly good spare areas. | ||
28 | * There's no internal ECC either. | ||
29 | * | ||
30 | * Using nanddump to read the spare areas reveals they're filled with 0xff, | ||
31 | * and the publicly released Linux source has the ecc_strength set to 0. | ||
32 | */ | ||
33 | static const nand_chip_data ato25d1ga = { | ||
34 | .name = "ATO25D1GA", | ||
35 | .mf_id = 0x9b, | ||
36 | .dev_id = 0x12, | ||
37 | .dev_conf = NAND_INIT_SFC_DEV_CONF, | ||
38 | /* XXX: datasheet says 104 MHz but FiiO seems to run this at 150 MHz. | ||
39 | * Didn't find any issues doing this so might as well keep the behavior. | ||
40 | */ | ||
41 | .clock_freq = NAND_INIT_CLOCK_SPEED, | ||
42 | .block_size = 64, | ||
43 | .page_size = 2048, | ||
44 | .spare_size = 64, | ||
45 | .rowaddr_width = 3, | ||
46 | .coladdr_width = 2, | ||
47 | .flags = NANDCHIP_FLAG_QUAD, | ||
48 | }; | ||
49 | |||
50 | const nand_chip_desc target_nand_chip_descs[] = { | ||
51 | {&ato25d1ga, &nand_chip_ops_std}, | ||
52 | {NULL, NULL}, | ||
53 | }; | ||