sama5d3 gpio pulldown

This forum is for users of Microchip MPUs and who are interested in using Linux OS.

Moderator: nferre

cajjed
Posts: 17
Joined: Thu Aug 25, 2016 3:12 am

sama5d3 gpio pulldown

Fri Feb 23, 2018 12:44 am

I have a sama5d36 running 4.12.8 (also have tried 4.14.19) and I want to set some pins to gpio pulldown on startup (typically ports A - D are input pull up). I have added the following to my dts file:

Code: Select all

	ahb {
		apb {
			...
			pinctrl@fffff200 {
				board {
					...
					pinctrl_inputs: input_pins {
						atmel,pins =
							<AT91_PIOC 17 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>,
							<AT91_PIOC 18 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>,
							<AT91_PIOC 26 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>,
							<AT91_PIOC 27 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>,
							<AT91_PIOD 6 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>,
							<AT91_PIOD 7 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>;
					};
				};
			};
		};
	};
	myInputs {
		compatible = "atmel,sama5d3-pinctrl";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_inputs>;
	};
The problem is that D6/D7 are the only pins that go low with nothing connected even though the other pins show pulldown and no peripheral claiming the pins.

/sys/kernel/debug/pinctrl/ahb:apb:pinctrl@fffff200/pinmux-pins

Code: Select all

...
pin 81 (pioC17): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 82 (pioC18): (MUX UNCLAIMED) (GPIO UNCLAIMED)
...
pin 90 (pioC26): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 91 (pioC27): (MUX UNCLAIMED) (GPIO UNCLAIMED)
...
pin 102 (pioD6): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 103 (pioD7): (MUX UNCLAIMED) (GPIO UNCLAIMED)
...
/sys/kernel/debug/pinctrl/ahb:apb:pinctrl@fffff200/pinconf-pins

Code: Select all

...
pin 81 (pioC17): PULL_DOWN|DRIVE_STRENGTH_MED
pin 82 (pioC18): PULL_DOWN|DRIVE_STRENGTH_MED
...
pin 90 (pioC26): PULL_DOWN|DRIVE_STRENGTH_MED
pin 91 (pioC27): PULL_DOWN|DRIVE_STRENGTH_MED
...
pin 102 (pioD6): PULL_DOWN|DRIVE_STRENGTH_MED
pin 103 (pioD7): PULL_DOWN|DRIVE_STRENGTH_MED
...
I verify that the port C pins are still high using a scope and checking the gpio settings which show a value of 1 with direction in. Only D6 and D7 are low. Any insight on why this might be?
blue_z
Location: USA
Posts: 1674
Joined: Thu Apr 19, 2007 10:15 pm

Re: sama5d3 gpio pulldown

Mon Feb 26, 2018 2:41 am

cajjed wrote: I have added the following to my dts file:

Code: Select all

	myInputs {
		compatible = "atmel,sama5d3-pinctrl";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_inputs>;
	};
This bad node should have generated an error!
You cannot assign a resource (i.e. a pin group) back to the driver (i.e. pinctrl) that allocates/manages that resource.
Inspect your boot log more carefully.

You seem to conflate pins, PIO, pin-control, and GPIO, which unfortunately is easy to do unless you take some time to study the subjects.

Atmel/Microchip refers to PIO (Parallel I/O) as the set of SoC pins that are not dedicated to power, clocks, addressing, or data which can be multiplexed and configured .
Any of these PIO pins can be used as a GPIO pin if it is not multiplexed/assigned for use by a peripheral.
(There are some SoCs (e.g. maybe Broadcom?) that have dedicated GPIO pins.)

Linux uses the pinctrl driver to manage (i.e. allocate as a resource), multiplex, and configure the (non-dedicated) pins of the SoC.
Linux uses the gpio driver to manage and configure the (left-over) SoC pins that are not assigned or acquired by any other peripheral driver.
Note that the majority of pin features are configured through pinctrl using pin group definitions (in the Device Tree), which are assigned to a device driver (which would be identified through the compatible property).
If the pin is not assigned to a driver (through a pin group in the Device Tree), then I'm not aware of any means to configure that pin in the DT (other than the limited GPIO options).

You can try a kludge by assigning your myInputs node to the "gpio-keys" driver instead of "atmel,sama5d3-pinctrl".
That driver will neither complain nor actually acquire or use the pin group.
The proper way to this this is to assign the pins you plan to use to a device driver.

Regards
cajjed
Posts: 17
Joined: Thu Aug 25, 2016 3:12 am

Re: sama5d3 gpio pulldown

Tue Feb 27, 2018 4:46 pm

Thank you very much for the response and I appreciate your explanation. I don't see anything in boot that tells me that myInput is bad, but it does not show up anywhere in /sys/kernel/debug/pinctrl/ahb:apb:pinctrl@fffff200.

I will try your kludge to see what it does. My actually application is a BLE IRQ line that requires you to set it from output (for upgrade) to input pull down for BLE SPI communication. Since my hack worked on the D pins I just made one of those my BLE IRQ and things are working. However, I am very interested in learning more about device tree configuration but have found it difficult to find an good resources (open to any suggestions).
cajjed
Posts: 17
Joined: Thu Aug 25, 2016 3:12 am

Re: sama5d3 gpio pulldown

Tue Feb 27, 2018 6:56 pm

So I tried changing the compatibility to gpio-keys but there then nothing gets pulled down. Any chance you could show me how you would do a gpio-key with pulldown? I have tried adding the pinctrl to spi1 but that won't compile...
blue_z
Location: USA
Posts: 1674
Joined: Thu Apr 19, 2007 10:15 pm

Re: sama5d3 gpio pulldown

Wed Feb 28, 2018 1:53 am

cajjed wrote:I don't see anything in boot that tells me that myInput is bad ...
Really?!!!
When I try your DT hack, I see on the console during boot:

Code: Select all

Linux version 4.14.21 ,,,  
...  
gpio-at91 fffff200.gpio: at address e085a200
gpio-at91 fffff400.gpio: at address e085c400
gpio-at91 fffff600.gpio: at address e085e600
gpio-at91 fffff800.gpio: at address e0881800
gpio-at91 fffffa00.gpio: at address e0883a00
pinctrl-at91 ahb:apb:pinctrl@fffff200: initialized AT91 pinctrl driver
pinctrl-at91 myInputs: can not read the mux-mask of -1065336184
pinctrl-at91: probe of myInputs failed with error -22
...

cajjed wrote:My actually application is a BLE IRQ line that requires you to set it from output (for upgrade) to input pull down for BLE SPI communication.
Study Documentation/gpio/drivers-on-gpio.txt in the kernel source for an existing driver that could match your application.

cajjed wrote:However, I am very interested in learning more about device tree configuration but have found it difficult to find an good resources (open to any suggestions).
What have you found? What is your requirement for "good"?

