mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
Core changes:
- Parse the 4BAIT SFDP section - Add a bunch of SPI NOR entries to the flash_info table - Add the concept of SFDP fixups and use it to fix a bug on MX25L25635F - A bunch of minor cleanups/comestic changes -----BEGIN PGP SIGNATURE----- iQJQBAABCgA6FiEEKmCqpbOU668PNA69Ze02AX4ItwAFAlwVQUYcHGJvcmlzLmJy ZXppbGxvbkBib290bGluLmNvbQAKCRBl7TYBfgi3ACIYD/sG0+vRIKK8+NgNUHYy nzKICKvdnBrm2RWi+6va5n2pYggyNy1VhWEjmqWLupjxn7NGkjZiBilhfj8Iv6YN HScNy7FLHM6pxTKpsZKQLLGKvaUXODgvZwiw3L6T5T3JaJ5nlpE5g8jQy8sCzfjK pwKdrOw17caZgoY0bMe2ppCObIDLd+mY+WSHbo6tb4/fohpTX1l9QZYHjfgHU9vP CG0z3sU0JCNGXsbQMngfeuyXFjJ4OKdnklbVTeZl673AYtQMBhQEIGNVkVefuBP3 p8hU0CWRn0Yikc1HGTENvYCnQ7ju3z+16rnLxy3A5CPHhCDrTgUmM8HabYbh+0Si 0Y1wXpEOZ0OZQ7uMs2Q8SK0GLyxqdxkE0ibHgb7K/aLb+yg8oB7DB4Uenb06CiaQ KAZWGgWZlSondX+/GI7YcQozslFFCfixAw6H0kCpQW0/2piXNqsN5BOROEqjueXW xeMG0DNnzrQ6/vB9ukLESSB/YvVwfUvt6GSjqMSDdXwx6zyKSvHJ+chCxlK46+Hm zIVcvNT3mpwcuVnQOZZeCaiIrDUAySEq/8Ztp9O5/CfkzdQyMWxDPoY9A0HjL2p3 FmRN7aAB9jJcdHc2tLwcKPRepjliIUMLf0NXdTSizzQz8WJqULZRBN0VWW4sCbLc +tTisYjX8fYUz9+kHUcQ4XY16g== =JXhP -----END PGP SIGNATURE----- Merge tag 'spi-nor/for-4.21' of git://git.infradead.org/linux-mtd into mtd/next Core changes: - Parse the 4BAIT SFDP section - Add a bunch of SPI NOR entries to the flash_info table - Add the concept of SFDP fixups and use it to fix a bug on MX25L25635F - A bunch of minor cleanups/comestic changes
This commit is contained in:
commit
f366d3854e
786 changed files with 9765 additions and 5432 deletions
|
|
@ -27,7 +27,8 @@ int nanddev_bbt_init(struct nand_device *nand)
|
|||
unsigned int nwords = DIV_ROUND_UP(nblocks * bits_per_block,
|
||||
BITS_PER_LONG);
|
||||
|
||||
nand->bbt.cache = kzalloc(nwords, GFP_KERNEL);
|
||||
nand->bbt.cache = kcalloc(nwords, sizeof(*nand->bbt.cache),
|
||||
GFP_KERNEL);
|
||||
if (!nand->bbt.cache)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -2033,8 +2033,7 @@ atmel_hsmc_nand_controller_legacy_init(struct atmel_hsmc_nand_controller *nc)
|
|||
int ret;
|
||||
|
||||
nand_np = dev->of_node;
|
||||
nfc_np = of_find_compatible_node(dev->of_node, NULL,
|
||||
"atmel,sama5d3-nfc");
|
||||
nfc_np = of_get_compatible_child(dev->of_node, "atmel,sama5d3-nfc");
|
||||
if (!nfc_np) {
|
||||
dev_err(dev, "Could not find device node for sama5d3-nfc\n");
|
||||
return -ENODEV;
|
||||
|
|
@ -2448,15 +2447,19 @@ static int atmel_nand_controller_probe(struct platform_device *pdev)
|
|||
}
|
||||
|
||||
if (caps->legacy_of_bindings) {
|
||||
struct device_node *nfc_node;
|
||||
u32 ale_offs = 21;
|
||||
|
||||
/*
|
||||
* If we are parsing legacy DT props and the DT contains a
|
||||
* valid NFC node, forward the request to the sama5 logic.
|
||||
*/
|
||||
if (of_find_compatible_node(pdev->dev.of_node, NULL,
|
||||
"atmel,sama5d3-nfc"))
|
||||
nfc_node = of_get_compatible_child(pdev->dev.of_node,
|
||||
"atmel,sama5d3-nfc");
|
||||
if (nfc_node) {
|
||||
caps = &atmel_sama5_nand_caps;
|
||||
of_node_put(nfc_node);
|
||||
}
|
||||
|
||||
/*
|
||||
* Even if the compatible says we are dealing with an
|
||||
|
|
|
|||
|
|
@ -150,15 +150,15 @@
|
|||
#define NAND_VERSION_MINOR_SHIFT 16
|
||||
|
||||
/* NAND OP_CMDs */
|
||||
#define PAGE_READ 0x2
|
||||
#define PAGE_READ_WITH_ECC 0x3
|
||||
#define PAGE_READ_WITH_ECC_SPARE 0x4
|
||||
#define PROGRAM_PAGE 0x6
|
||||
#define PAGE_PROGRAM_WITH_ECC 0x7
|
||||
#define PROGRAM_PAGE_SPARE 0x9
|
||||
#define BLOCK_ERASE 0xa
|
||||
#define FETCH_ID 0xb
|
||||
#define RESET_DEVICE 0xd
|
||||
#define OP_PAGE_READ 0x2
|
||||
#define OP_PAGE_READ_WITH_ECC 0x3
|
||||
#define OP_PAGE_READ_WITH_ECC_SPARE 0x4
|
||||
#define OP_PROGRAM_PAGE 0x6
|
||||
#define OP_PAGE_PROGRAM_WITH_ECC 0x7
|
||||
#define OP_PROGRAM_PAGE_SPARE 0x9
|
||||
#define OP_BLOCK_ERASE 0xa
|
||||
#define OP_FETCH_ID 0xb
|
||||
#define OP_RESET_DEVICE 0xd
|
||||
|
||||
/* Default Value for NAND_DEV_CMD_VLD */
|
||||
#define NAND_DEV_CMD_VLD_VAL (READ_START_VLD | WRITE_START_VLD | \
|
||||
|
|
@ -692,11 +692,11 @@ static void update_rw_regs(struct qcom_nand_host *host, int num_cw, bool read)
|
|||
|
||||
if (read) {
|
||||
if (host->use_ecc)
|
||||
cmd = PAGE_READ_WITH_ECC | PAGE_ACC | LAST_PAGE;
|
||||
cmd = OP_PAGE_READ_WITH_ECC | PAGE_ACC | LAST_PAGE;
|
||||
else
|
||||
cmd = PAGE_READ | PAGE_ACC | LAST_PAGE;
|
||||
cmd = OP_PAGE_READ | PAGE_ACC | LAST_PAGE;
|
||||
} else {
|
||||
cmd = PROGRAM_PAGE | PAGE_ACC | LAST_PAGE;
|
||||
cmd = OP_PROGRAM_PAGE | PAGE_ACC | LAST_PAGE;
|
||||
}
|
||||
|
||||
if (host->use_ecc) {
|
||||
|
|
@ -1170,7 +1170,7 @@ static int nandc_param(struct qcom_nand_host *host)
|
|||
* in use. we configure the controller to perform a raw read of 512
|
||||
* bytes to read onfi params
|
||||
*/
|
||||
nandc_set_reg(nandc, NAND_FLASH_CMD, PAGE_READ | PAGE_ACC | LAST_PAGE);
|
||||
nandc_set_reg(nandc, NAND_FLASH_CMD, OP_PAGE_READ | PAGE_ACC | LAST_PAGE);
|
||||
nandc_set_reg(nandc, NAND_ADDR0, 0);
|
||||
nandc_set_reg(nandc, NAND_ADDR1, 0);
|
||||
nandc_set_reg(nandc, NAND_DEV0_CFG0, 0 << CW_PER_PAGE
|
||||
|
|
@ -1224,7 +1224,7 @@ static int erase_block(struct qcom_nand_host *host, int page_addr)
|
|||
struct qcom_nand_controller *nandc = get_qcom_nand_controller(chip);
|
||||
|
||||
nandc_set_reg(nandc, NAND_FLASH_CMD,
|
||||
BLOCK_ERASE | PAGE_ACC | LAST_PAGE);
|
||||
OP_BLOCK_ERASE | PAGE_ACC | LAST_PAGE);
|
||||
nandc_set_reg(nandc, NAND_ADDR0, page_addr);
|
||||
nandc_set_reg(nandc, NAND_ADDR1, 0);
|
||||
nandc_set_reg(nandc, NAND_DEV0_CFG0,
|
||||
|
|
@ -1255,7 +1255,7 @@ static int read_id(struct qcom_nand_host *host, int column)
|
|||
if (column == -1)
|
||||
return 0;
|
||||
|
||||
nandc_set_reg(nandc, NAND_FLASH_CMD, FETCH_ID);
|
||||
nandc_set_reg(nandc, NAND_FLASH_CMD, OP_FETCH_ID);
|
||||
nandc_set_reg(nandc, NAND_ADDR0, column);
|
||||
nandc_set_reg(nandc, NAND_ADDR1, 0);
|
||||
nandc_set_reg(nandc, NAND_FLASH_CHIP_SELECT,
|
||||
|
|
@ -1276,7 +1276,7 @@ static int reset(struct qcom_nand_host *host)
|
|||
struct nand_chip *chip = &host->chip;
|
||||
struct qcom_nand_controller *nandc = get_qcom_nand_controller(chip);
|
||||
|
||||
nandc_set_reg(nandc, NAND_FLASH_CMD, RESET_DEVICE);
|
||||
nandc_set_reg(nandc, NAND_FLASH_CMD, OP_RESET_DEVICE);
|
||||
nandc_set_reg(nandc, NAND_EXEC_CMD, 1);
|
||||
|
||||
write_reg_dma(nandc, NAND_FLASH_CMD, 1, NAND_BAM_NEXT_SGL);
|
||||
|
|
|
|||
|
|
@ -644,9 +644,23 @@ static int cqspi_indirect_write_execute(struct spi_nor *nor, loff_t to_addr,
|
|||
ndelay(cqspi->wr_delay);
|
||||
|
||||
while (remaining > 0) {
|
||||
size_t write_words, mod_bytes;
|
||||
|
||||
write_bytes = remaining > page_size ? page_size : remaining;
|
||||
iowrite32_rep(cqspi->ahb_base, txbuf,
|
||||
DIV_ROUND_UP(write_bytes, 4));
|
||||
write_words = write_bytes / 4;
|
||||
mod_bytes = write_bytes % 4;
|
||||
/* Write 4 bytes at a time then single bytes. */
|
||||
if (write_words) {
|
||||
iowrite32_rep(cqspi->ahb_base, txbuf, write_words);
|
||||
txbuf += (write_words * 4);
|
||||
}
|
||||
if (mod_bytes) {
|
||||
unsigned int temp = 0xFFFFFFFF;
|
||||
|
||||
memcpy(&temp, txbuf, mod_bytes);
|
||||
iowrite32(temp, cqspi->ahb_base);
|
||||
txbuf += mod_bytes;
|
||||
}
|
||||
|
||||
if (!wait_for_completion_timeout(&cqspi->transfer_complete,
|
||||
msecs_to_jiffies(CQSPI_TIMEOUT_MS))) {
|
||||
|
|
@ -655,7 +669,6 @@ static int cqspi_indirect_write_execute(struct spi_nor *nor, loff_t to_addr,
|
|||
goto failwr;
|
||||
}
|
||||
|
||||
txbuf += write_bytes;
|
||||
remaining -= write_bytes;
|
||||
|
||||
if (remaining > 0)
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue