Im using SAMA5D28 based custom board.. using linux 4.9.49
We are trying to bring up pwm led interface in linux.
Here are the definitions in the dts file:
pwm0: pwm@f802c000 {
compatible = "atmel,sama5d2-pwm";
reg = <0xf802c000 0x4000>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pwm0_default>;
interrupts = <38 IRQ_TYPE_LEVEL_HIGH 7>;
clocks = <&pwm_clk>;
#pwm-cells = <3>;
status = "okay";
};
pwm0 {
pinctrl_pwm0_default: pwm0_default {
pinmux = <PIN_PB8__PWML3>;
};
};
pwmleds {
compatible = "pwm-leds";
pwmled0 {
label = "sema7:blue:front-left";
max-brightness = <255>;
pwms = <&pwm0 3 16666560 0>;
active-low;
linux,default-trigger = "default-on";
};
}; /* pwmleds */
I'm getting the following error in the linux bootup sequence:
leds_pwm pwmleds: unable to request PWM for sema7:blue:front-left: -517
Here is the full linux bootup messages log:
Could you suggest what would have gone wrong?=> boot
NAND read: device 0 offset 0x200000, size 0x100000
1048576 bytes read: OK
NAND read: device 0 offset 0x700000, size 0x400000
4194304 bytes read: OK
## Flattened Device Tree blob at 21000000
Booting using the fdt blob at 0x21000000
Loading Device Tree to 2fb47000, end 2fb4fbd8 ... OK
Starting kernel ...
Booting Linux on physical CPU 0x0
Linux version 4.9.49-yocto-standard (oe-user@oe-host) (gcc version 7.2.0 (GCC) ) #1 Fri Feb 2 15:29:58 IST 2018
CPU: ARMv7 Processor [410fc051] revision 1 (ARMv7), cr=10c53c7d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
OF: fdt:Machine model: SemaConnect 7-series
cma: Reserved 64 MiB at 0x28000000
Memory policy: Data cache writeback
CPU: All CPU(s) started in SVC mode.
Built 1 zonelists in Zone order, mobility grouping off. Total pages: 64960
Kernel command line: console=ttyS0,115200 mtdparts=atmel_nand:256K(bootstrap),768K(uboot),512K(env),512K(env_redundant),5M(dtb),5M(kernel),-(rootfs) root=/dev/mtdblock6 rw rootfstype=jffs2
PID hash table entries: 1024 (order: 0, 4096 bytes)
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 184212K/262144K available (6144K kernel code, 182K rwdata, 884K rodata, 1024K init, 183K bss, 12396K reserved, 65536K cma-reserved)
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
vmalloc : 0xd0800000 - 0xff800000 ( 752 MB)
lowmem : 0xc0000000 - 0xd0000000 ( 256 MB)
modules : 0xbf000000 - 0xc0000000 ( 16 MB)
.text : 0xc0008000 - 0xc0700000 (7136 kB)
.init : 0xc0900000 - 0xc0a00000 (1024 kB)
.data : 0xc0a00000 - 0xc0a2dab8 ( 183 kB)
.bss : 0xc0a2dab8 - 0xc0a5b978 ( 184 kB)
NR_IRQS:16 nr_irqs:16 16
L2C-310 ID prefetch enabled, offset 2 lines
L2C-310 dynamic clock gating enabled, standby mode enabled
L2C-310 cache controller enabled, 8 ways, 128 kB
L2C-310: CACHE_ID 0x410000c9, AUX_CTRL 0x36020000
clocksource: pit: mask: 0x7ffffff max_cycles: 0x7ffffff, max_idle_ns: 11513617062 ns
sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836475000000ns
Console: colour dummy device 80x30
Calibrating delay loop... 329.31 BogoMIPS (lpj=1646592)
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 0x20100000 - 0x20100058
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 2 part 30 variant 5 rev 1
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 menu
AT91: Detected SoC family: sama5d2
AT91: Detected SoC: sama5d28, revision 2
clocksource: tcb_clksrc: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 184217874325 ns
at_xdmac f0010000.dma-controller: 16 channels, mapped at 0xd081a000
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
at91_i2c f8028000.i2c: using dma0chan0 (tx) and dma0chan1 (rx) for DMA transfers
at91_i2c f8028000.i2c: AT91 i2c bus driver (hw version: 0x704).
Advanced Linux Sound Architecture Driver Initialized.
clocksource: Switched to clocksource tcb_clksrc
NET: Registered protocol family 2
TCP established hash table entries: 2048 (order: 1, 8192 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
workingset: timestamp_bits=14 max_order=16 bucket_order=2
jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
io scheduler noop registered (default)
pinctrl-at91-pio4 fc038000.pinctrl: atmel pinctrl initialized
f801c000.serial: ttyS1 at MMIO 0xf801c000 (irq = 33, base_baud = 5187500) is a ATMEL_SERIAL
f8020000.serial: ttyS0 at MMIO 0xf8020000 (irq = 34, base_baud = 5187500) is a ATMEL_SERIAL
console [ttyS0] enabled
f8024000.serial: ttyS2 at MMIO 0xf8024000 (irq = 35, base_baud = 5187500) is a ATMEL_SERIAL
fc008000.serial: ttyS3 at MMIO 0xfc008000 (irq = 38, base_baud = 5187500) is a ATMEL_SERIAL
fc00c000.serial: ttyS4 at MMIO 0xfc00c000 (irq = 39, base_baud = 5187500) is a ATMEL_SERIAL
brd: module loaded
loop: module loaded
atmel_nand_nfc c0000000.nfc: NFC is probed.
atmel_nand 80000000.nand: Using dma0chan2 for DMA transfers.
nand: device found, Manufacturer ID: 0x2c, Chip ID: 0x38
nand: Micron MT29F8G08ABABAWP
nand: 1024 MiB, SLC, erase size: 512 KiB, page size: 4096, OOB size: 224
atmel_nand 80000000.nand: Use On Flash BBT
atmel_nand 80000000.nand: minimum ECC: 4 bits in 512 bytes
atmel_nand 80000000.nand: Initialize PMECC params, cap: 4, sector: 512
atmel_nand 80000000.nand: Using NFC Sram read and write
Bad block table found at page 262016, version 0x01
Bad block table found at page 261888, version 0x01
7 cmdlinepart partitions found on MTD device atmel_nand
Creating 7 MTD partitions on "atmel_nand":
0x000000000000-0x000000040000 : "bootstrap"
mtd: partition "bootstrap" doesn't end on an erase block -- force read-only
0x000000040000-0x000000100000 : "uboot"
mtd: partition "uboot" doesn't start on an erase block boundary -- force read-only
0x000000100000-0x000000180000 : "env"
0x000000180000-0x000000200000 : "env_redundant"
0x000000200000-0x000000700000 : "dtb"
0x000000700000-0x000000c00000 : "kernel"
0x000000c00000-0x000040000000 : "rootfs"
atmel_spi f8000000.spi: version: 0x311
atmel_spi f8000000.spi: Using dma0chan3 (tx) and dma0chan4 (rx) for DMA transfers
atmel_spi f8000000.spi: Using FIFO (16 data)
atmel_spi f8000000.spi: Atmel SPI Controller at 0xf8000000 (irq 27)
libphy: Fixed MDIO Bus: probed
libphy: MACB_mii_bus: probed
SMSC LAN8710/LAN8720 f8008000.etherne:01: attached PHY driver [SMSC LAN8710/LAN8720] (mii_bus:phy_addr=f8008000.etherne:01, irq=-1)
macb f8008000.ethernet eth0: Cadence GEM rev 0x00020203 at 0xf8008000 irq 28 (46:fa:7e:45:0a:fb)
PPP generic driver version 2.4.2
usbcore: registered new interface driver rtl8150
usbcore: registered new interface driver r8152
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-atmel: EHCI Atmel driver
atmel-ehci 500000.ehci: EHCI Host Controller
atmel-ehci 500000.ehci: new USB bus registered, assigned bus number 1
atmel-ehci 500000.ehci: irq 19, io mem 0x00500000
atmel-ehci 500000.ehci: USB 2.0 started, EHCI 1.00
usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: EHCI Host Controller
usb usb1: Manufacturer: Linux 4.9.49-yocto-standard ehci_hcd
usb usb1: SerialNumber: 500000.ehci
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 3 ports detected
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ohci-atmel: OHCI Atmel driver
at91_ohci 400000.ohci: USB Host Controller
at91_ohci 400000.ohci: new USB bus registered, assigned bus number 2
at91_ohci 400000.ohci: irq 19, io mem 0x00400000
usb usb2: New USB device found, idVendor=1d6b, idProduct=0001
usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb2: Product: USB Host Controller
usb usb2: Manufacturer: Linux 4.9.49-yocto-standard ohci_hcd
usb usb2: SerialNumber: at91
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
usbcore: registered new interface driver cdc_acm
cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
usbcore: registered new interface driver usbserial
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial support registered for generic
usbcore: registered new interface driver ftdi_sio
usbserial: USB Serial support registered for FTDI USB Serial Device
usbcore: registered new interface driver pl2303
usbserial: USB Serial support registered for pl2303
rtc rtc0: alarm rollover not handled
rtc rtc0: invalid alarm value: 1900-1-1 0:0:0
at91_rtc f80480b0.rtc: rtc core: registered f80480b0.rtc as rtc0
at91_rtc f80480b0.rtc: AT91 Real Time Clock driver.
i2c /dev entries driver
AT91: Starting after wakeup
sama5d4_wdt f8048040.watchdog: initialized (timeout = 16 sec, nowayout = 0)
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
sdhci-at91 b0000000.sdio-host: update clk mul to 39 as gck rate is 480000000 Hz
mmc0: SDHCI controller on b0000000.sdio-host [b0000000.sdio-host] using ADMA
leds_pwm pwmleds: unable to request PWM for sema7:blue:front-left: -517
atmel_aes f002c000.aes: version: 0x500
atmel_aes f002c000.aes: Atmel AES - Using dma0chan5, dma0chan6 for DMA transfers
atmel_sha f0028000.sha: version: 0x510
atmel_sha f0028000.sha: using dma0chan7 for DMA transfers
atmel_sha f0028000.sha: Atmel SHA1/SHA256/SHA224/SHA384/SHA512
atmel_tdes fc044000.tdes: version: 0x703
atmel_tdes fc044000.tdes: using dma0chan8, dma0chan9 for DMA transfers
atmel_tdes fc044000.tdes: Atmel DES/TDES
hidraw: raw HID events driver (C) Jiri Kosina
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
usb 1-2: new high-speed USB device number 2 using atmel-ehci
NET: Registered protocol family 10
sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
NET: Registered protocol family 17
leds_pwm pwmleds: unable to request PWM for sema7:blue:front-left: -517
at91_rtc f80480b0.rtc: setting system clock to 2018-02-09 10:20:50 UTC (1518171650)
ALSA device list:
No soundcards found.
random: fast init done
jffs2: Empty flash at 0x0003fffc ends at 0x00040000
usb 1-2: New USB device found, idVendor=0424, idProduct=2514
usb 1-2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
hub 1-2:1.0: USB hub found
hub 1-2:1.0: 4 ports detected
leds_pwm pwmleds: unable to request PWM for sema7:blue:front-left: -517
VFS: Mounted root (jffs2 filesystem) on device 31:6.
devtmpfs: mounted
Freeing unused kernel memory: 1024K
INIT: version 2.88 booting
Starting udev
udevd[128]: starting version 3.2.2
udevd[129]: starting eudev-3.2.2
INIT: Entering runlevel: 5
Configuring network interfaces... command failed: No such device (-19)
Starting system message bus: dbus.
Starting Dropbear SSH server: dropbear.
Starting domain name service: named.
starting Busybox Periodic Command Scheduler: crond... done.
crond[288]: crond (busybox 1.24.1) started, log level 8
OK
Starting syslogd/klogd: done
Starting NetworkManager daemon:
Poky (Yocto Project Reference Distro) 2.4 sema7 /dev/ttyS0
sema7 login: root
root@sema7:~#
Thanks,
-Ganesh