cajjed wrote:So I tried changing the compatibility to gpio-keys but there then nothing gets pulled down. Any chance you could show me how you would do a gpio-key with pulldown?
First, your summation is ambiguous.
Second, I only suggested that kludge to fix the bad DT node and eliminate the error message.
I never claimed that the kludge was the remedy to your pull-down issues.
But it should not have made anything "worse" either; my tests indicated the same configuration results with either driver specification.

Check that your kernel build includes the gpio_keys.o module.
Enable debugging in the pinctrl subsystem, and see if pins are requested (and configured) for the myInputs node during boot.
Or
inspect the System.map file for relevant symbol names, e.g. "gpio_keys*".

cajjed wrote:I have tried adding the pinctrl to spi1 but that won't compile...
This makes no sense. By "pinctrl" do you actually mean the pin group?
Seems like you're not learning the terminology, or realize that you cannot just haphazardly assign pin groups or properties to drivers or nodes.


What board are you using?
What you have posted so far seems to indicate that the root problem is that whatever board that you're using probably has (external) pull-ups on the pins that you're try to use. In a manner similar to the overlooking of the DT node error, you could be overlooking pull-ups in the schematic.

Regards
cajjed
Posts: 17
Joined: Thu Aug 25, 2016 3:12 am

Re: sama5d3 gpio pulldown

Wed Feb 28, 2018 6:50 pm

Yes, during boot I get no message related to myInputs and it does actually pull down port D pins, so it may be the there is some actual pull ups on the other pins. The board we are using is a sama5d36 that is built by another company so I don't have immediate access to the schematic but I am waiting a response from them to see if there are any external pull up resistors. Looking at the datasheet I do know that the all ports (A-D) are pulled up on reset, something that I did verify with a scope.

I think your observations between gpio and pinctrl may not be completely correct and do help show my point that there is no great resources. What I end up doing is taking examples and looking at the code to try and figure things out. What I do know is that gpio lets you control the pins but does not include control of the pullup/pulldown internal resistors and that is done by pinctrl. I used these links as a guide for my pulldown change:

https://groups.google.com/forum/#!topic ... 5aJcW_y2Wc
https://groups.google.com/forum/#!msg/a ... 1afFcon0wJ

On the SPI side, I should be able to do something like this to get the pin to pulldown from within the peripheral node.

Code: Select all

spi1 {
  ...
  pinctrl-names = "default";
  pinctrl-0 = <&pinctrl_ble_irq>;
};

		pinctrl_ble_irq: ble_irq {
			atmel,pins =
				<AT91_PIOC 27 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>;
		};
But I will have to play, the hard thing is when you do something wrong it doesn't give you much information, leaving off a semicolon, etc.
cajjed
Posts: 17
Joined: Thu Aug 25, 2016 3:12 am

Re: sama5d3 gpio pulldown

Wed Feb 28, 2018 7:58 pm

So I was able to get the pinctrl to work with spi1:

Code: Select all

			spi1: spi@f8008000 {
				pinctrl-names = "default";
				pinctrl-0 = <&pinctrl_ble_irq>;
				cs-gpios = <0>, <0>, <0>, <0>;
				dmas = <0>, <0>;
				status = "okay";
				spidev@0 {
					compatible = "spidev";
					spi-max-frequency = <10000000>;
					reg = <0>;
				};
			};
I had previously left off the default line, figuring it was optional. This does set the pin to pulldown but it still shows as high, so maybe there really is some external pullup.
blue_z
Location: USA
Posts: 1674
Joined: Thu Apr 19, 2007 10:15 pm

Re: sama5d3 gpio pulldown

Wed Feb 28, 2018 11:29 pm

cajjed wrote:Yes, during boot I get no message related to myInputs ...
That's hard to believe, especially since the author and another user (in Google Groups) report an error when using that DT construct that you replicated.

cajjed wrote:I think your observations between gpio and pinctrl may not be completely correct
Except that presumes you actually understand what I wrote, but you fail to be discerning and persist in conflating the terminology.

The proper source of documentation is in the Linux kernel source itself, in the Documentation directory.

Regards
cajjed
Posts: 17
Joined: Thu Aug 25, 2016 3:12 am

Re: sama5d3 gpio pulldown

Thu Mar 01, 2018 7:57 pm

Thanks again for the response. I do appreciate you taking the time to respond. You have been very helpful in the past. My observations are just not in sync with your statements.

Below is my boot log and I see no error related to MyInput:

Code: Select all


U-Boot 2014.07-00020-g9b72587 (Nov 22 2017 - 15:05:50)

CPU: SAMA5D36
Crystal frequency:       12 MHz
CPU clock        :      528 MHz
Master clock     :      132 MHz
I2C:   ready
DRAM:  256 MiB
NAND:  512 MiB
MMC:   mci: 0
In:    serial
Out:   serial
Err:   serial
Net:   gmac0, macb0
Warning: failed to set MAC address

Hit any key to stop autoboot:  3  2  1  0 
UBI: attaching mtd1 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    126976 bytes
UBI: smallest flash I/O unit:    2048
UBI: VID header offset:          2048 (aligned 2048)
UBI: data offset:                4096
UBI: attached mtd1 to ubi0
UBI: MTD device name:            "mtd=3"
UBI: MTD device size:            511 MiB
UBI: number of good PEBs:        4084
UBI: number of bad PEBs:         4
UBI: max. allowed volumes:       128
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     1
UBI: available PEBs:             40
UBI: total number of reserved PEBs: 4044
UBI: number of PEBs reserved for bad PEB handling: 40
UBI: max/mean erase counter: 2/0
UBIFS: mounted UBI device 0, volume 1, name "rootfs"
UBIFS: mounted read-only
UBIFS: file system size:   505872384 bytes (494016 KiB, 482 MiB, 3984 LEBs)
UBIFS: journal size:       25395200 bytes (24800 KiB, 24 MiB, 200 LEBs)
UBIFS: media format:       w4/r0 (latest is w4/r0)
UBIFS: default compressor: LZO
UBIFS: reserved for root:  5182151 bytes (5060 KiB)
Loading file '/boot/uboot_script' to addr 0x22000000 with size 1566 (0x0000061e)...
Done
gpio: pin 84 (gpio 84) value is 1
Loading file '/boot/zImage' to addr 0x22000000 with size 3621544 (0x003742a8)...
Done
Loading file '/boot/dtb-r2' to addr 0x21000000 with size 38200 (0x00009538)...
Done
Kernel image @ 0x22000000 [ 0x000000 - 0x3742a8 ]
## Flattened Device Tree blob at 21000000
   Booting using the fdt blob at 0x21000000
   Loading Device Tree to 2fb27000, end 2fb33537 ... OK

Starting kernel ...

