diff options
| author | David Woodhouse <David.Woodhouse@intel.com> | 2012-09-29 10:37:03 -0400 |
|---|---|---|
| committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-09-29 10:37:49 -0400 |
| commit | 6997af7cee305bb9fc77260e84de94bfd486f7af (patch) | |
| tree | 4b5969a3e02b1682828912e4666c29be571da878 /include/linux/bcma | |
| parent | 1749c00ffc909db4ebf1b2f17fd52cdb6e7b149c (diff) | |
| parent | 371a00448f95adaa612cf1a0b31a11e7093bc706 (diff) | |
Merge commit '371a00448f95adaa612cf1a0b31a11e7093bc706' of 'git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git'
We need the following 2 patches from the 'net-next' tree for the BCMA flash
driver:
371a004 bcma: detect and register NAND flash device
d57ef3a bcma: detect and register serial flash device
and this is why we are merging the net-next tree (presumably persistent)
up to commit '371a004'.
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'include/linux/bcma')
| -rw-r--r-- | include/linux/bcma/bcma_driver_chipcommon.h | 111 | ||||
| -rw-r--r-- | include/linux/bcma/bcma_regs.h | 4 |
2 files changed, 115 insertions, 0 deletions
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h index d323a4b4143..6ba45d2b99d 100644 --- a/include/linux/bcma/bcma_driver_chipcommon.h +++ b/include/linux/bcma/bcma_driver_chipcommon.h | |||
| @@ -100,6 +100,7 @@ | |||
| 100 | #define BCMA_CC_CHIPST_4706_SFLASH_TYPE BIT(2) /* 0: 8b-p/ST-s flash, 1: 16b-p/Atmal-s flash */ | 100 | #define BCMA_CC_CHIPST_4706_SFLASH_TYPE BIT(2) /* 0: 8b-p/ST-s flash, 1: 16b-p/Atmal-s flash */ |
| 101 | #define BCMA_CC_CHIPST_4706_MIPS_BENDIAN BIT(3) /* 0: little, 1: big endian */ | 101 | #define BCMA_CC_CHIPST_4706_MIPS_BENDIAN BIT(3) /* 0: little, 1: big endian */ |
| 102 | #define BCMA_CC_CHIPST_4706_PCIE1_DISABLE BIT(5) /* PCIE1 enable strap pin */ | 102 | #define BCMA_CC_CHIPST_4706_PCIE1_DISABLE BIT(5) /* PCIE1 enable strap pin */ |
| 103 | #define BCMA_CC_CHIPST_5357_NAND_BOOT BIT(4) /* NAND boot, valid for CC rev 38 and/or BCM5357 */ | ||
| 103 | #define BCMA_CC_JCMD 0x0030 /* Rev >= 10 only */ | 104 | #define BCMA_CC_JCMD 0x0030 /* Rev >= 10 only */ |
| 104 | #define BCMA_CC_JCMD_START 0x80000000 | 105 | #define BCMA_CC_JCMD_START 0x80000000 |
| 105 | #define BCMA_CC_JCMD_BUSY 0x80000000 | 106 | #define BCMA_CC_JCMD_BUSY 0x80000000 |
| @@ -266,6 +267,29 @@ | |||
| 266 | #define BCMA_CC_SROM_CONTROL_SIZE_16K 0x00000004 | 267 | #define BCMA_CC_SROM_CONTROL_SIZE_16K 0x00000004 |
| 267 | #define BCMA_CC_SROM_CONTROL_SIZE_SHIFT 1 | 268 | #define BCMA_CC_SROM_CONTROL_SIZE_SHIFT 1 |
| 268 | #define BCMA_CC_SROM_CONTROL_PRESENT 0x00000001 | 269 | #define BCMA_CC_SROM_CONTROL_PRESENT 0x00000001 |
| 270 | /* Block 0x140 - 0x190 registers are chipset specific */ | ||
| 271 | #define BCMA_CC_4706_FLASHSCFG 0x18C /* Flash struct configuration */ | ||
| 272 | #define BCMA_CC_4706_FLASHSCFG_MASK 0x000000ff | ||
| 273 | #define BCMA_CC_4706_FLASHSCFG_SF1 0x00000001 /* 2nd serial flash present */ | ||
| 274 | #define BCMA_CC_4706_FLASHSCFG_PF1 0x00000002 /* 2nd parallel flash present */ | ||
| 275 | #define BCMA_CC_4706_FLASHSCFG_SF1_TYPE 0x00000004 /* 2nd serial flash type : 0 : ST, 1 : Atmel */ | ||
| 276 | #define BCMA_CC_4706_FLASHSCFG_NF1 0x00000008 /* 2nd NAND flash present */ | ||
| 277 | #define BCMA_CC_4706_FLASHSCFG_1ST_MADDR_SEG_MASK 0x000000f0 | ||
| 278 | #define BCMA_CC_4706_FLASHSCFG_1ST_MADDR_SEG_4MB 0x00000010 /* 4MB */ | ||
| 279 | #define BCMA_CC_4706_FLASHSCFG_1ST_MADDR_SEG_8MB 0x00000020 /* 8MB */ | ||
| 280 | #define BCMA_CC_4706_FLASHSCFG_1ST_MADDR_SEG_16MB 0x00000030 /* 16MB */ | ||
| 281 | #define BCMA_CC_4706_FLASHSCFG_1ST_MADDR_SEG_32MB 0x00000040 /* 32MB */ | ||
| 282 | #define BCMA_CC_4706_FLASHSCFG_1ST_MADDR_SEG_64MB 0x00000050 /* 64MB */ | ||
| 283 | #define BCMA_CC_4706_FLASHSCFG_1ST_MADDR_SEG_128MB 0x00000060 /* 128MB */ | ||
| 284 | #define BCMA_CC_4706_FLASHSCFG_1ST_MADDR_SEG_256MB 0x00000070 /* 256MB */ | ||
| 285 | /* NAND flash registers for BCM4706 (corerev = 31) */ | ||
| 286 | #define BCMA_CC_NFLASH_CTL 0x01A0 | ||
| 287 | #define BCMA_CC_NFLASH_CTL_ERR 0x08000000 | ||
| 288 | #define BCMA_CC_NFLASH_CONF 0x01A4 | ||
| 289 | #define BCMA_CC_NFLASH_COL_ADDR 0x01A8 | ||
| 290 | #define BCMA_CC_NFLASH_ROW_ADDR 0x01AC | ||
| 291 | #define BCMA_CC_NFLASH_DATA 0x01B0 | ||
| 292 | #define BCMA_CC_NFLASH_WAITCNT0 0x01B4 | ||
| 269 | /* 0x1E0 is defined as shared BCMA_CLKCTLST */ | 293 | /* 0x1E0 is defined as shared BCMA_CLKCTLST */ |
| 270 | #define BCMA_CC_HW_WORKAROUND 0x01E4 /* Hardware workaround (rev >= 20) */ | 294 | #define BCMA_CC_HW_WORKAROUND 0x01E4 /* Hardware workaround (rev >= 20) */ |
| 271 | #define BCMA_CC_UART0_DATA 0x0300 | 295 | #define BCMA_CC_UART0_DATA 0x0300 |
| @@ -325,6 +349,60 @@ | |||
| 325 | #define BCMA_CC_PLLCTL_ADDR 0x0660 | 349 | #define BCMA_CC_PLLCTL_ADDR 0x0660 |
| 326 | #define BCMA_CC_PLLCTL_DATA 0x0664 | 350 | #define BCMA_CC_PLLCTL_DATA 0x0664 |
| 327 | #define BCMA_CC_SPROM 0x0800 /* SPROM beginning */ | 351 | #define BCMA_CC_SPROM 0x0800 /* SPROM beginning */ |
| 352 | /* NAND flash MLC controller registers (corerev >= 38) */ | ||
| 353 | #define BCMA_CC_NAND_REVISION 0x0C00 | ||
| 354 | #define BCMA_CC_NAND_CMD_START 0x0C04 | ||
| 355 | #define BCMA_CC_NAND_CMD_ADDR_X 0x0C08 | ||
| 356 | #define BCMA_CC_NAND_CMD_ADDR 0x0C0C | ||
| 357 | #define BCMA_CC_NAND_CMD_END_ADDR 0x0C10 | ||
| 358 | #define BCMA_CC_NAND_CS_NAND_SELECT 0x0C14 | ||
| 359 | #define BCMA_CC_NAND_CS_NAND_XOR 0x0C18 | ||
| 360 | #define BCMA_CC_NAND_SPARE_RD0 0x0C20 | ||
| 361 | #define BCMA_CC_NAND_SPARE_RD4 0x0C24 | ||
| 362 | #define BCMA_CC_NAND_SPARE_RD8 0x0C28 | ||
| 363 | #define BCMA_CC_NAND_SPARE_RD12 0x0C2C | ||
| 364 | #define BCMA_CC_NAND_SPARE_WR0 0x0C30 | ||
| 365 | #define BCMA_CC_NAND_SPARE_WR4 0x0C34 | ||
| 366 | #define BCMA_CC_NAND_SPARE_WR8 0x0C38 | ||
| 367 | #define BCMA_CC_NAND_SPARE_WR12 0x0C3C | ||
| 368 | #define BCMA_CC_NAND_ACC_CONTROL 0x0C40 | ||
| 369 | #define BCMA_CC_NAND_CONFIG 0x0C48 | ||
| 370 | #define BCMA_CC_NAND_TIMING_1 0x0C50 | ||
| 371 | #define BCMA_CC_NAND_TIMING_2 0x0C54 | ||
| 372 | #define BCMA_CC_NAND_SEMAPHORE 0x0C58 | ||
| 373 | #define BCMA_CC_NAND_DEVID 0x0C60 | ||
| 374 | #define BCMA_CC_NAND_DEVID_X 0x0C64 | ||
| 375 | #define BCMA_CC_NAND_BLOCK_LOCK_STATUS 0x0C68 | ||
| 376 | #define BCMA_CC_NAND_INTFC_STATUS 0x0C6C | ||
| 377 | #define BCMA_CC_NAND_ECC_CORR_ADDR_X 0x0C70 | ||
| 378 | #define BCMA_CC_NAND_ECC_CORR_ADDR 0x0C74 | ||
| 379 | #define BCMA_CC_NAND_ECC_UNC_ADDR_X 0x0C78 | ||
| 380 | #define BCMA_CC_NAND_ECC_UNC_ADDR 0x0C7C | ||
| 381 | #define BCMA_CC_NAND_READ_ERROR_COUNT 0x0C80 | ||
| 382 | #define BCMA_CC_NAND_CORR_STAT_THRESHOLD 0x0C84 | ||
| 383 | #define BCMA_CC_NAND_READ_ADDR_X 0x0C90 | ||
| 384 | #define BCMA_CC_NAND_READ_ADDR 0x0C94 | ||
| 385 | #define BCMA_CC_NAND_PAGE_PROGRAM_ADDR_X 0x0C98 | ||
| 386 | #define BCMA_CC_NAND_PAGE_PROGRAM_ADDR 0x0C9C | ||
| 387 | #define BCMA_CC_NAND_COPY_BACK_ADDR_X 0x0CA0 | ||
| 388 | #define BCMA_CC_NAND_COPY_BACK_ADDR 0x0CA4 | ||
| 389 | #define BCMA_CC_NAND_BLOCK_ERASE_ADDR_X 0x0CA8 | ||
| 390 | #define BCMA_CC_NAND_BLOCK_ERASE_ADDR 0x0CAC | ||
| 391 | #define BCMA_CC_NAND_INV_READ_ADDR_X 0x0CB0 | ||
| 392 | #define BCMA_CC_NAND_INV_READ_ADDR 0x0CB4 | ||
| 393 | #define BCMA_CC_NAND_BLK_WR_PROTECT 0x0CC0 | ||
| 394 | #define BCMA_CC_NAND_ACC_CONTROL_CS1 0x0CD0 | ||
| 395 | #define BCMA_CC_NAND_CONFIG_CS1 0x0CD4 | ||
| 396 | #define BCMA_CC_NAND_TIMING_1_CS1 0x0CD8 | ||
| 397 | #define BCMA_CC_NAND_TIMING_2_CS1 0x0CDC | ||
| 398 | #define BCMA_CC_NAND_SPARE_RD16 0x0D30 | ||
| 399 | #define BCMA_CC_NAND_SPARE_RD20 0x0D34 | ||
| 400 | #define BCMA_CC_NAND_SPARE_RD24 0x0D38 | ||
| 401 | #define BCMA_CC_NAND_SPARE_RD28 0x0D3C | ||
| 402 | #define BCMA_CC_NAND_CACHE_ADDR 0x0D40 | ||
| 403 | #define BCMA_CC_NAND_CACHE_DATA 0x0D44 | ||
| 404 | #define BCMA_CC_NAND_CTRL_CONFIG 0x0D48 | ||
| 405 | #define BCMA_CC_NAND_CTRL_STATUS 0x0D4C | ||
| 328 | 406 | ||
| 329 | /* Divider allocation in 4716/47162/5356 */ | 407 | /* Divider allocation in 4716/47162/5356 */ |
| 330 | #define BCMA_CC_PMU5_MAINPLL_CPU 1 | 408 | #define BCMA_CC_PMU5_MAINPLL_CPU 1 |
| @@ -415,6 +493,13 @@ | |||
| 415 | /* 4313 Chip specific ChipControl register bits */ | 493 | /* 4313 Chip specific ChipControl register bits */ |
| 416 | #define BCMA_CCTRL_4313_12MA_LED_DRIVE 0x00000007 /* 12 mA drive strengh for later 4313 */ | 494 | #define BCMA_CCTRL_4313_12MA_LED_DRIVE 0x00000007 /* 12 mA drive strengh for later 4313 */ |
| 417 | 495 | ||
| 496 | /* BCM5357 ChipControl register bits */ | ||
| 497 | #define BCMA_CHIPCTL_5357_EXTPA BIT(14) | ||
| 498 | #define BCMA_CHIPCTL_5357_ANT_MUX_2O3 BIT(15) | ||
| 499 | #define BCMA_CHIPCTL_5357_NFLASH BIT(16) | ||
| 500 | #define BCMA_CHIPCTL_5357_I2S_PINS_ENABLE BIT(18) | ||
| 501 | #define BCMA_CHIPCTL_5357_I2CSPI_PINS_ENABLE BIT(19) | ||
| 502 | |||
| 418 | /* Data for the PMU, if available. | 503 | /* Data for the PMU, if available. |
| 419 | * Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU) | 504 | * Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU) |
| 420 | */ | 505 | */ |
| @@ -430,6 +515,26 @@ struct bcma_pflash { | |||
| 430 | u32 window_size; | 515 | u32 window_size; |
| 431 | }; | 516 | }; |
| 432 | 517 | ||
| 518 | #ifdef CONFIG_BCMA_SFLASH | ||
| 519 | struct bcma_sflash { | ||
| 520 | bool present; | ||
| 521 | u32 window; | ||
| 522 | u32 blocksize; | ||
| 523 | u16 numblocks; | ||
| 524 | u32 size; | ||
| 525 | }; | ||
| 526 | #endif | ||
| 527 | |||
| 528 | #ifdef CONFIG_BCMA_NFLASH | ||
| 529 | struct mtd_info; | ||
| 530 | |||
| 531 | struct bcma_nflash { | ||
| 532 | bool present; | ||
| 533 | |||
| 534 | struct mtd_info *mtd; | ||
| 535 | }; | ||
| 536 | #endif | ||
| 537 | |||
| 433 | struct bcma_serial_port { | 538 | struct bcma_serial_port { |
| 434 | void *regs; | 539 | void *regs; |
| 435 | unsigned long clockspeed; | 540 | unsigned long clockspeed; |
| @@ -450,6 +555,12 @@ struct bcma_drv_cc { | |||
| 450 | struct bcma_chipcommon_pmu pmu; | 555 | struct bcma_chipcommon_pmu pmu; |
| 451 | #ifdef CONFIG_BCMA_DRIVER_MIPS | 556 | #ifdef CONFIG_BCMA_DRIVER_MIPS |
| 452 | struct bcma_pflash pflash; | 557 | struct bcma_pflash pflash; |
| 558 | #ifdef CONFIG_BCMA_SFLASH | ||
| 559 | struct bcma_sflash sflash; | ||
| 560 | #endif | ||
| 561 | #ifdef CONFIG_BCMA_NFLASH | ||
| 562 | struct bcma_nflash nflash; | ||
| 563 | #endif | ||
| 453 | 564 | ||
| 454 | int nr_serial_ports; | 565 | int nr_serial_ports; |
| 455 | struct bcma_serial_port serial_ports[4]; | 566 | struct bcma_serial_port serial_ports[4]; |
diff --git a/include/linux/bcma/bcma_regs.h b/include/linux/bcma/bcma_regs.h index 5a71d571964..6c9cb93ae3d 100644 --- a/include/linux/bcma/bcma_regs.h +++ b/include/linux/bcma/bcma_regs.h | |||
| @@ -11,11 +11,13 @@ | |||
| 11 | #define BCMA_CLKCTLST_HAVEHTREQ 0x00000010 /* HT available request */ | 11 | #define BCMA_CLKCTLST_HAVEHTREQ 0x00000010 /* HT available request */ |
| 12 | #define BCMA_CLKCTLST_HWCROFF 0x00000020 /* Force HW clock request off */ | 12 | #define BCMA_CLKCTLST_HWCROFF 0x00000020 /* Force HW clock request off */ |
| 13 | #define BCMA_CLKCTLST_EXTRESREQ 0x00000700 /* Mask of external resource requests */ | 13 | #define BCMA_CLKCTLST_EXTRESREQ 0x00000700 /* Mask of external resource requests */ |
| 14 | #define BCMA_CLKCTLST_EXTRESREQ_SHIFT 8 | ||
| 14 | #define BCMA_CLKCTLST_HAVEALP 0x00010000 /* ALP available */ | 15 | #define BCMA_CLKCTLST_HAVEALP 0x00010000 /* ALP available */ |
| 15 | #define BCMA_CLKCTLST_HAVEHT 0x00020000 /* HT available */ | 16 | #define BCMA_CLKCTLST_HAVEHT 0x00020000 /* HT available */ |
| 16 | #define BCMA_CLKCTLST_BP_ON_ALP 0x00040000 /* RO: running on ALP clock */ | 17 | #define BCMA_CLKCTLST_BP_ON_ALP 0x00040000 /* RO: running on ALP clock */ |
| 17 | #define BCMA_CLKCTLST_BP_ON_HT 0x00080000 /* RO: running on HT clock */ | 18 | #define BCMA_CLKCTLST_BP_ON_HT 0x00080000 /* RO: running on HT clock */ |
| 18 | #define BCMA_CLKCTLST_EXTRESST 0x07000000 /* Mask of external resource status */ | 19 | #define BCMA_CLKCTLST_EXTRESST 0x07000000 /* Mask of external resource status */ |
| 20 | #define BCMA_CLKCTLST_EXTRESST_SHIFT 24 | ||
| 19 | /* Is there any BCM4328 on BCMA bus? */ | 21 | /* Is there any BCM4328 on BCMA bus? */ |
| 20 | #define BCMA_CLKCTLST_4328A0_HAVEHT 0x00010000 /* 4328a0 has reversed bits */ | 22 | #define BCMA_CLKCTLST_4328A0_HAVEHT 0x00010000 /* 4328a0 has reversed bits */ |
| 21 | #define BCMA_CLKCTLST_4328A0_HAVEALP 0x00020000 /* 4328a0 has reversed bits */ | 23 | #define BCMA_CLKCTLST_4328A0_HAVEALP 0x00020000 /* 4328a0 has reversed bits */ |
| @@ -83,4 +85,6 @@ | |||
| 83 | * (2 ZettaBytes), high 32 bits | 85 | * (2 ZettaBytes), high 32 bits |
| 84 | */ | 86 | */ |
| 85 | 87 | ||
| 88 | #define BCMA_SFLASH 0x1c000000 | ||
| 89 | |||
| 86 | #endif /* LINUX_BCMA_REGS_H_ */ | 90 | #endif /* LINUX_BCMA_REGS_H_ */ |
