developer | 5d148cb | 2023-06-02 13:08:11 +0800 | [diff] [blame] | 1 | From af4301a675f4fcbaa787f1d3bd07df1c08a093c3 Mon Sep 17 00:00:00 2001 |
| 2 | From: Sam Shih <sam.shih@mediatek.com> |
| 3 | Date: Fri, 2 Jun 2023 13:06:13 +0800 |
| 4 | Subject: [PATCH] |
| 5 | [spi-and-storage][999-2326-mtd-spinand-toshiba-Rename-function-name-to-change-suffix-and-prefix-8Gbit.patch] |
developer | 41370d5 | 2022-03-16 16:01:59 +0800 | [diff] [blame] | 6 | |
developer | 41370d5 | 2022-03-16 16:01:59 +0800 | [diff] [blame] | 7 | --- |
developer | 5d148cb | 2023-06-02 13:08:11 +0800 | [diff] [blame] | 8 | drivers/mtd/nand/spi/toshiba.c | 65 ++++++++++++++++++++-------------- |
| 9 | 1 file changed, 38 insertions(+), 27 deletions(-) |
developer | 41370d5 | 2022-03-16 16:01:59 +0800 | [diff] [blame] | 10 | |
developer | 5d148cb | 2023-06-02 13:08:11 +0800 | [diff] [blame] | 11 | diff --git a/drivers/mtd/nand/spi/toshiba.c b/drivers/mtd/nand/spi/toshiba.c |
| 12 | index 35da3c6e9..7ce5997dd 100644 |
developer | 41370d5 | 2022-03-16 16:01:59 +0800 | [diff] [blame] | 13 | --- a/drivers/mtd/nand/spi/toshiba.c |
| 14 | +++ b/drivers/mtd/nand/spi/toshiba.c |
developer | 5d148cb | 2023-06-02 13:08:11 +0800 | [diff] [blame] | 15 | @@ -25,8 +25,8 @@ static SPINAND_OP_VARIANTS(write_cache_variants, |
developer | 41370d5 | 2022-03-16 16:01:59 +0800 | [diff] [blame] | 16 | static SPINAND_OP_VARIANTS(update_cache_variants, |
| 17 | SPINAND_PROG_LOAD(false, 0, NULL, 0)); |
| 18 | |
| 19 | -static int tc58cxgxsx_ooblayout_ecc(struct mtd_info *mtd, int section, |
| 20 | - struct mtd_oob_region *region) |
| 21 | +static int tx58cxgxsxraix_ooblayout_ecc(struct mtd_info *mtd, int section, |
| 22 | + struct mtd_oob_region *region) |
| 23 | { |
| 24 | if (section > 0) |
| 25 | return -ERANGE; |
developer | 5d148cb | 2023-06-02 13:08:11 +0800 | [diff] [blame] | 26 | @@ -37,8 +37,8 @@ static int tc58cxgxsx_ooblayout_ecc(struct mtd_info *mtd, int section, |
developer | 41370d5 | 2022-03-16 16:01:59 +0800 | [diff] [blame] | 27 | return 0; |
| 28 | } |
| 29 | |
| 30 | -static int tc58cxgxsx_ooblayout_free(struct mtd_info *mtd, int section, |
| 31 | - struct mtd_oob_region *region) |
| 32 | +static int tx58cxgxsxraix_ooblayout_free(struct mtd_info *mtd, int section, |
| 33 | + struct mtd_oob_region *region) |
| 34 | { |
| 35 | if (section > 0) |
| 36 | return -ERANGE; |
developer | 5d148cb | 2023-06-02 13:08:11 +0800 | [diff] [blame] | 37 | @@ -50,13 +50,13 @@ static int tc58cxgxsx_ooblayout_free(struct mtd_info *mtd, int section, |
developer | 41370d5 | 2022-03-16 16:01:59 +0800 | [diff] [blame] | 38 | return 0; |
| 39 | } |
| 40 | |
| 41 | -static const struct mtd_ooblayout_ops tc58cxgxsx_ooblayout = { |
| 42 | - .ecc = tc58cxgxsx_ooblayout_ecc, |
| 43 | - .free = tc58cxgxsx_ooblayout_free, |
| 44 | +static const struct mtd_ooblayout_ops tx58cxgxsxraix_ooblayout = { |
| 45 | + .ecc = tx58cxgxsxraix_ooblayout_ecc, |
| 46 | + .free = tx58cxgxsxraix_ooblayout_free, |
| 47 | }; |
| 48 | |
| 49 | -static int tc58cxgxsx_ecc_get_status(struct spinand_device *spinand, |
| 50 | - u8 status) |
| 51 | +static int tx58cxgxsxraix_ecc_get_status(struct spinand_device *spinand, |
| 52 | + u8 status) |
| 53 | { |
| 54 | struct nand_device *nand = spinand_to_nand(spinand); |
| 55 | u8 mbf = 0; |
developer | 5d148cb | 2023-06-02 13:08:11 +0800 | [diff] [blame] | 56 | @@ -95,7 +95,7 @@ static int tc58cxgxsx_ecc_get_status(struct spinand_device *spinand, |
developer | 41370d5 | 2022-03-16 16:01:59 +0800 | [diff] [blame] | 57 | |
| 58 | static const struct spinand_info toshiba_spinand_table[] = { |
| 59 | /* 3.3V 1Gb */ |
| 60 | - SPINAND_INFO("TC58CVG0S3", |
| 61 | + SPINAND_INFO("TC58CVG0S3HRAIG", |
| 62 | SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xC2), |
| 63 | NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1), |
| 64 | NAND_ECCREQ(8, 512), |
developer | 5d148cb | 2023-06-02 13:08:11 +0800 | [diff] [blame] | 65 | @@ -103,10 +103,10 @@ static const struct spinand_info toshiba_spinand_table[] = { |
developer | 41370d5 | 2022-03-16 16:01:59 +0800 | [diff] [blame] | 66 | &write_cache_variants, |
| 67 | &update_cache_variants), |
| 68 | 0, |
| 69 | - SPINAND_ECCINFO(&tc58cxgxsx_ooblayout, |
| 70 | - tc58cxgxsx_ecc_get_status)), |
| 71 | + SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout, |
| 72 | + tx58cxgxsxraix_ecc_get_status)), |
| 73 | /* 3.3V 2Gb */ |
| 74 | - SPINAND_INFO("TC58CVG1S3", |
| 75 | + SPINAND_INFO("TC58CVG1S3HRAIG", |
| 76 | SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xCB), |
| 77 | NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1), |
| 78 | NAND_ECCREQ(8, 512), |
developer | 5d148cb | 2023-06-02 13:08:11 +0800 | [diff] [blame] | 79 | @@ -114,10 +114,10 @@ static const struct spinand_info toshiba_spinand_table[] = { |
developer | 41370d5 | 2022-03-16 16:01:59 +0800 | [diff] [blame] | 80 | &write_cache_variants, |
| 81 | &update_cache_variants), |
| 82 | 0, |
| 83 | - SPINAND_ECCINFO(&tc58cxgxsx_ooblayout, |
| 84 | - tc58cxgxsx_ecc_get_status)), |
| 85 | + SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout, |
| 86 | + tx58cxgxsxraix_ecc_get_status)), |
| 87 | /* 3.3V 4Gb */ |
| 88 | - SPINAND_INFO("TC58CVG2S0", |
| 89 | + SPINAND_INFO("TC58CVG2S0HRAIG", |
| 90 | SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xCD), |
| 91 | NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1), |
| 92 | NAND_ECCREQ(8, 512), |
developer | 5d148cb | 2023-06-02 13:08:11 +0800 | [diff] [blame] | 93 | @@ -125,10 +125,21 @@ static const struct spinand_info toshiba_spinand_table[] = { |
developer | 41370d5 | 2022-03-16 16:01:59 +0800 | [diff] [blame] | 94 | &write_cache_variants, |
| 95 | &update_cache_variants), |
| 96 | 0, |
| 97 | - SPINAND_ECCINFO(&tc58cxgxsx_ooblayout, |
| 98 | - tc58cxgxsx_ecc_get_status)), |
| 99 | + SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout, |
| 100 | + tx58cxgxsxraix_ecc_get_status)), |
| 101 | + /* 3.3V 4Gb */ |
| 102 | + SPINAND_INFO("TC58CVG2S0HRAIJ", |
| 103 | + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xED), |
| 104 | + NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1), |
| 105 | + NAND_ECCREQ(8, 512), |
| 106 | + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, |
| 107 | + &write_cache_variants, |
| 108 | + &update_cache_variants), |
| 109 | + 0, |
| 110 | + SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout, |
| 111 | + tx58cxgxsxraix_ecc_get_status)), |
| 112 | /* 1.8V 1Gb */ |
| 113 | - SPINAND_INFO("TC58CYG0S3", |
| 114 | + SPINAND_INFO("TC58CYG0S3HRAIG", |
| 115 | SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xB2), |
| 116 | NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1), |
| 117 | NAND_ECCREQ(8, 512), |
developer | 5d148cb | 2023-06-02 13:08:11 +0800 | [diff] [blame] | 118 | @@ -136,10 +147,10 @@ static const struct spinand_info toshiba_spinand_table[] = { |
developer | 41370d5 | 2022-03-16 16:01:59 +0800 | [diff] [blame] | 119 | &write_cache_variants, |
| 120 | &update_cache_variants), |
| 121 | 0, |
| 122 | - SPINAND_ECCINFO(&tc58cxgxsx_ooblayout, |
| 123 | - tc58cxgxsx_ecc_get_status)), |
| 124 | + SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout, |
| 125 | + tx58cxgxsxraix_ecc_get_status)), |
| 126 | /* 1.8V 2Gb */ |
| 127 | - SPINAND_INFO("TC58CYG1S3", |
| 128 | + SPINAND_INFO("TC58CYG1S3HRAIG", |
| 129 | SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xBB), |
| 130 | NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1), |
| 131 | NAND_ECCREQ(8, 512), |
developer | 5d148cb | 2023-06-02 13:08:11 +0800 | [diff] [blame] | 132 | @@ -147,10 +158,10 @@ static const struct spinand_info toshiba_spinand_table[] = { |
developer | 41370d5 | 2022-03-16 16:01:59 +0800 | [diff] [blame] | 133 | &write_cache_variants, |
| 134 | &update_cache_variants), |
| 135 | 0, |
| 136 | - SPINAND_ECCINFO(&tc58cxgxsx_ooblayout, |
| 137 | - tc58cxgxsx_ecc_get_status)), |
| 138 | + SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout, |
| 139 | + tx58cxgxsxraix_ecc_get_status)), |
| 140 | /* 1.8V 4Gb */ |
| 141 | - SPINAND_INFO("TC58CYG2S0", |
| 142 | + SPINAND_INFO("TC58CYG2S0HRAIG", |
| 143 | SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xBD), |
| 144 | NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1), |
| 145 | NAND_ECCREQ(8, 512), |
developer | 5d148cb | 2023-06-02 13:08:11 +0800 | [diff] [blame] | 146 | @@ -158,8 +169,8 @@ static const struct spinand_info toshiba_spinand_table[] = { |
developer | 41370d5 | 2022-03-16 16:01:59 +0800 | [diff] [blame] | 147 | &write_cache_variants, |
| 148 | &update_cache_variants), |
| 149 | 0, |
| 150 | - SPINAND_ECCINFO(&tc58cxgxsx_ooblayout, |
| 151 | - tc58cxgxsx_ecc_get_status)), |
| 152 | + SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout, |
| 153 | + tx58cxgxsxraix_ecc_get_status)), |
| 154 | }; |
| 155 | |
| 156 | static const struct spinand_manufacturer_ops toshiba_spinand_manuf_ops = { |
developer | 5d148cb | 2023-06-02 13:08:11 +0800 | [diff] [blame] | 157 | -- |
| 158 | 2.34.1 |
| 159 | |