This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: Linux
I want to migrate from kernel 3.0.3 to latest PROCESSOR-SDK. I've build linux kernel, but it seems there is no longer support of option "Direct char device access to MTD devices" in kernel 4.14.67. There are no /dev/mtdX devices.
Here is my device tree fragment:
&aemif { pinctrl-names = "default"; pinctrl-0 = <&nand_pins>; status = "okay"; cs3 { #address-cells = <2>; #size-cells = <1>; clock-ranges; ranges; ti,cs-chipselect = <3>; nand@2000000,0 { compatible = "ti,davinci-nand"; #address-cells = <1>; #size-cells = <1>; reg = <0 0x02000000 0x02000000 1 0x00000000 0x00008000>; ti,davinci-chipselect = <1>; ti,davinci-mask-ale = <0>; ti,davinci-mask-cle = <0>; ti,davinci-mask-chipsel = <0>; ti,davinci-nand-buswidth = <8>; ti,davinci-ecc-mode = "hw"; ti,davinci-ecc-bits = <4>; ti,davinci-nand-use-bbt; partitions { compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; partition@0 { label = "u-boot"; reg = <0 0x100000>; }; partition@0x100000 { label = "u-boot env"; reg = <0x100000 0x020000>; }; partition@0x120000 { label = "kernel"; reg = <0x120000 0x400000>; }; partition@0x520000 { label = "fdt"; reg = <0x520000 0x010000>; }; partition@0x530000 { label = "filesystem"; reg = <0x530000 0>; }; }; }; }; };
I already set all of this to =y:
# # Bus devices # # CONFIG_BRCMSTB_GISB_ARB is not set # CONFIG_SIMPLE_PM_BUS is not set # CONFIG_VEXPRESS_CONFIG is not set CONFIG_DA8XX_MSTPRI=y # CONFIG_CONNECTOR is not set CONFIG_MTD=y # CONFIG_MTD_TESTS is not set # CONFIG_MTD_REDBOOT_PARTS is not set # CONFIG_MTD_CMDLINE_PARTS is not set # CONFIG_MTD_AFS_PARTS is not set # CONFIG_MTD_OF_PARTS is not set # CONFIG_MTD_AR7_PARTS is not set # # Partition parsers # # # User Modules And Translation Layers # CONFIG_MTD_BLKDEVS=y CONFIG_MTD_BLOCK=y # CONFIG_FTL is not set # CONFIG_NFTL is not set # CONFIG_INFTL is not set # CONFIG_RFD_FTL is not set # CONFIG_SSFDC is not set # CONFIG_SM_FTL is not set # CONFIG_MTD_OOPS is not set # CONFIG_MTD_PARTITIONED_MASTER is not set # # RAM/ROM/Flash chip drivers # # CONFIG_MTD_CFI is not set # CONFIG_MTD_JEDECPROBE is not set CONFIG_MTD_MAP_BANK_WIDTH_1=y CONFIG_MTD_MAP_BANK_WIDTH_2=y CONFIG_MTD_MAP_BANK_WIDTH_4=y # CONFIG_MTD_MAP_BANK_WIDTH_8 is not set # CONFIG_MTD_MAP_BANK_WIDTH_16 is not set # CONFIG_MTD_MAP_BANK_WIDTH_32 is not set CONFIG_MTD_CFI_I1=y CONFIG_MTD_CFI_I2=y # CONFIG_MTD_CFI_I4 is not set # CONFIG_MTD_CFI_I8 is not set # CONFIG_MTD_RAM is not set # CONFIG_MTD_ROM is not set # CONFIG_MTD_ABSENT is not set # # Mapping drivers for chip access # # CONFIG_MTD_COMPLEX_MAPPINGS is not set # CONFIG_MTD_PLATRAM is not set # # Self-contained MTD device drivers # # CONFIG_MTD_DATAFLASH is not set # CONFIG_MTD_MCHP23K256 is not set # CONFIG_MTD_SST25L is not set # CONFIG_MTD_SLRAM is not set # CONFIG_MTD_PHRAM is not set # CONFIG_MTD_MTDRAM is not set # CONFIG_MTD_BLOCK2MTD is not set # # Disk-On-Chip Device Drivers # # CONFIG_MTD_DOCG3 is not set CONFIG_MTD_NAND_ECC=y # CONFIG_MTD_NAND_ECC_SMC is not set CONFIG_MTD_NAND=y # CONFIG_MTD_NAND_ECC_BCH is not set # CONFIG_MTD_SM_COMMON is not set # CONFIG_MTD_NAND_DENALI_DT is not set # CONFIG_MTD_NAND_GPIO is not set # CONFIG_MTD_NAND_OMAP_BCH_BUILD is not set # CONFIG_MTD_NAND_DISKONCHIP is not set # CONFIG_MTD_NAND_DOCG4 is not set # CONFIG_MTD_NAND_NANDSIM is not set # CONFIG_MTD_NAND_BRCMNAND is not set # CONFIG_MTD_NAND_PLATFORM is not set CONFIG_MTD_NAND_DAVINCI=y # CONFIG_MTD_ONENAND is not set
omapl138-lcdk-linux-sdk-src-05.01.00.11
Bootlog:
Starting kernel ... Booting Linux on physical CPU 0x0 Linux version 4.14.67+ (grip@grip-VirtualBox) (gcc version 4.5.3 20110311 (prerelease) (GCC)) #30 PREEMPT Wed Jan 16 12:03:22 MSK 2019 CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f CPU: VIVT data cache, VIVT instruction cache OF: fdt: Machine model: OMAP-L138 FOX2 Memory policy: Data cache writeback DaVinci da850/omap-l138/am18x variant 0x1 Built 1 zonelists, mobility grouping on. Total pages: 24288 Kernel command line: console=ttyS1,115200n8 root=/dev/mmcblk0p2 rw rootwait ip=off mem=32M@0xc0000000 mem=64M@0xc4000000 PID hash table entries: 512 (order: -1, 2048 bytes) Dentry cache hash table entries: 16384 (order: 4, 65536 bytes) Inode-cache hash table entries: 8192 (order: 3, 32768 bytes) Memory: 86692K/98304K available (7493K kernel code, 354K rwdata, 2280K rodata, 220K init, 157K bss, 11612K reserved, 0K cma-reserved) Virtual kernel memory layout: vector : 0xffff0000 - 0xffff1000 ( 4 kB) fixmap : 0xffc00000 - 0xfff00000 (3072 kB) vmalloc : 0xc8800000 - 0xff800000 ( 880 MB) lowmem : 0xc0000000 - 0xc8000000 ( 128 MB) modules : 0xbf000000 - 0xc0000000 ( 16 MB) .text : 0xc0008000 - 0xc0759a78 (7495 kB) .init : 0xc0995000 - 0xc09cc000 ( 220 kB) .data : 0xc09cc000 - 0xc0a24880 ( 355 kB) .bss : 0xc0a24880 - 0xc0a4c054 ( 158 kB) SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 Preemptible hierarchical RCU implementation. Tasks RCU enabled. NR_IRQS: 245 clocksource: timer0_1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns Console: colour dummy device 80x30 Calibrating delay loop... 227.32 BogoMIPS (lpj=1136640) pid_max: default: 32768 minimum: 301 Mount-cache hash table entries: 1024 (order: 0, 4096 bytes) Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes) CPU: Testing write buffer coherency: ok Setting up static identity map for 0xc0008400 - 0xc0008458 Hierarchical SRCU implementation. devtmpfs: initialized random: get_random_u32 called from bucket_table_alloc+0xac/0x1b4 with crng_init=0 VFP support v0.3: not present clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns futex hash table entries: 256 (order: -1, 3072 bytes) pinctrl core: initialized pinctrl subsystem NET: Registered protocol family 16 DMA: preallocated 256 KiB pool for atomic coherent allocations cpuidle: using governor ladder cpuidle: using governor menu mux: initialized RTC_ALARM mux: Setting register RTC_ALARM mux: PINMUX0 (0x00000000) = 0x80000000 -> 0x20000000 edma 1c00000.edma: memcpy is disabled edma 1c00000.edma: TI EDMA DMA engine driver edma 1e30000.edma: memcpy is disabled edma 1e30000.edma: TI EDMA DMA engine driver SCSI subsystem initialized usbcore: registered new interface driver usbfs usbcore: registered new interface driver hub usbcore: registered new device driver usb i2c_davinci i2c_davinci.1: could not find pctldev for node /soc@1c00000/pinmux@14120/pinmux_i2c0_pins, deferring probe Advanced Linux Sound Architecture Driver Initialized. Bluetooth: Core ver 2.22 NET: Registered protocol family 31 Bluetooth: HCI device and connection manager initialized Bluetooth: HCI socket layer initialized Bluetooth: L2CAP socket layer initialized Bluetooth: SCO socket layer initialized clocksource: Switched to clocksource timer0_1 NET: Registered protocol family 2 TCP established hash table entries: 1024 (order: 0, 4096 bytes) TCP bind hash table entries: 1024 (order: 0, 4096 bytes) TCP: Hash tables configured (established 1024 bind 1024) UDP hash table entries: 256 (order: 0, 4096 bytes) UDP-Lite hash table entries: 256 (order: 0, 4096 bytes) NET: Registered protocol family 1 workingset: timestamp_bits=14 max_order=15 bucket_order=1 jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc. Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251) io scheduler noop registered (default) io scheduler mq-deadline registered io scheduler kyber registered pinctrl-single 1c14120.pinmux: 160 pins at pa fec14120 size 80 Serial: 8250/16550 driver, 10 ports, IRQ sharing disabled console [ttyS1] disabled serial8250.1: ttyS1 at MMIO 0x1d0c000 (irq = 53, base_baud = 9375000) is a TI DA8xx/66AK2x console [ttyS1] enabled serial8250.2: ttyS2 at MMIO 0x1d0d000 (irq = 61, base_baud = 9375000) is a TI DA8xx/66AK2x brd: module loaded spi_davinci spi_davinci.1: Controller at 0xfef0e000 libphy: Fixed MDIO Bus: probed tun: Universal TUN/TAP device driver, 1.6 davinci_mdio davinci_mdio.0: davinci mdio revision 1.5, bus freq 2200000 davinci_mdio davinci_mdio.0: detected phy mask ffffff7f libphy: davinci_mdio.0: probed davinci_mdio davinci_mdio.0: phy[7]: device davinci_mdio.0:07, driver SMSC LAN8710/LAN8720 PPP generic driver version 2.4.2 PPP Deflate Compression module registered usbcore: registered new interface driver carl9170 usbcore: registered new interface driver ar5523 usbcore: registered new interface driver ath10k_usb usbcore: registered new interface driver mt7601u usbcore: registered new interface driver rt2500usb usbcore: registered new interface driver rt73usb usbcore: registered new interface driver rt2800usb usbcore: registered new interface driver rtl8187 usbcore: registered new interface driver rtl8192cu usbcore: registered new interface driver rtl8xxxu ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver ohci-da8xx: DA8XX ohci-da8xx ohci-da8xx: USB Host Controller ohci-da8xx ohci-da8xx: new USB bus registered, assigned bus number 1 ohci-da8xx ohci-da8xx: irq 59, io mem 0x01e25000 usb usb1: New USB device found, idVendor=1d6b, idProduct=0001 usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 usb usb1: Product: USB Host Controller usb usb1: Manufacturer: Linux 4.14.67+ ohci_hcd usb usb1: SerialNumber: ohci-da8xx hub 1-0:1.0: USB hub found hub 1-0:1.0: 1 port detected usbcore: registered new interface driver usb-storage usbcore: registered new interface driver usbserial usbcore: registered new interface driver ftdi_sio usbserial: USB Serial support registered for FTDI USB Serial Device usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 2 usb usb2: New USB device found, idVendor=1d6b, idProduct=0002 usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1 usb usb2: Product: MUSB HDRC host driver usb usb2: Manufacturer: Linux 4.14.67+ musb-hcd usb usb2: SerialNumber: musb-hdrc.1.auto hub 2-0:1.0: USB hub found hub 2-0:1.0: 1 port detected using random self ethernet address using random host ethernet address usb0: HOST MAC 42:da:ca:cd:9a:45 usb0: MAC 02:48:c8:2b:61:32 using random self ethernet address using random host ethernet address g_ether gadget: Ethernet Gadget, version: Memorial Day 2008 g_ether gadget: g_ether ready i2c /dev entries driver Driver for 1-wire Dallas network protocol. davinci-wdt davinci-wdt: heartbeat 60 sec usbcore: registered new interface driver btusb sdhci: Secure Digital Host Controller Interface driver sdhci: Copyright(c) Pierre Ossman davinci_mmc da830-mmc.0: Got CD GPIO davinci_mmc da830-mmc.0: Using DMA, 4-bit mode sdhci-pltfm: SDHCI platform and OF driver helper nf_conntrack version 0.5.0 (2048 buckets, 8192 max) ip_tables: (C) 2000-2006 Netfilter Core Team arp_tables: arp_tables: (C) 2002 David S. Miller NET: Registered protocol family 17 Bluetooth: RFCOMM socket layer initialized Bluetooth: RFCOMM ver 1.11 Bluetooth: BNEP (Ethernet Emulation) ver 1.3 Bluetooth: BNEP socket layer initialized mmc0: host does not support reading read-only switch, assuming write-enable tlv320aic3x-codec 0-0018: 0-0018 supply IOVDD not found, using dummy regulator tlv320aic3x-codec 0-0018: 0-0018 supply DVDD not found, using dummy regulator mmc0: Problem switching card into high-speed mode! mmc0: new SDHC card at address 0001 mmcblk0: mmc0:0001 SD16G 7.45 GiB mmcblk0: p1 p2 tlv320aic3x-codec 0-0018: 0-0018 supply AVDD not found, using dummy regulator tlv320aic3x-codec 0-0018: 0-0018 supply DRVDD not found, using dummy regulator tlv320aic3x-codec 0-0018: Invalid supply voltage(s) AVDD: -22, DVDD: -22 console [netcon0] enabled netconsole: network logging started davinci_emac davinci_emac.1: incompatible machine/device type for reading mac address davinci_emac davinci_emac.1: using random MAC addr: 22:ee:29:e0:f9:e2 hctosys: unable to open rtc device (rtc0) ALSA device list: No soundcards found. EXT4-fs (mmcblk0p2): mounting ext3 file system using the ext4 subsystem random: fast init done EXT4-fs (mmcblk0p2): recovery complete EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null) VFS: Mounted root (ext3 filesystem) on device 179:2. devtmpfs: mounted Freeing unused kernel memory: 220K This architecture does not have kernel memory protection. EXT4-fs (mmcblk0p2): re-mounted. Opts: data=ordered Starting logging: OK Starting watchdog... Initializing random number generator... random: dd: uninitialized urandom read (512 bytes read) done. Starting network... davinci_mdio davinci_mdio.0: resetting idled controller SMSC LAN8710/LAN8720 davinci_mdio.0:07: attached PHY driver [SMSC LAN8710/LAN8720] (mii_bus:phy_addr=davinci_mdio.0:07, irq=POLL) Starting php-fpm done Starting httpd: random: httpd: uninitialized urandom read (8 bytes read) random: httpd: uninitialized urandom read (8 bytes read) random: httpd: uninitialized urandom read (8 bytes read) OK /usr/bin/ssh-keygen: /usr/lib/libcrypto.so.1.0.0: no version information available (required by /usr/bin/ssh-keygen) Starting sshd: /usr/sbin/sshd: /usr/lib/libcrypto.so.1.0.0: no version information available (required by /usr/sbin/sshd) NOHZ: local_softirq_pending 40 OK Starting hostapd... i2c_davinci i2c_davinci.1: RDR IRQ while no data requested i2c_davinci i2c_davinci.1: RDR IRQ while no data requested OK NOHZ: local_softirq_pending 40 Starting dhcpd... OK Starting cron ... done. Starting application... random: crng init done random: 6 urandom warning(s) missed due to ratelimiting syslink: loading out-of-tree module taints kernel. <1>SysLink version : 2.10.08.35 SysLink module created on Date:Jan 16 2019 Time:12:04:19 <1>Trace enabled <1>Trace SetFailureReason enabled fox login:
Thank you, this was the reason, I set CONFIG_TI_AEMIF to y and now see mtd0 in /dev. But I see only:
mtd0
mtd0ro
mtdblock0
Four other mtds are not present. What may be the reason?
Part of my boot log:
davinci_mmc da830-mmc.0: Got CD GPIO davinci_mmc da830-mmc.0: Using DMA, 4-bit mode sdhci-pltfm: SDHCI platform and OF driver helper nand: device found, Manufacturer ID: 0x2c, Chip ID: 0xda nand: Micron MT29F2G08ABAEAH4 nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64 Bad block table not found for chip 0 Bad block table not found for chip 0 Scanning device for bad blocks mmc0: host does not support reading read-only switch, assuming write-enable mmc0: Problem switching card into high-speed mode! mmc0: new SDHC card at address 0001 mmcblk0: mmc0:0001 SD16G 7.45 GiB mmcblk0: p1 p2 Bad block table written to 0x00000ffe0000, version 0x01 Bad block table written to 0x00000ffc0000, version 0x01 davinci_nand davinci-nand.0: controller rev. 2.5 nf_conntrack version 0.5.0 (2048 buckets, 8192 max) ip_tables: (C) 2000-2006 Netfilter Core Team arp_tables: arp_tables: (C) 2002 David S. Miller NET: Registered protocol family 17 Bluetooth: RFCOMM socket layer initialized Bluetooth: RFCOMM ver 1.11
I also try to set in my dt this:
&aemif { pinctrl-names = "default"; pinctrl-0 = <&nand_pins>; status = "okay"; cs3 { #address-cells = <2>; #size-cells = <1>; clock-ranges; ranges; ti,cs-chipselect = <3>; nand@2000000,0 { compatible = "ti,davinci-nand"; #address-cells = <1>; #size-cells = <1>; reg = <0 0x02000000 0x02000000 1 0x00000000 0x00008000>; ti,davinci-chipselect = <1>; ti,davinci-mask-ale = <0>; ti,davinci-mask-cle = <0>; ti,davinci-mask-chipsel = <0>; ti,davinci-nand-buswidth = <8>; ti,davinci-ecc-mode = "hw"; ti,davinci-ecc-bits = <4>; ti,davinci-nand-use-bbt; partition@0 { label = "u-boot"; reg = <0 0x100000>; }; partition@0x100000 { label = "u-boot env"; reg = <0x100000 0x020000>; }; partition@0x120000 { label = "kernel"; reg = <0x120000 0x400000>; }; partition@0x520000 { label = "fdt"; reg = <0x520000 0x010000>; }; partition@0x530000 { label = "filesystem"; reg = <0x530000 0>; }; }; }; };
And this:
&aemif { pinctrl-names = "default"; pinctrl-0 = <&nand_pins>; status = "okay"; cs3 { #address-cells = <2>; #size-cells = <1>; clock-ranges; ranges; ti,cs-chipselect = <3>; nand@2000000,0 { compatible = "ti,davinci-nand"; #address-cells = <1>; #size-cells = <1>; reg = <0 0x02000000 0x02000000 1 0x00000000 0x00008000>; ti,davinci-chipselect = <1>; ti,davinci-mask-ale = <0>; ti,davinci-mask-cle = <0>; ti,davinci-mask-chipsel = <0>; ti,davinci-nand-buswidth = <8>; ti,davinci-ecc-mode = "hw"; ti,davinci-ecc-bits = <4>; ti,davinci-nand-use-bbt; /* * The OMAP-L132/L138 Bootloader doc SPRAB41E reads: * "To boot from NAND Flash, the AIS should be written * to NAND block 1 (NAND block 0 is not used by default)". * The same doc mentions that for ROM "Silicon Revision 2.1", * "Updated NAND boot mode to offer boot from block 0 or block 1". * However the limitaion is left here by default for compatibility * with older silicon and because it needs new boot pin settings * not possible in stock LCDK. */ partitions { compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; partition@0 { label = "u-boot"; reg = <0 0x100000>; }; partition@0x100000 { label = "u-boot env"; reg = <0x100000 0x020000>; }; partition@0x120000 { label = "kernel"; reg = <0x120000 0x400000>; }; partition@0x520000 { label = "fdt"; reg = <0x520000 0x010000>; }; partition@0x530000 { label = "filesystem"; reg = <0x530000 0>; }; }; }; }; };
And there is no difference, only mtd0
I need for any suggestions.. Looks like any changes in partitions node in dt has no effect on mtds list in /dev
# ls /dev | grep mtd
mtd0
mtd0ro
mtdblock0
Should be:
mtd0
mtd0ro
mtd1
mtd1ro
mtd2
mtd2ro
mtdblock0
mtdblock1
mtdblock2
and so on..
AFAIK don't matter how I setup partitions in u-boot, linux looks about partition layout from dt. Am I right?
The reason was that device tree mtd parser was not registered.
Should be CONFIG_MTD_OF_PARTS=y
It set as module in tisdk_omapl138-lcdk_defconfig and not set at all in davinci_all_defconfig and ti_sdk_omapl138_release_defconfig.