** 738 printk messages dropped ** 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=30 max_order=16 bucket_order=0
io scheduler noop registered (default)
io scheduler mq-deadline registered
io scheduler kyber registered
f001c000.serial: ttyS1 at MMIO 0xf001c000 (irq = 20, base_baud = 4125000) is a ATMEL_SERIAL
f0020000.serial: ttyS2 at MMIO 0xf0020000 (irq = 21, base_baud = 4125000) is a ATMEL_SERIAL
f0024000.serial: ttyS5 at MMIO 0xf0024000 (irq = 22, base_baud = 4125000) is a ATMEL_SERIAL
f8020000.serial: ttyS3 at MMIO 0xf8020000 (irq = 27, base_baud = 4125000) is a ATMEL_SERIAL
f8024000.serial: ttyS4 at MMIO 0xf8024000 (irq = 28, base_baud = 4125000) is a ATMEL_SERIAL
ffffee00.serial: ttyS0 at MMIO 0xffffee00 (irq = 36, base_baud = 8250000) is a ATMEL_SERIAL
console [ttyS0] enabled
brd: module loaded
loop: module loaded
atmel_spi f8008000.spi: DMA TX channel not available, SPI unable to use DMA
atmel_spi f8008000.spi: Atmel SPI Controller using PIO only
spidev spi0.0: buggy DT: spidev listed directly in DT
------------[ cut here ]------------
WARNING: CPU: 0 PID: 1 at drivers/spi/spidev.c:730 spidev_probe+0x19c/0x1cc
Modules linked in:
CPU: 0 PID: 1 Comm: swapper Not tainted 4.14.19-nelson #33
Hardware name: Atmel SAMA5
[<c010d63c>] (unwind_backtrace) from [<c010aef8>] (show_stack+0x10/0x14)
[<c010aef8>] (show_stack) from [<c01165dc>] (__warn+0xe4/0xfc)
[<c01165dc>] (__warn) from [<c01166a4>] (warn_slowpath_null+0x20/0x28)
[<c01166a4>] (warn_slowpath_null) from [<c03da8b4>] (spidev_probe+0x19c/0x1cc)
[<c03da8b4>] (spidev_probe) from [<c03d79d0>] (spi_drv_probe+0x7c/0xa8)
[<c03d79d0>] (spi_drv_probe) from [<c0374978>] (driver_probe_device+0x238/0x2e8)
[<c0374978>] (driver_probe_device) from [<c0372f7c>] (bus_for_each_drv+0x44/0x94)
[<c0372f7c>] (bus_for_each_drv) from [<c0374660>] (__device_attach+0xb0/0x114)
[<c0374660>] (__device_attach) from [<c0373c4c>] (bus_probe_device+0x84/0x8c)
[<c0373c4c>] (bus_probe_device) from [<c037210c>] (device_add+0x394/0x594)
[<c037210c>] (device_add) from [<c03d85fc>] (spi_add_device+0xcc/0x130)
[<c03d85fc>] (spi_add_device) from [<c03d8f7c>] (spi_register_controller+0x434/0x8f8)
[<c03d8f7c>] (spi_register_controller) from [<c03d9478>] (devm_spi_register_controller+0x38/0x70)
[<c03d9478>] (devm_spi_register_controller) from [<c03dce08>] (atmel_spi_probe+0x4ac/0x630)
[<c03dce08>] (atmel_spi_probe) from [<c0376154>] (platform_drv_probe+0x50/0xac)
[<c0376154>] (platform_drv_probe) from [<c0374978>] (driver_probe_device+0x238/0x2e8)
[<c0374978>] (driver_probe_device) from [<c0374acc>] (__driver_attach+0xa4/0xa8)
[<c0374acc>] (__driver_attach) from [<c0372ed4>] (bus_for_each_dev+0x4c/0x9c)
[<c0372ed4>] (bus_for_each_dev) from [<c0373ed4>] (bus_add_driver+0x188/0x20c)
[<c0373ed4>] (bus_add_driver) from [<c0375364>] (driver_register+0x78/0xf4)
[<c0375364>] (driver_register) from [<c0101944>] (do_one_initcall+0x44/0x168)
[<c0101944>] (do_one_initcall) from [<c0900d78>] (kernel_init_freeable+0x134/0x1c0)
[<c0900d78>] (kernel_init_freeable) from [<c0603b00>] (kernel_init+0x8/0x104)
[<c0603b00>] (kernel_init) from [<c0107a28>] (ret_from_fork+0x14/0x2c)
---[ end trace 7c8a7453bb5b164b ]---
atmel_spi f8008000.spi: Atmel SPI Controller version 0x213 at 0xf8008000 (irq 24)
libphy: Fixed MDIO Bus: probed
CAN device driver interface
libphy: MACB_mii_bus: probed
Micrel KSZ9031 Gigabit PHY f0028000.ethernet-ffffffff:07: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=f0028000.ethernet-ffffffff:07, irq=POLL)
macb f0028000.ethernet eth0: Cadence GEM rev 0x00020119 at 0xf0028000 irq 43 (98:93:97:9c:0b:3b)
macb f802c000.ethernet: invalid hw address, using random
libphy: MACB_mii_bus: probed
Generic PHY f802c000.ethernet-ffffffff:01: attached PHY driver [Generic PHY] (mii_bus:phy_addr=f802c000.ethernet-ffffffff:01, irq=POLL)
macb f802c000.ethernet eth1: Cadence MACB rev 0x0001010c at 0xf802c000 irq 44 (2a:8a:64:48:02:b0)
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-atmel: EHCI Atmel driver
atmel-ehci 700000.ehci: EHCI Host Controller
atmel-ehci 700000.ehci: new USB bus registered, assigned bus number 1
atmel-ehci 700000.ehci: irq 47, io mem 0x00700000
atmel-ehci 700000.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.14.19-nelson ehci_hcd
usb usb1: SerialNumber: 700000.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 600000.ohci: failed to request gpio "overcurrent" IRQ
at91_ohci 600000.ohci: failed to request gpio "overcurrent" IRQ
at91_ohci 600000.ohci: failed to request gpio "overcurrent" IRQ
at91_ohci 600000.ohci: failed to find sfr node
at91_ohci 600000.ohci: USB Host Controller
at91_ohci 600000.ohci: new USB bus registered, assigned bus number 2
at91_ohci 600000.ohci: irq 47, io mem 0x00600000
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.14.19-nelson ohci_hcd
usb usb2: SerialNumber: at91
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 3 ports 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 usb-storage
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
atmel_usba_udc 500000.gadget: MMIO registers at 0xf8030000 mapped at d08dc000
atmel_usba_udc 500000.gadget: FIFO at 0x00500000 mapped at d0d00000
g_serial gadget: Gadget Serial v2.4
g_serial gadget: g_serial ready
rtc rtc0: invalid alarm value: 1900-1-1 0:0:0
at91_rtc fffffeb0.rtc: registered as rtc0
at91_rtc fffffeb0.rtc: AT91 Real Time Clock driver.
i2c /dev entries driver
AT91: Starting after software reset
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
atmel_mci f0000000.mmc: version: 0x505
atmel_mci f0000000.mmc: using dma0chan0 for DMA transfers
atmel_mci f0000000.mmc: Atmel MCI controller at 0xf0000000 irq 18, 1 slots
atmel_mci f8000000.mmc: version: 0x505
atmel_mci f8000000.mmc: using dma1chan0 for DMA transfers
atmel_mci f8000000.mmc: Atmel MCI controller at 0xf8000000 irq 23, 1 slots
sdhci-pltfm: SDHCI platform and OF driver helper
atmel_aes f8038000.aes: version: 0x135
atmel_aes f8038000.aes: Atmel AES - Using dma1chan1, dma1chan2 for DMA transfers
atmel_sha f8034000.sha: version: 0x410
atmel_sha f8034000.sha: using dma1chan3 for DMA transfers
atmel_sha f8034000.sha: Atmel SHA1/SHA256/SHA224/SHA384/SHA512
atmel_tdes f803c000.tdes: version: 0x701
atmel_tdes f803c000.tdes: using dma1chan4, dma1chan5 for DMA transfers
atmel_tdes f803c000.tdes: Atmel DES/TDES
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
nand: device found, Manufacturer ID: 0x01, Chip ID: 0xdc
nand: AMD/Spansion S34ML04G1
nand: 512 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
Bad block table found at page 262080, version 0x01
Bad block table found at page 262016, version 0x01
4 ofpart partitions found on MTD device atmel_nand
Creating 4 MTD partitions on "atmel_nand":
0x000000000000-0x000000040000 : "at91bootstrap"
0x000000040000-0x0000000c0000 : "bootloader"
0x0000000c0000-0x000000100000 : "bootloader env"
0x000000100000-0x00001ff80000 : "rootfs"
iio iio:device0: Resolution used: 12 bits
iio iio:device0: ADC Touch screen is disabled.
NET: Registered protocol family 10
Segment Routing with IPv6
sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
NET: Registered protocol family 17
can: controller area network core (rev 20170425 abi 9)
NET: Registered protocol family 29
can: raw protocol (rev 20170425)
can: broadcast manager protocol (rev 20170425 t)
can: netlink gateway (rev 20170425) max_hops=1
ubi0: attaching mtd3
usb 2-3: new full-speed USB device number 2 using at91_ohci
usb 2-3: New USB device found, idVendor=1050, idProduct=0407
usb 2-3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 2-3: Product: Yubikey 4 OTP+U2F+CCID
usb 2-3: Manufacturer: Yubico
random: crng init done
usb 2-2: new full-speed USB device number 3 using at91_ohci
usb 2-2: New USB device found, idVendor=0a5c, idProduct=21e8
usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 2-2: Product: BCM20702A0
usb 2-2: Manufacturer: Broadcom Corp
usb 2-2: SerialNumber: 5CF37075DA2B
ubi0: scanning is finished
ubi0: attached mtd3 (name "rootfs", size 510 MiB)
ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
ubi0: good PEBs: 4084, bad PEBs: 0, corrupted PEBs: 0
ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 2/0, WL threshold: 4096, image sequence number: 1013252386
ubi0: available PEBs: 0, total reserved PEBs: 4084, PEBs reserved for bad PEB handling: 80
at91_rtc fffffeb0.rtc: setting system clock to 2018-03-01 17:28:08 UTC (1519925288)
panel-power-supply: disabling
ubi0: background thread "ubi_bgt0d" started, PID 709
UBIFS (ubi0:1): background thread "ubifs_bgt0_1" started, PID 711
UBIFS (ubi0:1): UBIFS: mounted UBI device 0, volume 1, name "rootfs"
UBIFS (ubi0:1): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
UBIFS (ubi0:1): FS size: 505872384 bytes (482 MiB, 3984 LEBs), journal size 25395200 bytes (24 MiB, 200 LEBs)
UBIFS (ubi0:1): reserved for root: 4952683 bytes (4836 KiB)
UBIFS (ubi0:1): media format: w4/r0 (latest is w5/r0), UUID 12311E8A-CE55-45A0-941D-484C203CAC8B, small LPT model
VFS: Mounted root (ubifs filesystem) on device 0:13.
devtmpfs: mounted
Freeing unused kernel memory: 1024K
systemd[1]: Failed to insert module 'autofs4': No such file or directory
systemd[1]: systemd 237 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid)
systemd[1]: Detected architecture arm.

