Re: tutorial on how to use iic on raspberry pi?
michael.chepo...@gmail.com (Michael Cheponis) writes: >dtc -I dtb -O dts bcm2710-rpi-3-b-plus.dtb does produce similar output as >you mention. But only similar. Check the 'status' line for each entry, it probably says 'disabled' and not 'okay'. You can either modify the DTB or add overlay files that override it or use the bcm2837* file that we provide. N.B. keeping it disabled by default and using overlays to enable it, is probably the smartest version. -- -- Michael van Elst Internet: mlel...@serpens.de "A potential Snark may lurk in every tree."
Re: tutorial on how to use iic on raspberry pi?
Not too long ago, in order to get -current to boot, a new .dtb needs to be used. # cat config.txt # Boot options, see https://www.raspberrypi.org/documentation/configuration/config-txt/boot.md # device_tree=bcm2710-rpi-3-b-plus.dtb kernel_address=0x0140 # # UART settings, see https://www.raspberrypi.org/documentation/configuration/uart.md #upstream_kernel=1 #uart_2ndstage=1 # enable_uart=1 force_turbo=0 dtc -I dtb -O dts bcm2710-rpi-3-b-plus.dtb does produce similar output as you mention. Nonetheless, # i2cscan iic0 i2cscan: couldn't open iic0: Device not configured same for iic1 and iic2 (by they way, why is it i2c in some cases, and iic in others?) # l -l /dev/iic* crw--- 1 root wheel 201, 0 Jun 16 2019 /dev/iic0 crw--- 1 root wheel 201, 1 Jun 16 2019 /dev/iic1 crw--- 1 root wheel 201, 2 Jun 16 2019 /dev/iic2 So, for some reason, i2cscan is not finding any i2c bus. On Wed, Feb 12, 2020 at 1:41 PM Michael van Elst wrote: > michael.chepo...@gmail.com (Michael Cheponis) writes: > > -rwxr-xr-x 1 root wheel 22630 Jun 16 2019 bcm2837-rpi-3-b-plus.dtb* > > > Raspberry Pi 3 Model B Plus Rev 1.3 - so I'm not sure which of the > >highlighted dtb files is used. > > That one would have i2c enabled. You can disassemble the dtb files with > e.g. > > dtc -I dtb -O dts bcm2837-rpi-3-b-plus.dtb > > and get something including: > > i2c@7e205000 { > compatible = "brcm,bcm2835-i2c"; > reg = <0x7e205000 0x1000>; > interrupts = <0x02 0x15>; > clocks = <0x04 0x14>; > #address-cells = <0x01>; > #size-cells = <0x00>; > status = "okay"; > pinctrl-names = "default"; > pinctrl-0 = <0x0e>; > clock-frequency = <0x186a0>; > linux,phandle = <0x47>; > phandle = <0x47>; > }; > > i2c@7e804000 { > compatible = "brcm,bcm2835-i2c"; > reg = <0x7e804000 0x1000>; > interrupts = <0x02 0x15>; > clocks = <0x04 0x14>; > #address-cells = <0x01>; > #size-cells = <0x00>; > status = "okay"; > pinctrl-names = "default"; > pinctrl-0 = <0x16>; > clock-frequency = <0x186a0>; > linux,phandle = <0x4f>; > phandle = <0x4f>; > }; > > i2c@7e805000 { > compatible = "brcm,bcm2835-i2c"; > reg = <0x7e805000 0x1000>; > interrupts = <0x02 0x15>; > clocks = <0x04 0x14>; > #address-cells = <0x01>; > #size-cells = <0x00>; > status = "okay"; > linux,phandle = <0x17>; > phandle = <0x17>; > }; > > -- > -- > Michael van Elst > Internet: mlel...@serpens.de > "A potential Snark may lurk in every tree." >
Re: tutorial on how to use iic on raspberry pi?
michael.chepo...@gmail.com (Michael Cheponis) writes: -rwxr-xr-x 1 root wheel 22630 Jun 16 2019 bcm2837-rpi-3-b-plus.dtb* > Raspberry Pi 3 Model B Plus Rev 1.3 - so I'm not sure which of the >highlighted dtb files is used. That one would have i2c enabled. You can disassemble the dtb files with e.g. dtc -I dtb -O dts bcm2837-rpi-3-b-plus.dtb and get something including: i2c@7e205000 { compatible = "brcm,bcm2835-i2c"; reg = <0x7e205000 0x1000>; interrupts = <0x02 0x15>; clocks = <0x04 0x14>; #address-cells = <0x01>; #size-cells = <0x00>; status = "okay"; pinctrl-names = "default"; pinctrl-0 = <0x0e>; clock-frequency = <0x186a0>; linux,phandle = <0x47>; phandle = <0x47>; }; i2c@7e804000 { compatible = "brcm,bcm2835-i2c"; reg = <0x7e804000 0x1000>; interrupts = <0x02 0x15>; clocks = <0x04 0x14>; #address-cells = <0x01>; #size-cells = <0x00>; status = "okay"; pinctrl-names = "default"; pinctrl-0 = <0x16>; clock-frequency = <0x186a0>; linux,phandle = <0x4f>; phandle = <0x4f>; }; i2c@7e805000 { compatible = "brcm,bcm2835-i2c"; reg = <0x7e805000 0x1000>; interrupts = <0x02 0x15>; clocks = <0x04 0x14>; #address-cells = <0x01>; #size-cells = <0x00>; status = "okay"; linux,phandle = <0x17>; phandle = <0x17>; }; -- -- Michael van Elst Internet: mlel...@serpens.de "A potential Snark may lurk in every tree."
Re: tutorial on how to use iic on raspberry pi?
What combination of RPI model, kernel (and dtb files) you try to use ? I'm using -current *NetBSD 9.99.46 (GENERIC) *figuring it probably has the latest & greatest. Raspberry Pi 3 Model B Plus Rev 1.3 - so I'm not sure which of the highlighted dtb files is used. *# cd /boot* *# ls -l *dtb -rwxr-xr-x 1 root wheel 27054 Dec 22 12:30 bcm2710-rpi-3-b-plus.dtb*-rwxr-xr-x 1 root wheel 21522 Jun 16 2019 bcm2836-rpi-2-b.dtb*-rwxr-xr-x 1 root wheel 21713 Jun 16 2019 bcm2837-rpi-3-a-plus.dtb*-rwxr-xr-x 1 root wheel 22630 Jun 16 2019 bcm2837-rpi-3-b-plus.dtb*-rwxr-xr-x 1 root wheel 22194 Jun 16 2019 bcm2837-rpi-3-b.dtb*-rwxr-xr-x 1 root wheel 21651 Jun 16 2019 bcm2837-rpi-cm3-io3.dtb** Raspberry Pi 3 Model B Plus Rev 1.3 - so I'm not sure which of the highlighted dtb files is used. I've attached the 'strings' output of those two dtb files. They both seem to have i2c* entries. Thanks for all help. On Wed, Feb 12, 2020 at 12:01 AM Michael van Elst wrote: > michael.chepo...@gmail.com (Michael Cheponis) writes: > > >Hi all, I want to hook up a sensor using iic on an RPi. Is there a > >tutorial somewhere on how to do this? Do I have to compile a specific > >config to enable iic because GENERIC doesn't? > > netbsd-9 has it defined in GENERIC and the dtb files we deliver have > configured the i2c ports. > > netbsd-8 doesn't have a GENERIC kernel, you use the RPI kernel which > also defines the iic interfaces. > > What combination of RPI model, kernel (and dtb files) you try to use ? > > -- > -- > Michael van Elst > Internet: mlel...@serpens.de > "A potential Snark may lurk in every tree." > raspberrypi,3-model-b-plus brcm,bcm2837 Raspberry Pi 3 Model B+ aliases =/soc/serial@7e215040 E/soc/serial@7e201000 M/soc/audio S/soc/aux@7e215000 W/soc/sound ]/soc a/soc/dma@7e007000 e/soc/interrupt-controller@7e00b200 j/soc/watchdog@7e10 s/soc/rng@7e104000 z/soc/mailbox@7e00b880 /soc/gpio@7e20 /soc/serial@7e201000 /soc/mmc@7e202000 /soc/mmc@7e202000 /soc/i2s@7e203000 /soc/spi@7e204000 /soc/i2c@7e205000 /soc/serial@7e215040 /soc/spi@7e215080 /soc/spi@7e2150c0 /soc/mmc@7e30 /soc/mmcnr@7e30 /soc/i2c@7e804000 /soc/i2c@7e805000 /soc/usb@7e98 /leds /soc/fb /soc/thermal@7e212000 /soc/axiperf /soc/usb@7e98/usb-port@1/usb-port@1/ethernet@1 chosen coherent_pool=1M 8250.nr_uarts=1 thermal-zones cpu-thermal cooling-maps simple-bus txp@7e004000 brcm,bcm2835-txp cdisabled dma@7e007000 brcm,bcm2835-dma jdma0 dma1 dma2 dma3 dma4 dma5 dma6 dma7 dma8 dma9 dma10 dma11 dma12 dma13 dma14 dma-shared-all watchdog@7e10 brcm,bcm2835-pm brcm,bcm2835-pm-wdt peri_image h264 cprman@7e101000 brcm,bcm2835-cprman rng@7e104000 brcm,bcm2835-rng mailbox@7e00b880 brcm,bcm2835-mbox gpio@7e20 brcm,bcm2835-gpio Kdefault dpi_gpio0 emmc_gpio22 emmc_gpio34 emmc_gpio48 gpclk0_gpio4 gpclk1_gpio5 gpclk1_gpio42 gpclk1_gpio44 gpclk2_gpio6 gpclk2_gpio43 i2c0_gpio0 i2c0_gpio28 i2c0_gpio44 i2c1_gpio2 i2c1_gpio44 jtag_gpio22 pcm_gpio18 pcm_gpio28 pwm0_gpio12 pwm0_gpio18 pwm0_gpio40 pwm1_gpio13 pwm1_gpio19 pwm1_gpio41 pwm1_gpio45 sdhost_gpio48 spi0_gpio7 spi0_gpio35 spi1_gpio16 spi2_gpio40 uart0_gpio14 uart0_ctsrts_gpio16 uart0_ctsrts_gpio30 uart0_gpio32 uart0_gpio36 uart0_ctsrts_gpio38 uart1_gpio14 uart1_ctsrts_gpio16 uart1_gpio32 uart1_ctsrts_gpio30 uart1_gpio40 uart1_ctsrts_gpio42 i2c_slave_gpio18 jtag_gpio4 dpi_18bit_gpio0 gpioout alt0 spi0_pins spi0_cs_pins i2c0 i2c1 sdio_pins bt_pins uart0_pins uart1_pins audio_pins serial@7e201000 brcm,bcm2835-pl011 arm,pl011 arm,primecell uartclk apb_pclk Kdefault cokay mmc@7e202000 brcm,bcm2835-sdhost T~ rx-tx cokay Kdefault i2s@7e203000 brcm,bcm2835-i2s T~ 0 cdisabled Kdefault spi@7e204000 brcm,bcm2835-spi T~ @ cdisabled Kdefault spidev@0 spidev spidev@1 spidev i2c@7e205000 brcm,bcm2835-i2c T~ P cdisabled Kdefault pixelvalve@7e206000 brcm,bcm2835-pixelvalve0 T~ ` cdisabled pixelvalve@7e207000 brcm,bcm2835-pixelvalve1 T~ p cdisabled dpi@7e208000 brcm,bcm2835-dpi core pixel cdisabled dsi@7e209000 brcm,bcm2835-dsi0 escape pixel 'dsi0_byte dsi0_ddr2 dsi0_ddr aux@7e215000 brcm,bcm2835-aux T~!P serial@7e215040 brcm,bcm2835-aux-uart T~!P@ cokay Kdefault spi@7e215080 brcm,bcm2835-aux-spi T~!P cdisabled spi@7e2150c0 brcm,bcm2835-aux-spi T~!P cdisabled pwm@7e20c000 brcm,bcm2835-pwm cdisabled hvs@7e40 brcm,bcm2835-hvs cdisabled dsi@7e70 brcm,bcm2835-dsi1 escape pixel 'dsi1_byte dsi1_ddr2 dsi1_ddr cdisabled csi@7e80 brcm,bcm2835-unicam cdisabled csi@7e801000 brcm,bcm2835-unicam cdisabled port endpoint i2c@7e804000 brcm,bcm2835-i2c cdisabled Kdefault i2c@7e805000 brcm,bcm2835-i2c cdisabled vec@7e806000 brcm,bcm2835-vec cdisabled pixelvalve@7e807000 brcm,bcm2835-pixelvalve2 cdisabled hdmi@7e902000 brcm,bcm2835-hdmi pixel hdmi audio-rx cdisabled usb@7e98 brcm,bcm2708-usb usb2-phy jusb soft usb-port@1 usb424,2514 usb-port@1 usb424,2514 ethernet@1 usb424,7800 mdio ethernet-phy@1 brcm,bcm2835-vc4
Re: tutorial on how to use iic on raspberry pi?
michael.chepo...@gmail.com (Michael Cheponis) writes: >Hi all, I want to hook up a sensor using iic on an RPi. Is there a >tutorial somewhere on how to do this? Do I have to compile a specific >config to enable iic because GENERIC doesn't? netbsd-9 has it defined in GENERIC and the dtb files we deliver have configured the i2c ports. netbsd-8 doesn't have a GENERIC kernel, you use the RPI kernel which also defines the iic interfaces. What combination of RPI model, kernel (and dtb files) you try to use ? -- -- Michael van Elst Internet: mlel...@serpens.de "A potential Snark may lurk in every tree."