1*83d290c5STom Rini /* SPDX-License-Identifier: GPL-2.0+ */ 26aff0509Spekon gupta /* 36aff0509Spekon gupta * (C) Copyright 2004-2008 Texas Instruments, <www.ti.com> 46aff0509Spekon gupta * Rohit Choraria <rohitkc@ti.com> 56aff0509Spekon gupta * 609c2b8f3SAndreas Bießmann * (C) Copyright 2013 Andreas Bießmann <andreas@biessmann.org> 76aff0509Spekon gupta */ 86aff0509Spekon gupta #ifndef __ASM_OMAP_GPMC_H 96aff0509Spekon gupta #define __ASM_OMAP_GPMC_H 106aff0509Spekon gupta 116aff0509Spekon gupta #define GPMC_BUF_EMPTY 0 126aff0509Spekon gupta #define GPMC_BUF_FULL 1 138d13a730Spekon gupta #define GPMC_MAX_SECTORS 8 146aff0509Spekon gupta 156aff0509Spekon gupta enum omap_ecc { 166aff0509Spekon gupta /* 1-bit ECC calculation by Software, Error detection by Software */ 176aff0509Spekon gupta OMAP_ECC_HAM1_CODE_SW = 1, /* avoid un-initialized int can be 0x0 */ 186aff0509Spekon gupta /* 1-bit ECC calculation by GPMC, Error detection by Software */ 196aff0509Spekon gupta /* ECC layout compatible to legacy ROMCODE. */ 206aff0509Spekon gupta OMAP_ECC_HAM1_CODE_HW, 216aff0509Spekon gupta /* 4-bit ECC calculation by GPMC, Error detection by Software */ 226aff0509Spekon gupta OMAP_ECC_BCH4_CODE_HW_DETECTION_SW, 236aff0509Spekon gupta /* 4-bit ECC calculation by GPMC, Error detection by ELM */ 246aff0509Spekon gupta OMAP_ECC_BCH4_CODE_HW, 256aff0509Spekon gupta /* 8-bit ECC calculation by GPMC, Error detection by Software */ 266aff0509Spekon gupta OMAP_ECC_BCH8_CODE_HW_DETECTION_SW, 276aff0509Spekon gupta /* 8-bit ECC calculation by GPMC, Error detection by ELM */ 286aff0509Spekon gupta OMAP_ECC_BCH8_CODE_HW, 2946840f66Spekon gupta /* 16-bit ECC calculation by GPMC, Error detection by ELM */ 3046840f66Spekon gupta OMAP_ECC_BCH16_CODE_HW, 316aff0509Spekon gupta }; 326aff0509Spekon gupta 336aff0509Spekon gupta struct gpmc_cs { 346aff0509Spekon gupta u32 config1; /* 0x00 */ 356aff0509Spekon gupta u32 config2; /* 0x04 */ 366aff0509Spekon gupta u32 config3; /* 0x08 */ 376aff0509Spekon gupta u32 config4; /* 0x0C */ 386aff0509Spekon gupta u32 config5; /* 0x10 */ 396aff0509Spekon gupta u32 config6; /* 0x14 */ 406aff0509Spekon gupta u32 config7; /* 0x18 */ 416aff0509Spekon gupta u32 nand_cmd; /* 0x1C */ 426aff0509Spekon gupta u32 nand_adr; /* 0x20 */ 436aff0509Spekon gupta u32 nand_dat; /* 0x24 */ 446aff0509Spekon gupta u8 res[8]; /* blow up to 0x30 byte */ 456aff0509Spekon gupta }; 466aff0509Spekon gupta 476aff0509Spekon gupta struct bch_res_0_3 { 486aff0509Spekon gupta u32 bch_result_x[4]; 496aff0509Spekon gupta }; 506aff0509Spekon gupta 5146840f66Spekon gupta struct bch_res_4_6 { 5246840f66Spekon gupta u32 bch_result_x[3]; 5346840f66Spekon gupta }; 5446840f66Spekon gupta 556aff0509Spekon gupta struct gpmc { 566aff0509Spekon gupta u8 res1[0x10]; 576aff0509Spekon gupta u32 sysconfig; /* 0x10 */ 586aff0509Spekon gupta u8 res2[0x4]; 596aff0509Spekon gupta u32 irqstatus; /* 0x18 */ 606aff0509Spekon gupta u32 irqenable; /* 0x1C */ 616aff0509Spekon gupta u8 res3[0x20]; 626aff0509Spekon gupta u32 timeout_control; /* 0x40 */ 636aff0509Spekon gupta u8 res4[0xC]; 646aff0509Spekon gupta u32 config; /* 0x50 */ 656aff0509Spekon gupta u32 status; /* 0x54 */ 666aff0509Spekon gupta u8 res5[0x8]; /* 0x58 */ 676aff0509Spekon gupta struct gpmc_cs cs[8]; /* 0x60, 0x90, .. */ 68c316f577SDaniel Mack u32 prefetch_config1; /* 0x1E0 */ 69c316f577SDaniel Mack u32 prefetch_config2; /* 0x1E4 */ 70c316f577SDaniel Mack u32 res6; /* 0x1E8 */ 71c316f577SDaniel Mack u32 prefetch_control; /* 0x1EC */ 72c316f577SDaniel Mack u32 prefetch_status; /* 0x1F0 */ 736aff0509Spekon gupta u32 ecc_config; /* 0x1F4 */ 746aff0509Spekon gupta u32 ecc_control; /* 0x1F8 */ 756aff0509Spekon gupta u32 ecc_size_config; /* 0x1FC */ 766aff0509Spekon gupta u32 ecc1_result; /* 0x200 */ 776aff0509Spekon gupta u32 ecc2_result; /* 0x204 */ 786aff0509Spekon gupta u32 ecc3_result; /* 0x208 */ 796aff0509Spekon gupta u32 ecc4_result; /* 0x20C */ 806aff0509Spekon gupta u32 ecc5_result; /* 0x210 */ 816aff0509Spekon gupta u32 ecc6_result; /* 0x214 */ 826aff0509Spekon gupta u32 ecc7_result; /* 0x218 */ 836aff0509Spekon gupta u32 ecc8_result; /* 0x21C */ 846aff0509Spekon gupta u32 ecc9_result; /* 0x220 */ 856aff0509Spekon gupta u8 res7[12]; /* 0x224 */ 866aff0509Spekon gupta u32 testmomde_ctrl; /* 0x230 */ 876aff0509Spekon gupta u8 res8[12]; /* 0x234 */ 888d13a730Spekon gupta struct bch_res_0_3 bch_result_0_3[GPMC_MAX_SECTORS]; /* 0x240,0x250, */ 8946840f66Spekon gupta u8 res9[16 * 4]; /* 0x2C0 - 0x2FF */ 9046840f66Spekon gupta struct bch_res_4_6 bch_result_4_6[GPMC_MAX_SECTORS]; /* 0x300,0x310, */ 916aff0509Spekon gupta }; 926aff0509Spekon gupta 936aff0509Spekon gupta /* Used for board specific gpmc initialization */ 940568dd06SLadislav Michl extern const struct gpmc *gpmc_cfg; 9522d6ac49SLadislav Michl extern char gpmc_cs0_flash; 966aff0509Spekon gupta 976aff0509Spekon gupta #endif /* __ASM_OMAP_GPMC_H */ 98