Welcome to [1mDebian GNU/Linux buster/sid[0m!

systemd[1]: Set hostname to <nelson>.
systemd[1]: File /lib/systemd/system/systemd-journald.service:35 configures an IP firewall (IPAddressDeny=any), but the local system does not support BPF/cgroup based firewalling.
systemd[1]: Proceeding WITHOUT firewalling in effect! (This warning is only shown for the first loaded unit using IP firewalling.)
systemd[1]: Created slice User and Session Slice.
[[0;32m  OK  [0m] Created slice User and Session Slice.
systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[[0;32m  OK  [0m] Started Forward Password Requests to Wall Directory Watch.
systemd[1]: Created slice System Slice.
[[0;32m  OK  [0m] Created slice System Slice.
systemd[1]: Listening on Syslog Socket.
[[0;32m  OK  [0m] Listening on Syslog Socket.
systemd[1]: Created slice system-serial\x2dgetty.slice.
[[0;32m  OK  [0m] Created slice system-serial\x2dgetty.slice.
[[0;32m  OK  [0m] Listening on udev Control Socket.
[[0;32m  OK  [0m] Listening on /dev/initctl Compatibility Named Pipe.
[[0;32m  OK  [0m] Reached target Slices.
[[0;32m  OK  [0m] Created slice system-getty.slice.
[[0;32m  OK  [0m] Started Dispatch Password Requests to Console Directory Watch.
[[0;32m  OK  [0m] Reached target Paths.
[[0;32m  OK  [0m] Listening on udev Kernel Socket.
[[0;32m  OK  [0m] Reached target Local Encrypted Volumes.
[[0;32m  OK  [0m] Reached target Remote File Systems.
[[0;32m  OK  [0m] Listening on Journal Socket.
         Starting udev Coldplug all Devices...
         Mounting Kernel Debug File System...
         Starting Load Kernel Modules...
         Starting Remount Root and Kernel File Systems...
         Starting Create Static Device Nodes in /dev...
[[0;32m  OK  [0m] Reached target Swap.
[[0;32m  OK  [0m] Listening on Network Service Netlink Socket.
[[0;32m  OK  [0m] Listening on Journal Socket (/dev/log).
         Starting Journal Service...
[[0;32m  OK  [0m] Mounted Kernel Debug File System.
[[0;32m  OK  [0m] Started Load Kernel Modules.
[[0;32m  OK  [0m] Started Remount Root and Kernel File Systems.
         Starting Load/Save Random Seed...
         Starting Apply Kernel Variables...
         Mounting Kernel Configuration File System...
[[0;32m  OK  [0m] Started Create Static Device Nodes in /dev.
         Starting udev Kernel Device Manager...
[[0;32m  OK  [0m] Reached target Local File Systems (Pre).
[[0;32m  OK  [0m] Reached target Local File Systems.
[[0;32m  OK  [0m] Started Load/Save Random Seed.
[[0;32m  OK  [0m] Mounted Kernel Configuration File System.
[[0;32m  OK  [0m] Started Apply Kernel Variables.
         Starting Raise network interfaces...
[[0;32m  OK  [0m] Started udev Kernel Device Manager.
         Starting Network Service...
[[0;32m  OK  [0m] Started Raise network interfaces.
[[0;32m  OK  [0m] Started Journal Service.
         Starting Flush Journal to Persistent Storage...
systemd-journald[730]: Received request to flush runtime journal from PID 1
[[0;32m  OK  [0m] Started Flush Journal to Persistent Storage.
[[0;32m  OK  [0m] Started Network Service.
         Starting Create Volatile Files and Directories...
[[0;32m  OK  [0m] Started udev Coldplug all Devices.
[[0;32m  OK  [0m] Started Create Volatile Files and Directories.
IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[[0;32m  OK  [0m] Found device /dev/ttyS0.
IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
macb f0028000.ethernet eth0: link up (1000/Full)
IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
         Starting Network Time Synchronization...
         Starting Network Name Resolution...
         Starting Update UTMP about System Boot/Shutdown...
[[0;32m  OK  [0m] Started Update UTMP about System Boot/Shutdown.
[[0;32m  OK  [0m] Started Network Time Synchronization.
[[0;32m  OK  [0m] Reached target System Initialization.
[[0;32m  OK  [0m] Listening on D-Bus System Message Bus Socket.
[[0;32m  OK  [0m] Reached target Sockets.
[[0;32m  OK  [0m] Reached target Basic System.
[[0;32m  OK  [0m] Started Regular background program processing daemon.
         Starting LSB: Emtrion Environment Setup...
         Starting Login Service...
[[0;32m  OK  [0m] Started D-Bus System Message Bus.
[[0;32m  OK  [0m] Started Login Service.
         Starting System Logging Service...
[[0;32m  OK  [0m] Started Daily Cleanup of Temporary Directories.
[[0;32m  OK  [0m] Reached target System Time Synchronized.
[[0;32m  OK  [0m] Started Daily apt download activities.
[[0;32m  OK  [0m] Started Daily apt upgrade and clean activities.
[[0;32m  OK  [0m] Reached target Timers.
[[0;32m  OK  [0m] Started Network Name Resolution.
[[0;32m  OK  [0m] Started LSB: Emtrion Environment Setup.
[[0;32m  OK  [0m] Reached target Host and Network Name Lookups.
[[0;32m  OK  [0m] Reached target Network.
         Starting OpenBSD Secure Shell server...
         Starting Permit User Sessions...
[[0;32m  OK  [0m] Started System Logging Service.
[[0;32m  OK  [0m] Started Permit User Sessions.
[[0;32m  OK  [0m] Started Serial Getty on ttyS0.
[[0;32m  OK  [0m] Started Getty on tty1.
[[0;32m  OK  [0m] Reached target Login Prompts.
[[0;32m  OK  [0m] Started OpenBSD Secure Shell server.
[[0;32m  OK  [0m] Reached target Multi-User System.
[[0;32m  OK  [0m] Reached target Graphical Interface.
         Starting Update UTMP about System Runlevel Changes...
[[0;32m  OK  [0m] Started Update UTMP about System Runlevel Changes.


Debian GNU/Linux buster/sid nelson ttyS0

nelson login: 
Furthermore, I know that it pulls the pin down on reset, with it high (pulled up) without this code. Here is my latest code (I included simple-bus but it worked either way).

Code: Select all

...
					pinctrl_ble_irq: ble_irq {
						atmel,pins =
							<AT91_PIOD 8 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>;
					};

					pinctrl_inputs: input_pins {
						atmel,pins =
							<AT91_PIOC 16 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>,
							<AT91_PIOC 17 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>,
							<AT91_PIOC 18 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>,
							<AT91_PIOC 21 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>,
							<AT91_PIOC 27 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>,
							<AT91_PIOD 5 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>,
							<AT91_PIOD 6 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>,
							<AT91_PIOD 7 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>;
					};
...
	myInputs {
		compatible = "atmel,sama5d3-pinctrl", "simple-bus";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_inputs &pinctrl_ble_irq>;
	};
I did look at the gpio documentation but it doesn't seem to have a preset option that fits my needs, and really all they do is provide a template you can use instead of making your own. Not sure why myInputs wouldn't work for you.

I experimented with putting pinctrl_ble_irq in the spi code and that did build but it did not pull down the pin even though it shows pulldown. Thus, that pin began to act like the other non port D pins. That is the behavior that I don't understand and I am exploring.
blue_z
Location: USA
Posts: 1674
Joined: Thu Apr 19, 2007 10:15 pm

Re: sama5d3 gpio pulldown

Thu Mar 01, 2018 9:15 pm

cajjed wrote:Below is my boot log and I see no error related to MyInput:
The reason you don't "see" the error message is because you're only looking at the tail end of the kernel boot log.
In fact you're looking at only the last 20%. There's 80%, or over 700 lines, that you have not reviewed because they have been "dropped".

Code: Select all

Starting kernel ...

** 738 printk messages dropped **

When I posted a copy of the error message, I provided context, i.e. the preceding lines output by the pinctrl-at91 driver.
You don't see those dev_info() lines either, which should have been another clue.

Your kernel is generating so much output (???!!!) to its console that the console buffer is overrun (before the serial driver is installed).
You would need to use earlyprintk (enable it in the kernel configuration, and add that parameter to the command line) to view the full kernel boot log.

Regards
cajjed
Posts: 17
Joined: Thu Aug 25, 2016 3:12 am

Re: sama5d3 gpio pulldown

Fri Mar 02, 2018 12:17 am

You were right, I added the early printk and saw the error. I have gotten the pinctrl working with spi and added the appropriate compatibility so I don't get the spidev warning:

Code: Select all

			spi1: spi@f8008000 {
				cs-gpios = <0>, <0>, <0>, <0>;
				dmas = <0>, <0>;
				status = "okay";
				spidev@0 {
					compatible = "semtech,sx1301";
					spi-max-frequency = <10000000>;
					reg = <0>;
					pinctrl-names = "default";
					pinctrl-0 = <&pinctrl_ble_irq &pinctrl_inputs>;
				};
			};
I still have the same challenge, where only the D ports work... awaiting feedback to make sure it isn't hardware related...

Here is my update boot log:

Code: Select all


U-Boot 2014.07-00020-g9b72587 (Nov 22 2017 - 15:05:50)

CPU: SAMA5D36
Crystal frequency:       12 MHz
CPU clock        :      528 MHz
Master clock     :      132 MHz
I2C:   ready
DRAM:  256 MiB
NAND:  512 MiB
MMC:   mci: 0
In:    serial
Out:   serial
Err:   serial
Net:   gmac0, macb0
Warning: failed to set MAC address

Hit any key to stop autoboot:  3  2  1  0 
UBI: attaching mtd1 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    126976 bytes
UBI: smallest flash I/O unit:    2048
UBI: VID header offset:          2048 (aligned 2048)
UBI: data offset:                4096
UBI: attached mtd1 to ubi0
UBI: MTD device name:            "mtd=3"
UBI: MTD device size:            511 MiB
UBI: number of good PEBs:        4084
UBI: number of bad PEBs:         4
UBI: max. allowed volumes:       128
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     1
UBI: available PEBs:             40
UBI: total number of reserved PEBs: 4044
UBI: number of PEBs reserved for bad PEB handling: 40
UBI: max/mean erase counter: 2/0
UBIFS: mounted UBI device 0, volume 1, name "rootfs"
UBIFS: mounted read-only
UBIFS: file system size:   505872384 bytes (494016 KiB, 482 MiB, 3984 LEBs)
UBIFS: journal size:       25395200 bytes (24800 KiB, 24 MiB, 200 LEBs)
UBIFS: media format:       w4/r0 (latest is w4/r0)
UBIFS: default compressor: LZO
UBIFS: reserved for root:  5182151 bytes (5060 KiB)
Loading file '/boot/uboot_script' to addr 0x22000000 with size 1566 (0x0000061e)...
Done
gpio: pin 84 (gpio 84) value is 1
Loading file '/boot/zImage' to addr 0x22000000 with size 3622320 (0x003745b0)...
Done
Loading file '/boot/dtb-r2' to addr 0x21000000 with size 38140 (0x000094fc)...
Done
Kernel image @ 0x22000000 [ 0x000000 - 0x3745b0 ]
## Flattened Device Tree blob at 21000000
   Booting using the fdt blob at 0x21000000
   Loading Device Tree to 2fb27000, end 2fb334fb ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0x0

Linux version 4.14.19-nelson (nelson@nelson) (gcc version 7.1.1 20170510 (Linaro GCC 7.1-2017.05)) #40 Thu Mar 1 16:58:32 EST 2018

CPU: ARMv7 Processor [410fc051] revision 1 (ARMv7), cr=10c53c7d

CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache

OF: fdt: Machine model: emtrion sbc-sama5d36

bootconsole [earlycon0] enabled

Memory policy: Data cache writeback

CPU: All CPU(s) started in SVC mode.

random: fast init done

Built 1 zonelists, mobility grouping on.  Total pages: 65024

Kernel command line: console=ttyS0,115200 earlyprintk rootfstype=ubifs ubi.mtd=3 root=ubi0:rootfs rw rootwait

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: 250084K/262144K available (6144K kernel code, 199K rwdata, 1232K rodata, 1024K init, 133K bss, 12060K reserved, 0K 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 - 0xc0a31c40   ( 200 kB)

       .bss : 0xc0a36ba8 - 0xc0a58354   ( 134 kB)

NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16

clocksource: pit: mask: 0xfffffff max_cycles: 0xfffffff, max_idle_ns: 14479245754 ns

sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836475000000ns

Console: colour dummy device 80x30

Calibrating delay loop... 351.43 BogoMIPS (lpj=1757184)

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 - 0x20100060

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

AT91: PM: standby: standby, suspend: ulp0

No ATAGs?

gpio-at91 fffff200.gpio: at address d085a200

gpio-at91 fffff400.gpio: at address d085c400

gpio-at91 fffff600.gpio: at address d085e600

gpio-at91 fffff800.gpio: at address d0881800

gpio-at91 fffffa00.gpio: at address d0883a00

pinctrl-at91 ahb:apb:pinctrl@fffff200: initialized AT91 pinctrl driver

clocksource: tcb_clksrc: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 115833966437 ns

at_hdmac ffffe600.dma-controller: Atmel AHB DMA Controller ( cpy set slave ), 8 channels

at_hdmac ffffe800.dma-controller: Atmel AHB DMA Controller ( cpy set slave ), 8 channels

AT91: Detected SoC family: sama5d3

AT91: Detected SoC: sama5d36, revision 2

SCSI subsystem initialized

usbcore: registered new interface driver usbfs

usbcore: registered new interface driver hub

usbcore: registered new device driver usb

at91_i2c f801c000.i2c: can't get DMA channel, continue without DMA support

at91_i2c f801c000.i2c: AT91 i2c bus driver (hw version: 0x402).

pps_core: LinuxPPS API ver. 1 registered

pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>

PTP clock support registered

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=30 max_order=16 bucket_order=0

io scheduler noop registered (default)

io scheduler mq-deadline registered

io scheduler kyber registered

f001c000.serial: ttyS1 at MMIO 0xf001c000 (irq = 20, base_baud = 4125000) is a ATMEL_SERIAL

f0020000.serial: ttyS2 at MMIO 0xf0020000 (irq = 21, base_baud = 4125000) is a ATMEL_SERIAL

f0024000.serial: ttyS5 at MMIO 0xf0024000 (irq = 22, base_baud = 4125000) is a ATMEL_SERIAL

f8020000.serial: ttyS3 at MMIO 0xf8020000 (irq = 27, base_baud = 4125000) is a ATMEL_SERIAL

f8024000.serial: ttyS4 at MMIO 0xf8024000 (irq = 28, base_baud = 4125000) is a ATMEL_SERIAL

console [ttyS0] enabled
console [ttyS0] enabled

bootconsole [earlycon0] disabled
bootconsole [earlycon0] disabled

brd: module loaded
loop: module loaded
atmel_spi f8008000.spi: DMA TX channel not available, SPI unable to use DMA
atmel_spi f8008000.spi: Atmel SPI Controller using PIO only
atmel_spi f8008000.spi: Atmel SPI Controller version 0x213 at 0xf8008000 (irq 24)
libphy: Fixed MDIO Bus: probed
CAN device driver interface
libphy: MACB_mii_bus: probed
Micrel KSZ9031 Gigabit PHY f0028000.ethernet-ffffffff:07: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=f0028000.ethernet-ffffffff:07, irq=POLL)
macb f0028000.ethernet eth0: Cadence GEM rev 0x00020119 at 0xf0028000 irq 43 (98:93:97:9c:0b:3b)
macb f802c000.ethernet: invalid hw address, using random
libphy: MACB_mii_bus: probed
Generic PHY f802c000.ethernet-ffffffff:01: attached PHY driver [Generic PHY] (mii_bus:phy_addr=f802c000.ethernet-ffffffff:01, irq=POLL)
macb f802c000.ethernet eth1: Cadence MACB rev 0x0001010c at 0xf802c000 irq 44 (62:a9:04:1c:8d:dd)
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-atmel: EHCI Atmel driver
atmel-ehci 700000.ehci: EHCI Host Controller
atmel-ehci 700000.ehci: new USB bus registered, assigned bus number 1
atmel-ehci 700000.ehci: irq 47, io mem 0x00700000
atmel-ehci 700000.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.14.19-nelson ehci_hcd
usb usb1: SerialNumber: 700000.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 600000.ohci: failed to request gpio "overcurrent" IRQ
at91_ohci 600000.ohci: failed to request gpio "overcurrent" IRQ
at91_ohci 600000.ohci: failed to request gpio "overcurrent" IRQ
at91_ohci 600000.ohci: failed to find sfr node
at91_ohci 600000.ohci: USB Host Controller
at91_ohci 600000.ohci: new USB bus registered, assigned bus number 2
at91_ohci 600000.ohci: irq 47, io mem 0x00600000
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.14.19-nelson ohci_hcd
usb usb2: SerialNumber: at91
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 3 ports 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 usb-storage
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
atmel_usba_udc 500000.gadget: MMIO registers at 0xf8030000 mapped at d08d4000
atmel_usba_udc 500000.gadget: FIFO at 0x00500000 mapped at d0d00000
g_serial gadget: Gadget Serial v2.4
g_serial gadget: g_serial ready
rtc rtc0: invalid alarm value: 1900-1-1 0:0:0
at91_rtc fffffeb0.rtc: registered as rtc0
at91_rtc fffffeb0.rtc: AT91 Real Time Clock driver.
i2c /dev entries driver
AT91: Starting after software reset
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
atmel_mci f0000000.mmc: version: 0x505
atmel_mci f0000000.mmc: using dma0chan0 for DMA transfers
atmel_mci f0000000.mmc: Atmel MCI controller at 0xf0000000 irq 18, 1 slots
atmel_mci f8000000.mmc: version: 0x505
atmel_mci f8000000.mmc: using dma1chan0 for DMA transfers
atmel_mci f8000000.mmc: Atmel MCI controller at 0xf8000000 irq 23, 1 slots
sdhci-pltfm: SDHCI platform and OF driver helper
atmel_aes f8038000.aes: version: 0x135
atmel_aes f8038000.aes: Atmel AES - Using dma1chan1, dma1chan2 for DMA transfers
atmel_sha f8034000.sha: version: 0x410
atmel_sha f8034000.sha: using dma1chan3 for DMA transfers
atmel_sha f8034000.sha: Atmel SHA1/SHA256/SHA224/SHA384/SHA512
atmel_tdes f803c000.tdes: version: 0x701
atmel_tdes f803c000.tdes: using dma1chan4, dma1chan5 for DMA transfers
atmel_tdes f803c000.tdes: Atmel DES/TDES
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
nand: device found, Manufacturer ID: 0x01, Chip ID: 0xdc
nand: AMD/Spansion S34ML04G1
nand: 512 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
Bad block table found at page 262080, version 0x01
Bad block table found at page 262016, version 0x01
4 ofpart partitions found on MTD device atmel_nand
Creating 4 MTD partitions on "atmel_nand":
0x000000000000-0x000000040000 : "at91bootstrap"
0x000000040000-0x0000000c0000 : "bootloader"
0x0000000c0000-0x000000100000 : "bootloader env"
0x000000100000-0x00001ff80000 : "rootfs"
iio iio:device0: Resolution used: 12 bits
iio iio:device0: ADC Touch screen is disabled.
NET: Registered protocol family 10
Segment Routing with IPv6
sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
NET: Registered protocol family 17
can: controller area network core (rev 20170425 abi 9)
NET: Registered protocol family 29
can: raw protocol (rev 20170425)
can: broadcast manager protocol (rev 20170425 t)
can: netlink gateway (rev 20170425) max_hops=1
ubi0: attaching mtd3
usb 2-3: new full-speed USB device number 2 using at91_ohci
usb 2-3: New USB device found, idVendor=1050, idProduct=0407
usb 2-3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 2-3: Product: Yubikey 4 OTP+U2F+CCID
usb 2-3: Manufacturer: Yubico
random: crng init done
usb 2-2: new full-speed USB device number 3 using at91_ohci
usb 2-2: New USB device found, idVendor=0a5c, idProduct=21e8
usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 2-2: Product: BCM20702A0
usb 2-2: Manufacturer: Broadcom Corp
usb 2-2: SerialNumber: 5CF37075DA2B
ubi0: scanning is finished
ubi0: attached mtd3 (name "rootfs", size 510 MiB)
ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
ubi0: good PEBs: 4084, bad PEBs: 0, corrupted PEBs: 0
ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 2/0, WL threshold: 4096, image sequence number: 1013252386
ubi0: available PEBs: 0, total reserved PEBs: 4084, PEBs reserved for bad PEB handling: 80
at91_rtc fffffeb0.rtc: setting system clock to 2018-03-01 22:10:31 UTC (1519942231)
panel-power-supply: disabling
ubi0: background thread "ubi_bgt0d" started, PID 707
UBIFS (ubi0:1): background thread "ubifs_bgt0_1" started, PID 709
UBIFS (ubi0:1): UBIFS: mounted UBI device 0, volume 1, name "rootfs"
UBIFS (ubi0:1): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
UBIFS (ubi0:1): FS size: 505872384 bytes (482 MiB, 3984 LEBs), journal size 25395200 bytes (24 MiB, 200 LEBs)
UBIFS (ubi0:1): reserved for root: 4952683 bytes (4836 KiB)
UBIFS (ubi0:1): media format: w4/r0 (latest is w5/r0), UUID 12311E8A-CE55-45A0-941D-484C203CAC8B, small LPT model
VFS: Mounted root (ubifs filesystem) on device 0:13.
devtmpfs: mounted
Freeing unused kernel memory: 1024K
systemd[1]: Failed to insert module 'autofs4': No such file or directory
systemd[1]: systemd 237 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid)
systemd[1]: Detected architecture arm.

Welcome to [1mDebian GNU/Linux buster/sid[0m!

systemd[1]: Set hostname to <nelson>.
systemd[1]: File /lib/systemd/system/systemd-journald.service:35 configures an IP firewall (IPAddressDeny=any), but the local system does not support BPF/cgroup based firewalling.
systemd[1]: Proceeding WITHOUT firewalling in effect! (This warning is only shown for the first loaded unit using IP firewalling.)
systemd[1]: Created slice User and Session Slice.
[[0;32m  OK  [0m] Created slice User and Session Slice.
systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[[0;32m  OK  [0m] Started Dispatch Password Requests to Console Directory Watch.
systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[[0;32m  OK  [0m] Started Forward Password Requests to Wall Directory Watch.
systemd[1]: Reached target Paths.
[[0;32m  OK  [0m] Reached target Paths.
systemd[1]: Reached target Swap.
[[0;32m  OK  [0m] Reached target Swap.
[[0;32m  OK  [0m] Reached target Remote File Systems.
[[0;32m  OK  [0m] Reached target Local Encrypted Volumes.
[[0;32m  OK  [0m] Created slice System Slice.
[[0;32m  OK  [0m] Created slice system-getty.slice.
[[0;32m  OK  [0m] Created slice system-serial\x2dgetty.slice.
[[0;32m  OK  [0m] Listening on Journal Socket.
         Starting Load Kernel Modules...
[[0;32m  OK  [0m] Listening on Journal Socket (/dev/log).
[[0;32m  OK  [0m] Listening on Syslog Socket.
[[0;32m  OK  [0m] Listening on /dev/initctl Compatibility Named Pipe.
[[0;32m  OK  [0m] Listening on udev Control Socket.
         Starting Create Static Device Nodes in /dev...
         Mounting Kernel Debug File System...
[[0;32m  OK  [0m] Reached target Slices.
         Starting Journal Service...
[[0;32m  OK  [0m] Listening on Network Service Netlink Socket.
[[0;32m  OK  [0m] Listening on udev Kernel Socket.
         Starting udev Coldplug all Devices...
         Starting Remount Root and Kernel File Systems...
[[0;32m  OK  [0m] Started Load Kernel Modules.
[[0;32m  OK  [0m] Mounted Kernel Debug File System.
[[0;32m  OK  [0m] Started Create Static Device Nodes in /dev.
         Mounting Kernel Configuration File System...
         Starting Apply Kernel Variables...
[[0;32m  OK  [0m] Mounted Kernel Configuration File System.
[[0;32m  OK  [0m] Started Remount Root and Kernel File Systems.
         Starting Load/Save Random Seed...
[[0;32m  OK  [0m] Reached target Local File Systems (Pre).
[[0;32m  OK  [0m] Reached target Local File Systems.
         Starting udev Kernel Device Manager...
[[0;32m  OK  [0m] Started Apply Kernel Variables.
[[0;32m  OK  [0m] Started Load/Save Random Seed.
         Starting Raise network interfaces...
[[0;32m  OK  [0m] Started udev Kernel Device Manager.
         Starting Network Service...
[[0;32m  OK  [0m] Started Journal Service.
         Starting Flush Journal to Persistent Storage...
[[0;32m  OK  [0m] Started Raise network interfaces.
systemd-journald[726]: Received request to flush runtime journal from PID 1
[[0;32m  OK  [0m] Started Network Service.
[[0;32m  OK  [0m] Started Flush Journal to Persistent Storage.
         Starting Create Volatile Files and Directories...
[[0;32m  OK  [0m] Started udev Coldplug all Devices.
[[0;32m  OK  [0m] Started Create Volatile Files and Directories.
IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[[0;32m  OK  [0m] Found device /dev/ttyS0.
         Starting Update UTMP about System Boot/Shutdown...
         Starting Network Name Resolution...
         Starting Network Time Synchronization...
IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
macb f0028000.ethernet eth0: link up (1000/Full)
IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[[0;32m  OK  [0m] Started Update UTMP about System Boot/Shutdown.
[[0;32m  OK  [0m] Started Network Time Synchronization.
[[0;32m  OK  [0m] Reached target System Time Synchronized.
[[0;32m  OK  [0m] Reached target System Initialization.
[[0;32m  OK  [0m] Started Daily apt download activities.
[[0;32m  OK  [0m] Started Daily Cleanup of Temporary Directories.
[[0;32m  OK  [0m] Started Daily apt upgrade and clean activities.
[[0;32m  OK  [0m] Reached target Timers.
[[0;32m  OK  [0m] Listening on D-Bus System Message Bus Socket.
[[0;32m  OK  [0m] Reached target Sockets.
[[0;32m  OK  [0m] Reached target Basic System.
[[0;32m  OK  [0m] Started Regular background program processing daemon.
         Starting LSB: Emtrion Environment Setup...
         Starting System Logging Service...
[[0;32m  OK  [0m] Started D-Bus System Message Bus.
         Starting Login Service...
[[0;32m  OK  [0m] Started System Logging Service.
[[0;32m  OK  [0m] Started LSB: Emtrion Environment Setup.
[[0;32m  OK  [0m] Started Login Service.
[[0;32m  OK  [0m] Started Network Name Resolution.
[[0;32m  OK  [0m] Reached target Host and Network Name Lookups.
[[0;32m  OK  [0m] Reached target Network.
         Starting OpenBSD Secure Shell server...
         Starting Permit User Sessions...
[[0;32m  OK  [0m] Started Permit User Sessions.
[[0;32m  OK  [0m] Started Serial Getty on ttyS0.
[[0;32m  OK  [0m] Started Getty on tty1.
[[0;32m  OK  [0m] Reached target Login Prompts.
[[0;32m  OK  [0m] Started OpenBSD Secure Shell server.
[[0;32m  OK  [0m] Reached target Multi-User System.
[[0;32m  OK  [0m] Reached target Graphical Interface.
         Starting Update UTMP about System Runlevel Changes...
[[0;32m  OK  [0m] Started Update UTMP about System Runlevel Changes.


Debian GNU/Linux buster/sid nelson ttyS0
cajjed
Posts: 17
Joined: Thu Aug 25, 2016 3:12 am

Re: sama5d3 gpio pulldown

Wed Mar 14, 2018 4:34 pm

So I did find out that several pins are pulled high and that I still had a few other peripherals (like extra LED) that were using the pins that I was testing. I also discovered that I was overwriting my SPI settings with pinctrl and so did a fix there as well. I did a test of the following pins and was able to have them all pulled down:

Code: Select all

			spi1: spi@f8008000 {
				cs-gpios = <0>, <0>, <0>, <0>;
				pinctrl-0 = <&pinctrl_spi1 &pinctrl_ble_irq>;
				dmas = <0>, <0>;
				status = "okay";
				spidev@0 {
					compatible = "semtech,sx1301";
					spi-max-frequency = <10000000>;
					reg = <0>;
				};
			};

					pinctrl_ble_irq: ble_irq {
						atmel,pins =
							<AT91_PIOB 14 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>,
							<AT91_PIOB 20 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>,
							<AT91_PIOB 22 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>,
							<AT91_PIOB 26 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>,
							<AT91_PIOC 17 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>,
							<AT91_PIOD 6 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>,
							<AT91_PIOD 15 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>,
							<AT91_PIOE 16 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>,
							<AT91_PIOE 23 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>,
							<AT91_PIOE 31 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>,
							<AT91_PIOD 8 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_DOWN>;
					};
Thanks blue_z for the help.

Return to “LINUX”

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest