patch for 64 bit wide flash
I've got a 64 bit wide flash consisting of eight 8bit wide chips. Here's a patch against the 2.4.16 kernel
I think I've added enough code to support all 64 bit wide configurations,
but somebody whould probably check me on it.
Signature · 4 lines
Adam Wozniak (KG6GZR) COM DEV Wireless - Digital and Software Systems [email protected] 3450 Broad St. 107, San Luis Obispo, CA 93401 http://www.comdev.cc Voice: (805) 544-1089 Fax: (805) 544-2055
include/linux/autoconf.h +592 -0
@@ -0,0 +1,592 @@ +/* +* Automatically generated by make menuconfig: don't edit +*/ +#define AUTOCONF_INCLUDED +#undef CONFIG_UID16 +#undef CONFIG_RWSEM_GENERIC_SPINLOCK +#define CONFIG_RWSEM_XCHGADD_ALGORITHM 1 +#define CONFIG_HAVE_DEC_LOCK 1 + +/* +* Code maturity level options +*/ +#define CONFIG_EXPERIMENTAL 1 + +/* +* Loadable module support +*/ +#undef CONFIG_MODULES + +/* +* Platform support +*/ +#define CONFIG_PPC 1 +#define CONFIG_PPC32 1 +#define CONFIG_6xx 1 +#undef CONFIG_4xx +#undef CONFIG_POWER3 +#undef CONFIG_POWER4 +#undef CONFIG_8xx +#define CONFIG_8260 1 +#define CONFIG_PPC_STD_MMU 1 +#define CONFIG_SERIAL_CONSOLE 1 +#undef CONFIG_EST8260 +#define CONFIG_SERIAL_CONSOLE 1 +#define CONFIG_COMDEV 1 +#undef CONFIG_SMP + +/* +* General setup +*/ +#undef CONFIG_HIGHMEM +#undef CONFIG_ISA +#undef CONFIG_EISA +#undef CONFIG_SBUS +#undef CONFIG_MCA +#undef CONFIG_PCI +#define CONFIG_NET 1 +#define CONFIG_SYSCTL 1 +#define CONFIG_SYSVIPC 1 +#undef CONFIG_BSD_PROCESS_ACCT +#define CONFIG_KCORE_ELF 1 +#define CONFIG_BINFMT_ELF 1 +#define CONFIG_KERNEL_ELF 1 +#undef CONFIG_BINFMT_MISC +#undef CONFIG_HOTPLUG +#undef CONFIG_PCMCIA + +/* +* Parallel port support +*/ +#undef CONFIG_PARPORT +#undef CONFIG_PPC_RTC +#define CONFIG_CMDLINE_BOOL 1 +#define CONFIG_CMDLINE "console=ttyS0,9600 console=tty0 root=/dev/sda2" + +/* +* Memory Technology Devices (MTD) +*/ +#define CONFIG_MTD 1 +#undef CONFIG_MTD_DEBUG +#define CONFIG_MTD_PARTITIONS 1 +#undef CONFIG_MTD_REDBOOT_PARTS +#undef CONFIG_MTD_CHAR +#define CONFIG_MTD_BLOCK 1 +#undef CONFIG_FTL +#undef CONFIG_NFTL + +/* +* RAM/ROM/Flash chip drivers +*/ +#define CONFIG_MTD_CFI 1 +#undef CONFIG_MTD_JEDECPROBE +#define CONFIG_MTD_GEN_PROBE 1 +#undef CONFIG_MTD_CFI_ADV_OPTIONS +#define CONFIG_MTD_CFI_INTELEXT 1 +#undef CONFIG_MTD_CFI_AMDSTD +#undef CONFIG_MTD_RAM +#undef CONFIG_MTD_ROM +#undef CONFIG_MTD_ABSENT +#undef CONFIG_MTD_OBSOLETE_CHIPS +#undef CONFIG_MTD_AMDSTD +#undef CONFIG_MTD_SHARP +#undef CONFIG_MTD_JEDEC + +/* +* Mapping drivers for chip access +*/ +#define CONFIG_MTD_PHYSMAP 1 +#define CONFIG_MTD_PHYSMAP_START 0xF8000000 +#define CONFIG_MTD_PHYSMAP_LEN 0x8000000 +#define CONFIG_MTD_PHYSMAP_BUSWIDTH (8) +#undef CONFIG_MTD_TQM8XXL +#undef CONFIG_MTD_RPXLITE +#undef CONFIG_MTD_DBOX2 +#undef CONFIG_MTD_CFI_FLAGADM + +/* +* Self-contained MTD device drivers +*/ +#undef CONFIG_MTD_PMC551 +#undef CONFIG_MTD_SLRAM +#undef CONFIG_MTD_MTDRAM +#undef CONFIG_MTD_BLKMTD +#undef CONFIG_MTD_DOC1000 +#undef CONFIG_MTD_DOC2000 +#undef CONFIG_MTD_DOC2001 +#undef CONFIG_MTD_DOCPROBE + +/* +* NAND Flash Device Drivers +*/ +#undef CONFIG_MTD_NAND + +/* +* Plug and Play configuration +*/ +#undef CONFIG_PNP +#undef CONFIG_ISAPNP + +/* +* Block devices +*/ +#undef CONFIG_BLK_DEV_FD +#undef CONFIG_BLK_DEV_XD +#undef CONFIG_PARIDE +#undef CONFIG_BLK_CPQ_DA +#undef CONFIG_BLK_CPQ_CISS_DA +#undef CONFIG_BLK_DEV_DAC960 +#define CONFIG_BLK_DEV_LOOP 1 +#undef CONFIG_BLK_DEV_NBD +#define CONFIG_BLK_DEV_RAM 1 +#define CONFIG_BLK_DEV_RAM_SIZE (10240) +#define CONFIG_BLK_DEV_INITRD 1 + +/* +* Multi-device support (RAID and LVM) +*/ +#undef CONFIG_MD +#undef CONFIG_BLK_DEV_MD +#undef CONFIG_MD_LINEAR +#undef CONFIG_MD_RAID0 +#undef CONFIG_MD_RAID1 +#undef CONFIG_MD_RAID5 +#undef CONFIG_MD_MULTIPATH +#undef CONFIG_BLK_DEV_LVM + +/* +* Networking options +*/ +#define CONFIG_PACKET 1 +#undef CONFIG_PACKET_MMAP +#define CONFIG_NETLINK 1 +#define CONFIG_RTNETLINK 1 +#undef CONFIG_NETLINK_DEV +#define CONFIG_NETFILTER 1 +#undef CONFIG_NETFILTER_DEBUG +#define CONFIG_FILTER 1 +#define CONFIG_UNIX 1 +#define CONFIG_INET 1 +#define CONFIG_IP_MULTICAST 1 +#undef CONFIG_IP_ADVANCED_ROUTER +#define CONFIG_IP_PNP 1 +#undef CONFIG_IP_PNP_DHCP +#undef CONFIG_IP_PNP_BOOTP +#undef CONFIG_IP_PNP_RARP +#undef CONFIG_NET_IPIP +#undef CONFIG_NET_IPGRE +#define CONFIG_IP_MROUTE 1 +#undef CONFIG_IP_PIMSM_V1 +#undef CONFIG_IP_PIMSM_V2 +#undef CONFIG_ARPD +#undef CONFIG_INET_ECN +#define CONFIG_SYN_COOKIES 1 + +/* +* IP: Netfilter Configuration +*/ +#define CONFIG_IP_NF_CONNTRACK 1 +#define CONFIG_IP_NF_FTP 1 +#define CONFIG_IP_NF_IRC 1 +#undef CONFIG_IP_NF_QUEUE +#define CONFIG_IP_NF_IPTABLES 1 +#undef CONFIG_IP_NF_MATCH_LIMIT +#define CONFIG_IP_NF_MATCH_MAC 1 +#undef CONFIG_IP_NF_MATCH_MARK +#define CONFIG_IP_NF_MATCH_MULTIPORT 1 +#undef CONFIG_IP_NF_MATCH_TOS +#define CONFIG_IP_NF_MATCH_LENGTH 1 +#define CONFIG_IP_NF_MATCH_TTL 1 +#undef CONFIG_IP_NF_MATCH_TCPMSS +#define CONFIG_IP_NF_MATCH_STATE 1 +#undef CONFIG_IP_NF_MATCH_UNCLEAN +#undef CONFIG_IP_NF_MATCH_OWNER +#define CONFIG_IP_NF_FILTER 1 +#define CONFIG_IP_NF_TARGET_REJECT 1 +#undef CONFIG_IP_NF_TARGET_MIRROR +#define CONFIG_IP_NF_NAT 1 +#define CONFIG_IP_NF_NAT_NEEDED 1 +#define CONFIG_IP_NF_TARGET_MASQUERADE 1 +#define CONFIG_IP_NF_TARGET_REDIRECT 1 +#define CONFIG_IP_NF_NAT_SNMP_BASIC 1 +#define CONFIG_IP_NF_NAT_IRC 1 +#define CONFIG_IP_NF_NAT_FTP 1 +#undef CONFIG_IP_NF_MANGLE +#undef CONFIG_IP_NF_TARGET_LOG +#undef CONFIG_IP_NF_TARGET_TCPMSS +#undef CONFIG_IPV6 +#undef CONFIG_KHTTPD +#undef CONFIG_ATM +#undef CONFIG_VLAN_8021Q +#undef CONFIG_IPX +#undef CONFIG_ATALK +#undef CONFIG_DECNET +#undef CONFIG_BRIDGE +#undef CONFIG_X25 +#undef CONFIG_LAPB +#undef CONFIG_LLC +#undef CONFIG_NET_DIVERT +#undef CONFIG_ECONET +#undef CONFIG_WAN_ROUTER +#undef CONFIG_NET_FASTROUTE +#undef CONFIG_NET_HW_FLOWCONTROL + +/* +* QoS and/or fair queueing +*/ +#undef CONFIG_NET_SCHED + +/* +* ATA/IDE/MFM/RLL support +*/ +#undef CONFIG_IDE +#undef CONFIG_BLK_DEV_IDE_MODES +#undef CONFIG_BLK_DEV_HD + +/* +* SCSI support +*/ +#undef CONFIG_SCSI + +/* +* Network device support +*/ +#define CONFIG_NETDEVICES 1 + +/* +* ARCnet devices +*/ +#undef CONFIG_ARCNET +#undef CONFIG_DUMMY +#undef CONFIG_BONDING +#undef CONFIG_EQUALIZER +#undef CONFIG_TUN +#undef CONFIG_ETHERTAP + +/* +* Ethernet (10 or 100Mbit) +*/ +#define CONFIG_NET_ETHERNET 1 +#undef CONFIG_MACE +#undef CONFIG_BMAC +#undef CONFIG_GMAC +#undef CONFIG_OAKNET +#undef CONFIG_SUNLANCE +#undef CONFIG_SUNBMAC +#undef CONFIG_SUNQE +#undef CONFIG_SUNLANCE +#undef CONFIG_SUNGEM +#undef CONFIG_NET_VENDOR_3COM +#undef CONFIG_LANCE +#undef CONFIG_NET_VENDOR_SMC +#undef CONFIG_NET_VENDOR_RACAL +#undef CONFIG_NET_ISA +#undef CONFIG_NET_PCI +#undef CONFIG_NET_POCKET + +/* +* Ethernet (1000 Mbit) +*/ +#undef CONFIG_ACENIC +#undef CONFIG_DL2K +#undef CONFIG_MYRI_SBUS +#undef CONFIG_NS83820 +#undef CONFIG_HAMACHI +#undef CONFIG_YELLOWFIN +#undef CONFIG_SK98LIN +#undef CONFIG_FDDI +#undef CONFIG_HIPPI +#undef CONFIG_PLIP +#undef CONFIG_PPP +#undef CONFIG_SLIP + +/* +* Wireless LAN (non-hamradio) +*/ +#undef CONFIG_NET_RADIO + +/* +* Token Ring devices +*/ +#undef CONFIG_TR +#undef CONFIG_NET_FC +#undef CONFIG_RCPCI +#undef CONFIG_SHAPER + +/* +* Wan interfaces +*/ +#undef CONFIG_WAN + +/* +* Amateur Radio support +*/ +#undef CONFIG_HAMRADIO + +/* +* IrDA (infrared) support +*/ +#undef CONFIG_IRDA + +/* +* ISDN subsystem +*/ +#undef CONFIG_ISDN + +/* +* Old CD-ROM drivers (not SCSI, not IDE) +*/ +#undef CONFIG_CD_NO_IDESCSI + +/* +* Console drivers +*/ +#undef CONFIG_VGA_CONSOLE + +/* +* Frame-buffer support +*/ +#undef CONFIG_FB + +/* +* Input core support +*/ +#undef CONFIG_INPUT +#undef CONFIG_INPUT_KEYBDEV +#undef CONFIG_INPUT_MOUSEDEV +#undef CONFIG_INPUT_JOYDEV +#undef CONFIG_INPUT_EVDEV + +/* +* Macintosh device drivers +*/ + +/* +* Character devices +*/ +#undef CONFIG_VT +#undef CONFIG_SERIAL +#undef CONFIG_SERIAL_EXTENDED +#undef CONFIG_SERIAL_NONSTANDARD +#undef CONFIG_UNIX98_PTYS + +/* +* I2C support +*/ +#undef CONFIG_I2C + +/* +* Mice +*/ +#undef CONFIG_BUSMOUSE +#undef CONFIG_MOUSE + +/* +* Joysticks +*/ +#undef CONFIG_INPUT_GAMEPORT +#undef CONFIG_QIC02_TAPE + +/* +* Watchdog Cards +*/ +#undef CONFIG_WATCHDOG +#undef CONFIG_INTEL_RNG +#undef CONFIG_NVRAM +#undef CONFIG_RTC +#undef CONFIG_DTLK +#undef CONFIG_R3964 +#undef CONFIG_APPLICOM + +/* +* Ftape, the floppy tape device driver +*/ +#undef CONFIG_FTAPE +#undef CONFIG_AGP +#undef CONFIG_DRM + +/* +* Multimedia devices +*/ +#undef CONFIG_VIDEO_DEV + +/* +* File systems +*/ +#undef CONFIG_QUOTA +#undef CONFIG_AUTOFS_FS +#undef CONFIG_AUTOFS4_FS +#undef CONFIG_REISERFS_FS +#undef CONFIG_REISERFS_CHECK +#undef CONFIG_REISERFS_PROC_INFO +#undef CONFIG_ADFS_FS +#undef CONFIG_ADFS_FS_RW +#undef CONFIG_AFFS_FS +#undef CONFIG_HFS_FS +#undef CONFIG_BFS_FS +#undef CONFIG_EXT3_FS +#undef CONFIG_JBD +#undef CONFIG_JBD_DEBUG +#undef CONFIG_FAT_FS +#undef CONFIG_MSDOS_FS +#undef CONFIG_UMSDOS_FS +#undef CONFIG_VFAT_FS +#undef CONFIG_EFS_FS +#define CONFIG_JFFS_FS 1 +#define CONFIG_JFFS_FS_VERBOSE (0) +#undef CONFIG_JFFS_PROC_FS +#define CONFIG_JFFS2_FS 1 +#define CONFIG_JFFS2_FS_DEBUG (0) +#undef CONFIG_CRAMFS +#undef CONFIG_TMPFS +#undef CONFIG_RAMFS +#undef CONFIG_ISO9660_FS +#undef CONFIG_JOLIET +#undef CONFIG_ZISOFS +#define CONFIG_MINIX_FS 1 +#undef CONFIG_VXFS_FS +#undef CONFIG_NTFS_FS +#undef CONFIG_NTFS_RW +#undef CONFIG_HPFS_FS +#define CONFIG_PROC_FS 1 +#undef CONFIG_DEVFS_FS +#undef CONFIG_DEVFS_MOUNT +#undef CONFIG_DEVFS_DEBUG +#undef CONFIG_DEVPTS_FS +#undef CONFIG_QNX4FS_FS +#undef CONFIG_QNX4FS_RW +#undef CONFIG_ROMFS_FS +#define CONFIG_EXT2_FS 1 +#undef CONFIG_SYSV_FS +#undef CONFIG_UDF_FS +#undef CONFIG_UDF_RW +#undef CONFIG_UFS_FS +#undef CONFIG_UFS_FS_WRITE + +/* +* Network File Systems +*/ +#undef CONFIG_CODA_FS +#undef CONFIG_INTERMEZZO_FS +#define CONFIG_NFS_FS 1 +#undef CONFIG_NFS_V3 +#define CONFIG_ROOT_NFS 1 +#undef CONFIG_NFSD +#undef CONFIG_NFSD_V3 +#define CONFIG_SUNRPC 1 +#define CONFIG_LOCKD 1 +#undef CONFIG_SMB_FS +#undef CONFIG_NCP_FS +#undef CONFIG_NCPFS_PACKET_SIGNING +#undef CONFIG_NCPFS_IOCTL_LOCKING +#undef CONFIG_NCPFS_STRONG +#undef CONFIG_NCPFS_NFS_NS +#undef CONFIG_NCPFS_OS2_NS +#undef CONFIG_NCPFS_SMALLDOS +#undef CONFIG_NCPFS_NLS +#undef CONFIG_NCPFS_EXTRAS +#undef CONFIG_ZISOFS_FS +#undef CONFIG_ZLIB_FS_INFLATE + +/* +* Partition Types +*/ +#undef CONFIG_PARTITION_ADVANCED +#define CONFIG_MSDOS_PARTITION 1 +#undef CONFIG_SMB_NLS +#undef CONFIG_NLS + +/* +* Sound +*/ +#undef CONFIG_SOUND + +/* +* MPC8260 Communication Options +*/ +#undef CONFIG_SCC_ENET +#define CONFIG_FEC_ENET 1 +#undef CONFIG_FCC1_ENET +#undef CONFIG_FCC2_ENET +#define CONFIG_FCC3_ENET 1 + +/* +* MPC8260 serial options +*/ +#define CONFIG_SMC2_UART 1 +#undef CONFIG_ALTSMC2 +#define CONFIG_CONS_SMC2 1 + +/* +* USB support +*/ +#undef CONFIG_USB +#undef CONFIG_USB_UHCI +#undef CONFIG_USB_UHCI_ALT +#undef CONFIG_USB_OHCI +#undef CONFIG_USB_AUDIO +#undef CONFIG_USB_BLUETOOTH +#undef CONFIG_USB_STORAGE +#undef CONFIG_USB_STORAGE_DEBUG +#undef CONFIG_USB_STORAGE_DATAFAB +#undef CONFIG_USB_STORAGE_FREECOM +#undef CONFIG_USB_STORAGE_ISD200 +#undef CONFIG_USB_STORAGE_DPCM +#undef CONFIG_USB_STORAGE_HP8200e +#undef CONFIG_USB_STORAGE_SDDR09 +#undef CONFIG_USB_STORAGE_JUMPSHOT +#undef CONFIG_USB_ACM +#undef CONFIG_USB_PRINTER +#undef CONFIG_USB_DC2XX +#undef CONFIG_USB_MDC800 +#undef CONFIG_USB_SCANNER +#undef CONFIG_USB_MICROTEK +#undef CONFIG_USB_HPUSBSCSI +#undef CONFIG_USB_PEGASUS +#undef CONFIG_USB_KAWETH +#undef CONFIG_USB_CATC +#undef CONFIG_USB_CDCETHER +#undef CONFIG_USB_USBNET +#undef CONFIG_USB_USS720 + +/* +* USB Serial Converter support +*/ +#undef CONFIG_USB_SERIAL +#undef CONFIG_USB_SERIAL_GENERIC +#undef CONFIG_USB_SERIAL_BELKIN +#undef CONFIG_USB_SERIAL_WHITEHEAT +#undef CONFIG_USB_SERIAL_DIGI_ACCELEPORT +#undef CONFIG_USB_SERIAL_EMPEG +#undef CONFIG_USB_SERIAL_FTDI_SIO +#undef CONFIG_USB_SERIAL_VISOR +#undef CONFIG_USB_SERIAL_IR +#undef CONFIG_USB_SERIAL_EDGEPORT +#undef CONFIG_USB_SERIAL_KEYSPAN_PDA +#undef CONFIG_USB_SERIAL_KEYSPAN +#undef CONFIG_USB_SERIAL_KEYSPAN_USA28 +#undef CONFIG_USB_SERIAL_KEYSPAN_USA28X +#undef CONFIG_USB_SERIAL_KEYSPAN_USA28XA +#undef CONFIG_USB_SERIAL_KEYSPAN_USA28XB +#undef CONFIG_USB_SERIAL_KEYSPAN_USA19 +#undef CONFIG_USB_SERIAL_KEYSPAN_USA18X +#undef CONFIG_USB_SERIAL_KEYSPAN_USA19W +#undef CONFIG_USB_SERIAL_KEYSPAN_USA49W +#undef CONFIG_USB_SERIAL_MCT_U232 +#undef CONFIG_USB_SERIAL_PL2303 +#undef CONFIG_USB_SERIAL_CYBERJACK +#undef CONFIG_USB_SERIAL_XIRCOM +#undef CONFIG_USB_SERIAL_OMNINET +#undef CONFIG_USB_RIO500 + +/* +* Bluetooth support +*/ +#undef CONFIG_BLUEZ + +/* +* Kernel hacking +*/ +#undef CONFIG_MAGIC_SYSRQ +#undef CONFIG_KGDB +#undef CONFIG_XMON
include/linux/compile.h +6 -0
@@ -0,0 +1,6 @@ +#define UTS_VERSION "#92 Tue Dec 18 14:25:33 PST 2001" +#define LINUX_COMPILE_TIME "14:25:33" +#define LINUX_COMPILE_BY "awozniak" +#define LINUX_COMPILE_HOST "rangers.comdev.cc" +#define LINUX_COMPILE_DOMAIN "comdev.cc" +#define LINUX_COMPILER "gcc version 2.95.3 20010315 (release)"
include/linux/mtd/cfi.h +65 -7
168 lines not on this page · raw message
include/linux/mtd/cfi_endian.h +6 -0
@@ -30,22 +30,28 @@#define cfi8_to_cpu (x) (x)#define cpu_to_cfi16 (x) cpu_to_le16(x)#define cpu_to_cfi32 (x) cpu_to_le32(x) +#define cpu_to_cfi64 (x) cpu_to_le64(x)#define cfi16_to_cpu (x) le16_to_cpu(x)#define cfi32_to_cpu (x) le32_to_cpu(x) +#define cfi64_to_cpu (x) le64_to_cpu(x)#elif defined (CFI_BIG_ENDIAN )#define cpu_to_cfi8 (x) (x)#define cfi8_to_cpu (x) (x)#define cpu_to_cfi16 (x) cpu_to_be16(x)#define cpu_to_cfi32 (x) cpu_to_be32(x) +#define cpu_to_cfi64 (x) cpu_to_be64(x)#define cfi16_to_cpu (x) be16_to_cpu(x)#define cfi32_to_cpu (x) be32_to_cpu(x) +#define cfi64_to_cpu (x) be64_to_cpu(x)#elif defined (CFI_HOST_ENDIAN )#define cpu_to_cfi8 (x) (x)#define cfi8_to_cpu (x) (x)#define cpu_to_cfi16 (x) (x)#define cpu_to_cfi32 (x) (x) +#define cpu_to_cfi64 (x) (x)#define cfi16_to_cpu (x) (x)#define cfi32_to_cpu (x) (x) +#define cfi64_to_cpu (x) (x)#else #error No CFI endianness defined#endif
include/linux/mtd/map.h +2 -0
@@ -33,6 +33,7 @@__u8 (*read8)(struct map_info *,unsigned long );__u16 (*read16)(struct map_info *,unsigned long );__u32 (*read32)(struct map_info *,unsigned long ); +__u64 (*read64)(struct map_info *,unsigned long );/* If it returned a 'long' I'd call it readl. * It doesn't. * I won't.
@@ -42,6 +43,7 @@void (*write8)(struct map_info *,__u8 ,unsigned long );void (*write16)(struct map_info *,__u16 ,unsigned long );void (*write32)(struct map_info *,__u32 ,unsigned long ); +void (*write64)(struct map_info *,__u64 ,unsigned long );void (*copy_to)(struct map_info *,unsigned long ,const void *,ssize_t );void (*set_vpp)(struct map_info *,int );
include/linux/version.h +3 -0
@@ -0,0 +1,3 @@ +#define UTS_RELEASE "2.4.16" +#define LINUX_VERSION_CODE 132112 +#define KERNEL_VERSION (a,b,c) (((a) << 16) + ((b) << 8) + (c))
drivers/mtd/chips/Config.in +2 -0
@@ -31,6 +31,7 @@ bool ' Support 8-bit buswidth' CONFIG_MTD_CFI_B1 bool ' Support 16-bit buswidth' CONFIG_MTD_CFI_B2 bool ' Support 32-bit buswidth' CONFIG_MTD_CFI_B4 + bool ' Support 64-bit buswidth' CONFIG_MTD_CFI_B8 if [ "$CONFIG_MTD_CFI_B1" = "y" ]; then define_bool CONFIG_MTD_CFI_I1 y else
@@ -38,6 +39,7 @@ fi bool ' Support 2-chip flash interleave' CONFIG_MTD_CFI_I2 bool ' Support 4-chip flash interleave' CONFIG_MTD_CFI_I4 + bool ' Support 8-chip flash interleave' CONFIG_MTD_CFI_I8 fi fi fi
drivers/mtd/chips/cfi_cmdset_0001.c +39 -25
221 lines not on this page · raw message
drivers/mtd/chips/cfi_probe.c +1 -1
@@ -18,7 +18,7 @@#include <linux/mtd/cfi.h> #include <linux/mtd/gen_probe.h> -//#define DEBUG_CFI +#define DEBUG_CFI #ifdef DEBUG_CFIstatic void print_cfi_ident (struct cfi_ident *);
drivers/mtd/chips/gen_probe.c +69 -0
81 lines not on this page · raw message
drivers/mtd/maps/comdev_np.c +22 -0
@@ -0,0 +1,22 @@ +static struct mtd_partition partition_info[] = +{ + { + name:"SBC-GXx flash boot partition" , + offset:0 , + size:BOOT_PARTITION_SIZE_KiB *1024 + }, + { + name:"SBC-GXx flash data partition" , + offset:BOOT_PARTITION_SIZE_KiB *1024 , + size:(DATA_PARTITION_SIZE_KiB) *1024 + }, + { + name:"SBC-GXx flash application partition" , + offset:(BOOT_PARTITION_SIZE_KiB + DATA_PARTITION_SIZE_KiB) *1024 + } +}; + +#define NUM_PARTITIONS (sizeof(partition_info) / sizeof(partition_info[0])) + +/* Create MTD devices for each partition. */ +add_mtd_partitions (all_mtd, partition_info,NUM_PARTITIONS );
drivers/mtd/maps/physmap.c +69 -0
103 lines not on this page · raw message
Quoted 2 lines · [email protected] said:
I've got a 64 bit wide flash consisting of eight 8bit wide chips. Here's a patch against the 2.4.16 kernel
I'm a little concerned about the following bit - gcc is fairly crap at dealing with 64-bit datatypes. I'd prefer to do that only if it's necessary. Can we define a cfi_busword type which is only as big as we need
- so it's only a __u64 if CONFIG_MTD_CFI_B8 is set?
@@ -337,9 +393,9 @@
*/
static inline __u32 cfi_send_gen_cmd(u_char cmd, __u32 cmd_addr, __u32 base,
struct map_info *map, struct cfi_private *cfi,
- int type, __u32 *prev_val)
+ int type, __u64 *prev_val)
{
- __u32 val;
+ __u64 val;
__u32 addr = base + cfi_build_cmd_addr(cmd_addr, CFIDEV_INTERLEAVE, type);
val = cfi_build_cmd(cmd, map, cfi);
--
dwmw2
Quoted 11 lines · David Woodhouse
Quoted 2 lines · [email protected] said:
I've got a 64 bit wide flash consisting of eight 8bit wide chips. Here's a patch against the 2.4.16 kernel
I'm a little concerned about the following bit - gcc is fairly crap at dealing with 64-bit datatypes. I'd prefer to do that only if it's necessary. Can we define a
cfi_buswordtype which is only as big as we need
- so it's only a__u64ifCONFIG_MTD_CFI_B8is set?include/linux/mtd/cfi.h +0
-0@@ -337,9 +393,9 @@*/
include/linux/mtd/cfi.h line 401
Quoted 10 lines
include/linux/mtd/cfi.h +2
-2static inline __u32 cfi_send_gen_cmd (u_char cmd,__u32 cmd_addr,__u32 base,struct map_info *map,struct cfi_private *cfi, -int type,__u32 *prev_val) +int type,__u64 *prev_val) { -__u32 val; +__u64 val;__u32 addr = base +cfi_build_cmd_addr (cmd_addr,CFIDEV_INTERLEAVE , type); val =cfi_build_cmd (cmd, map, cfi);
That's fine with me. I'll release a patch later today or tomorrow. =)
--Adam
Signature · 4 lines
Adam Wozniak (KG6GZR) COM DEV Wireless - Digital and Software Systems [email protected] 3450 Broad St. 107, San Luis Obispo, CA 93401 http://www.comdev.cc Voice: (805) 544-1089 Fax: (805) 544-2055
Quoted 9 lines · David Woodhouse
Quoted 2 lines · [email protected] said:
I've got a 64 bit wide flash consisting of eight 8bit wide chips. Here's a patch against the 2.4.16 kernel
I'm a little concerned about the following bit - gcc is fairly crap at dealing with 64-bit datatypes. I'd prefer to do that only if it's necessary. Can we define a
cfi_buswordtype which is only as big as we need
- so it's only a__u64ifCONFIG_MTD_CFI_B8is set?
Here's a new patch.
cfi.h has the following in it (paraphrased and indented for readablity):
#ifndef CONFIG_MTD_CFI_GEOMETRY
/* we don't know what we'll get, so we pick the largest possible here */ typedef __u64 cfi_word;
#else
/* pick the largest necessary */
#ifdef CONFIG_MTD_CFI_B8
typedef __u64 cfi_word;
#else /* CONFIG_MTD_CFI_B8 */
#ifdef CONFIG_MTD_CFI_B4
typedef __u32 cfi_word;
#else /* CONFIG_MTD_CFI_B4 */
#ifdef CONFIG_MTD_CFI_B2
typedef __u16 cfi_word;
#else /* CONFIG_MTD_CFI_B2 */
#ifdef CONFIG_MTD_CFI_B1
typedef __u8 cfi_word;
#else /* CONFIG_MTD_CFI_B1 */
#error You must specify a bus width
#endif /* CONFIG_MTD_CFI_B1 */
#endif /* CONFIG_MTD_CFI_B2 */ #endif /* CONFIG_MTD_CFI_B4 */
#endif /* CONFIG_MTD_CFI_B8 */
#endif
Signature · 4 lines
Adam Wozniak (KG6GZR) COM DEV Wireless - Digital and Software Systems [email protected] 3450 Broad St. 107, San Luis Obispo, CA 93401 http://www.comdev.cc Voice: (805) 544-1089 Fax: (805) 544-2055
include/linux/mtd/cfi.h +87 -7
@@ -28,10 +28,15 @@#define CFIDEV_INTERLEAVE_1 (1)#define CFIDEV_INTERLEAVE_2 (2)#define CFIDEV_INTERLEAVE_4 (4) +#define CFIDEV_INTERLEAVE_8 (8)#define CFIDEV_BUSWIDTH_1 (1)#define CFIDEV_BUSWIDTH_2 (2)#define CFIDEV_BUSWIDTH_4 (4) +#define CFIDEV_BUSWIDTH_8 (8) + +/* we don't know what we'll get, so we pick the largest possible here */ +typedef __u64 cfi_word ;#else
@@ -44,6 +49,9 @@#ifdef CONFIG_MTD_CFI_I4 #define CFIDEV_INTERLEAVE_4 (4)#endif +#ifdef CONFIG_MTD_CFI_I8 +#define CFIDEV_INTERLEAVE_8 (8) +#endif #ifdef CONFIG_MTD_CFI_B1 #define CFIDEV_BUSWIDTH_1 (1)
@@ -54,6 +62,28 @@#ifdef CONFIG_MTD_CFI_B4 #define CFIDEV_BUSWIDTH_4 (4)#endif +#ifdef CONFIG_MTD_CFI_B8 +#define CFIDEV_BUSWIDTH_8 (8) +#endif + +/* pick the largest necessary */ +#ifdef CONFIG_MTD_CFI_B8 +typedef __u64 cfi_word ; +#else /* CONFIG_MTD_CFI_B8 */ +#ifdef CONFIG_MTD_CFI_B4 +typedef __u32 cfi_word ; +#else /* CONFIG_MTD_CFI_B4 */ +#ifdef CONFIG_MTD_CFI_B2 +typedef __u16 cfi_word ; +#else /* CONFIG_MTD_CFI_B2 */ +#ifdef CONFIG_MTD_CFI_B1 +typedef __u8 cfi_word ; +#else /* CONFIG_MTD_CFI_B1 */ +#error You must specify a bus width +#endif /* CONFIG_MTD_CFI_B1 */ +#endif /* CONFIG_MTD_CFI_B2 */ +#endif /* CONFIG_MTD_CFI_B4 */ +#endif /* CONFIG_MTD_CFI_B8 */ #endif
@@ -61,7 +91,7 @@* The following macros are used to select the code to execute: * cfi_buswidth_is_*() * cfi_interleave_is_*() -* [where * is either 1, 2 or 4] +* [where * is either 1, 2, 4, or 8] * Those macros should be used with 'if' statements. If only one of few * geometry arrangements are selected, they expand to constants thus allowing * the compiler (most of them being 0) to optimize away all the unneeded code,
@@ -105,6 +135,18 @@# define cfi_interleave_is_4 () (0)#endif +#ifdef CFIDEV_INTERLEAVE_8 +# ifdef CFIDEV_INTERLEAVE +# undef CFIDEV_INTERLEAVE +# define CFIDEV_INTERLEAVE (cfi->interleave) +# else +# define CFIDEV_INTERLEAVE CFIDEV_INTERLEAVE_8 +# endif +# define cfi_interleave_is_8 () (CFIDEV_INTERLEAVE == CFIDEV_INTERLEAVE_8) +#else +# define cfi_interleave_is_8 () (0) +#endif +#ifndef CFIDEV_INTERLEAVE #error You must define at least one interleave to support!#endif
@@ -145,6 +187,18 @@# define cfi_buswidth_is_4 () (0)#endif +#ifdef CFIDEV_BUSWIDTH_8 +# ifdef CFIDEV_BUSWIDTH +# undef CFIDEV_BUSWIDTH +# define CFIDEV_BUSWIDTH (map->buswidth) +# else +# define CFIDEV_BUSWIDTH CFIDEV_BUSWIDTH_8 +# endif +# define cfi_buswidth_is_8 () (CFIDEV_BUSWIDTH == CFIDEV_BUSWIDTH_8) +#else +# define cfi_buswidth_is_8 () (0) +#endif +#ifndef CFIDEV_BUSWIDTH #error You must define at least one bus width to support!#endif
@@ -156,6 +210,7 @@#define CFI_DEVICETYPE_X8 (8 / 8)#define CFI_DEVICETYPE_X16 (16 / 8)#define CFI_DEVICETYPE_X32 (32 / 8) +#define CFI_DEVICETYPE_X64 (64 / 8)/* NB: We keep these structures in memory in HOST byteorder, except * where individually noted.
@@ -264,9 +319,9 @@/* * Transforms the CFI command for the given geometry (bus width & interleave. */ -static inline __u32 cfi_build_cmd (u_char cmd,struct map_info *map,struct cfi_private *cfi) +static inline cfi_word cfi_build_cmd (u_char cmd,struct map_info *map,struct cfi_private *cfi) { -__u32 val =0 ; +cfi_word val =0 ;if (cfi_buswidth_is_1 ()) {/* 1 x8 device */
@@ -291,6 +346,25 @@ val = (cmd <<16 ) | cmd; val =cpu_to_cfi32 ((val <<8 ) | val); } + }else if (cfi_buswidth_is_8 ()) { +if (cfi_interleave_is_1 ()) { +/* 1 x64 device in x64 mode */ + val =cpu_to_cfi64 (cmd); + }else if (cfi_interleave_is_2 ()) { +/* 2 x32 device in x32 mode */ + val = cmd; + val =cpu_to_cfi64 ((val <<32 ) | val); + }else if (cfi_interleave_is_4 ()) { +/* 4 (x16, x32 or x64) devices in x16 mode */ + val = (cmd <<16 ) | cmd; + val =cpu_to_cfi64 ((val <<32 ) | val); + }else if (cfi_interleave_is_8 ()) { +/* 8 (x8, x16 or x32) devices in x8 mode */ + val = (cmd <<8 ) | cmd; + val = (val <<16 ) | val; + val = (val <<32 ) | val; + val =cpu_to_cfi64 (val); + } }return val; }
@@ -300,7 +374,7 @@* Read a value according to the bus width. */ -static inline __u32 cfi_read (struct map_info *map,__u32 addr) +static inline cfi_word cfi_read (struct map_info *map,__u32 addr) {if (cfi_buswidth_is_1 ()) {return map->read8 (map, addr);
@@ -308,6 +382,8 @@return map->read16 (map, addr); }else if (cfi_buswidth_is_4 ()) {return map->read32 (map, addr); + }else if (cfi_buswidth_is_8 ()) { +return map->read64 (map, addr); }else {return 0 ; }
@@ -317,7 +393,7 @@* Write a value according to the bus width. */ -static inline void cfi_write (struct map_info *map,__u32 val,__u32 addr) +static inline void cfi_write (struct map_info *map,cfi_word val,__u32 addr) {if (cfi_buswidth_is_1 ()) { map->write8 (map, val, addr);
@@ -325,6 +401,8 @@ map->write16 (map, val, addr); }else if (cfi_buswidth_is_4 ()) { map->write32 (map, val, addr); + }else if (cfi_buswidth_is_8 ()) { + map->write64 (map, val, addr); } }
@@ -337,9 +415,9 @@*/ static inline __u32 cfi_send_gen_cmd (u_char cmd,__u32 cmd_addr,__u32 base,struct map_info *map,struct cfi_private *cfi, -int type,__u32 *prev_val) +int type,cfi_word *prev_val) { -__u32 val; +cfi_word val;__u32 addr = base +cfi_build_cmd_addr (cmd_addr,CFIDEV_INTERLEAVE , type); val =cfi_build_cmd (cmd, map, cfi);
@@ -360,6 +438,8 @@return cfi16_to_cpu (map->read16 (map, addr)); }else if (cfi_buswidth_is_4 ()) {return cfi32_to_cpu (map->read32 (map, addr)); + }else if (cfi_buswidth_is_8 ()) { +return cfi64_to_cpu (map->read64 (map, addr)); }else {return 0 ; }
include/linux/mtd/cfi_endian.h +6 -0
@@ -30,22 +30,28 @@#define cfi8_to_cpu (x) (x)#define cpu_to_cfi16 (x) cpu_to_le16(x)#define cpu_to_cfi32 (x) cpu_to_le32(x) +#define cpu_to_cfi64 (x) cpu_to_le64(x)#define cfi16_to_cpu (x) le16_to_cpu(x)#define cfi32_to_cpu (x) le32_to_cpu(x) +#define cfi64_to_cpu (x) le64_to_cpu(x)#elif defined (CFI_BIG_ENDIAN )#define cpu_to_cfi8 (x) (x)#define cfi8_to_cpu (x) (x)#define cpu_to_cfi16 (x) cpu_to_be16(x)#define cpu_to_cfi32 (x) cpu_to_be32(x) +#define cpu_to_cfi64 (x) cpu_to_be64(x)#define cfi16_to_cpu (x) be16_to_cpu(x)#define cfi32_to_cpu (x) be32_to_cpu(x) +#define cfi64_to_cpu (x) be64_to_cpu(x)#elif defined (CFI_HOST_ENDIAN )#define cpu_to_cfi8 (x) (x)#define cfi8_to_cpu (x) (x)#define cpu_to_cfi16 (x) (x)#define cpu_to_cfi32 (x) (x) +#define cpu_to_cfi64 (x) (x)#define cfi16_to_cpu (x) (x)#define cfi32_to_cpu (x) (x) +#define cfi64_to_cpu (x) (x)#else #error No CFI endianness defined#endif
include/linux/mtd/map.h +2 -0
@@ -33,6 +33,7 @@__u8 (*read8)(struct map_info *,unsigned long );__u16 (*read16)(struct map_info *,unsigned long );__u32 (*read32)(struct map_info *,unsigned long ); +__u64 (*read64)(struct map_info *,unsigned long );/* If it returned a 'long' I'd call it readl. * It doesn't. * I won't.
@@ -42,6 +43,7 @@void (*write8)(struct map_info *,__u8 ,unsigned long );void (*write16)(struct map_info *,__u16 ,unsigned long );void (*write32)(struct map_info *,__u32 ,unsigned long ); +void (*write64)(struct map_info *,__u64 ,unsigned long );void (*copy_to)(struct map_info *,unsigned long ,const void *,ssize_t );void (*set_vpp)(struct map_info *,int );
Hi!
Quoted 6 lines
I've got a 64 bit wide flash consisting of eight 8bit wide chips. Here's a patch against the 2.4.16 kernel
I think I've added enough code to support all 64 bit wide configurations,
but somebody whould probably check me on it.
After merging with current cvs again, I found an issue with your code and my kernel:
Quoted 12 lines
diff -urbBN --exclude=.*depend --exclude=*.flags --exclude=*.o
linux-original/drivers/mtd/maps/physmap.clinux/drivers/mtd/maps/physmap.cdrivers/mtd/maps/physmap.c +1
-0@@ -10,6 +10,7 @@#include <asm/io.h> #include <linux/mtd/mtd.h> #include <linux/mtd/map.h> +#include <linux/mtd/partitions.h> #include <linux/config.h>
drivers/mtd/maps/physmap.c line 41
Quoted 7 lines
drivers/mtd/maps/physmap.c +4
-0@@ -34,6 +35,11 @@return __raw_readl (map->map_priv_1 + ofs); } +__u64 physmap_read64 (struct map_info *map,unsigned long ofs) +{ +return __raw_readll (map->map_priv_1 + ofs); +}
__raw_readll is not defined in our kernel (2.4.2 based). Worse, I couldn't find that definition in the 2.4.17 kernel, either. Is this specific to your private kernel?
Joern
PS: The same applies to __raw_writell, of course.
Quoted 3 lines · [email protected] said:
__raw_readllis not defined in our kernel (2.4.2 based). Worse, I
couldn't find that definition in the 2.4.17 kernel, either. Is this specific to your private kernel?
I fixed this yesterday, for most people at least. The 64-bit stuff was being included even if you didn't explicitly turn it on. Now you do have to turn it on - and if you do, you're expected to provide a read64/write64 that works somehow.
--
dwmw2
Hi!
Quoted 4 lines
I fixed this yesterday, for most people at least. The 64-bit stuff was being included even if you didn't explicitly turn it on. Now you do have to turn it on - and if you do, you're expected to provide a read64/write64 that works somehow.
You are incredible! Solving a problem, before it gets reported! :-)
Jörn
Signature · 3 lines
Any tool should be useful in the expected way, but a truly great tool lends itself to uses you never expected. -- Eric Raymond in "The cathedral and the bazaar"
I have another version of 64-bit bus support which does not change any of the variable types and only changes one function prototype. It probably is not as fast as this 64-bit version, assuming that it is really doing 64-bit bus accesses, but it is a very low impact solution.
Quoted 54 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]]On Behalf Of Jörn Engel
Sent: Thursday, February 14, 2002 4:32 AM
To: Adam Wozniak
Cc: [email protected]
Subject: Re: patch for 64 bit wide flashHi!
Quoted 6 lines
I've got a 64 bit wide flash consisting of eight 8bit wide chips. Here's a patch against the 2.4.16 kernel
I think I've added enough code to support all 64 bit wide configurations,
but somebody whould probably check me on it.After merging with current cvs again, I found an issue with your code and my kernel:
Quoted 1 line
diff -urbBN --exclude=.*depend --exclude=*.flags --exclude=*.o
linux-original/drivers/mtd/maps/physmap.clinux/drivers/mtd/maps/physmap.cQuoted 1 line
---
linux-original/drivers/mtd/maps/physmap.cThu Oct 415:14:59 2001
Quoted 10 lines
+++
linux/drivers/mtd/maps/physmap.cTue Dec 18 14:06:06 2001drivers/mtd/maps/physmap.c +1
-0@@ -10,6 +10,7 @@#include <asm/io.h> #include <linux/mtd/mtd.h> #include <linux/mtd/map.h> +#include <linux/mtd/partitions.h> #include <linux/config.h> drivers/mtd/maps/physmap.c line 41
Quoted 7 lines
drivers/mtd/maps/physmap.c +4
-0@@ -34,6 +35,11 @@return __raw_readl (map->map_priv_1 + ofs); } +__u64 physmap_read64 (struct map_info *map,unsigned long ofs) +{ +return __raw_readll (map->map_priv_1 + ofs); +}
__raw_readllis not defined in our kernel (2.4.2 based). Worse, I couldn't find that definition in the 2.4.17 kernel, either. Is this specific to your private kernel?Joern
PS: The same applies to
__raw_writell, of course.______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
in my physmap.c (I should probably check this in):
__u64 physmap_read64(struct map_info *map, unsigned long ofs) {
#ifndef __raw_readll
#error Your architecture needs a __raw_readll in asm/io.h
#endif
return __raw_readll(map->map_priv_1 + ofs);
}void physmap_write64(struct map_info *map, __u64 d, unsigned long adr) {
#ifndef __raw_writell
#error Your architecture needs a __raw_writell in asm/io.h
#endif
__raw_writell(d, map->map_priv_1 + adr);
mb();
}from my include/asm/io.h (this will vary from architecture to architecture)
#define __raw_readll(addr) (*(volatile unsigned long long *)(addr))
#define __raw_writell(v, addr) (*(volatile unsigned long long *)(addr) = (v))
(right next to __raw_writel and all those guys)
Quoted 5 lines · Allen Curtis
I have another version of 64-bit bus support which does not change any of the variable types and only changes one function prototype. It probably is not as fast as this 64-bit version, assuming that it is really doing 64-bit bus accesses, but it is a very low impact solution.
Whether or not you really do 64 bit bus accesses is going to be compiler dependant. If it does, then everything is good. If it doesn't, it most likely won't be any worse than anything you come up with by hand. IMHO it would be a shame to break this for people who have tools which really do 64 bit accesses on architectures that can benefit from it.
--Adam
Signature · 4 lines
Adam Wozniak (KG6GZR) COM DEV Wireless - Digital and Software Systems [email protected] 3450 Broad St. 107, San Luis Obispo, CA 93401 http://www.comdev.cc Voice: (805) 544-1089 Fax: (805) 544-2055
Hi!
Quoted 9 lines
in my
physmap.c(I should probably check this in):
__u64physmap_read64(struct map_info *map, unsigned long ofs){
#ifndef__raw_readll
#error Your architecture needs a__raw_readllinasm/io.h#endif return __raw_readll(map->map_priv_1 + ofs); }
It is already checked in. As a result, I hit your #error and was really happy. ;-)
David said, he fixed that, but I haven't checked yet.
Quoted 8 lines
#define
__raw_readll(addr)(*(volatile unsigned long long*)(addr))
#define__raw_writell(v, addr)(*(volatile unsigned long long*)(addr) = (v))Quoted 4 lines
I have another version of 64-bit bus support which does not change any of the variable types and only changes one function prototype. It probably is not as fast as this 64-bit version, assuming that it is really doing 64-bit bus accesses, but it is a very low impact solution.
Quoted 5 lines
Whether or not you really do 64 bit bus accesses is going to be compiler dependant. If it does, then everything is good. If it doesn't, it most likely won't be any worse than anything you come up with by hand. IMHO it would be a shame to break this for people who have tools which really do 64 bit accesses on architectures that can benefit from it.
I agree. This solution appears quite sound and solid. It only has to have a little more testing, as there is propably only one user, to this moment. Adam, count me in, as soon as I find a little free time.
Signature · 3 lines
Remember that not getting what you want is sometimes a wonderful stroke of luck. -- reputely from the Dalai Lama, unverified