PRU / AM335 Notes - BeagleBone Black Verbose log of PRU/BBB/asm_tools experiments. LOG: - 20140914 get to know BBB boot process + install rcn-ee.net kernel - 20180131 continue exploration for contract work Entry: PRU Date: Sun Sep 14 13:27:03 CEST 2014 Goal for today: get a hello world program to run on the PRU. Approach 1: use Code Composer Studio on Windows[1]. Is there a way to run this on Linux? Yes: ccs_setup_linux32.bin Hmm... doesn't do anything. Hmm.. [1] http://www.element14.com/community/community/designcenter/single-board-computers/next-gen_beaglebone/blog/2014/04/30/bbb--pru-c-compiler Entry: BeagleLogic : Start with the logic analyzer? Date: Sun Sep 14 13:43:33 CEST 2014 Might be best to get started using an existing application. EDIT: Watching the Youtube presentation, it's clear that this is something to follow! The most interesting part is of course the high bandwidth path from code running on the PRU to the BBB or out into a PC connected through USB or Ethernet. [1] http://beaglelogic.net Entry: Monitor Date: Sun Sep 14 14:12:04 CEST 2014 ( Might be best to do this in Staapl. ) What is necessary to get a monitor to work? - read - write - execute / reset Entry: Step-by-step Date: Sun Sep 14 14:23:26 CEST 2014 * Initialize the driver modprobe uio_pruss check if it's installed: ls -l /sys/class/uio/ ls -l /sys/class/uio/uio0/maps/map0/addr ( doesn't seem to be ) #include prussdrv_init(); * looking ad prussdrv.h (libprussdrv.so) The driver essentially acts as a monitor: prussdrv_pru_reset() prussdrv_pru_write_memory() prussdrv_exec_code() ... Described in [2]: 03-AM335x_PRU_Linux_Application_Loader-ug.pdf [1] https://github.com/beagleboard/am335x_pru_package [2] https://github.com/beagleboard/am335x_pru_package/raw/master/Documentation/03-AM335x_PRU_Linux_Application_Loader-ug.pdf Entry: empty /sys/class/uio Date: Sun Sep 14 14:46:49 CEST 2014 - /sys/class/uio is empty after modprobe uio_pruss [1] http://github.jfet.org/BBKNotes2.html Entry: BBB kernel and SD card Date: Sun Sep 14 14:49:12 CEST 2014 So it seems that getting this to work reliably does need tracking of more recent kernels. Probably also figuring out how not to brick the device! So let's do the latter first. Can always have ROM boot from SDCARD first (MMC0) by pressing S2 switch. Entry: BBB boot process Date: Sun Sep 14 14:49:59 CEST 2014 Assuming this requires a ttl serial on the on-board J1 connector. 1 GND 2 3 4 RX 5 TX 6 This is /dev/ttyO0 (ttyO instead of ttyS? seems arbitrary[5]) See next entry for boot log. BBB uses U-Boot[2]. It seems that it first tries to boot from MMC0 (external), then MMC1 (internal). But this[2] says otherwise. Before running U-Boot, the Sitara boots MMC1 (internal) from ROM by loading "MLO" file from a 12,16 or 32 bit FAT MBR. /dev/mmcblk0p1 FAT U-Boot with "MLO" file. /dev/mmcblk0p2 linux root What are these? /dev/mmcblk0boot0 /dev/mmcblk0boot1 They are eMMC hardware level partitions. See[3][4]. Both are empty on my BBB. The simplest way to create an SSD boot card seems to be to clone the eMMC. I don't have a uSSD available. Maybe it can boot from USB[6]? This[7] confirms my impression: If the SDCard is present, it will attempt to boot from the SDCard FAT partition. If the SDCard isn’t present, it will boot from the eMMC FAT partition [1] http://dave.cheney.net/2013/09/22/two-point-five-ways-to-access-the-serial-console-on-your-beaglebone-black [2] http://wiki.beyondlogic.org/index.php/BeagleBoneBlack_Boot_Process [3] http://www.micron.com/~/media/Documents/Products/Software%20Article/SWNL_hardware_vs_software_partitions.pdf [4] http://www.crashcourse.ca/wiki/index.php/EMMC_on_the_BBB [5] http://blog.nixpanic.net/2011/02/serial-ports-with-beagleboard-and-newer.html [6] http://www.embeddedhobbyist.com/debian-tips/beaglebone-black/beaglebone-black-usb-boot/ [7] https://groups.google.com/forum/#!topic/beagleboard/_mOlo6T-70E Entry: Boot log Date: Sun Sep 14 15:45:14 CEST 2014 This is the output of a "reboot" using pyla. Notice the two U-Boot stages. [master] tom@zni:~/pyla$ python3 example_uart.py saleae.cpp:default at 4.000 MHz saleae.cpp:BeginConnect (waiting for Connect) config: *' at 0x7f1cc6020d80> > config: baudrate=115200 config: channel=3 saleae.cpp:A3E22C8E845D2C7D Connect saleae.cpp:A3E22C8E845D2C7D Start at 4.000 MHz drop: 81920 drop: 81920 drop: 81920 saleae.cpp:A3E22C8E845D2C7D connect_sink Sending SIGTERM to remaining processes... Sending SIGKILL to remaining processes... Unmounting file systems. Unmounted /sys/fs/fuse/connections. Unmounted /sys/kernel/security. Unmounted /dev/mqueue. Unmounted /sys/kernel/debug. Disabling swaps. Detaching loop devices. Detaching DM devices. [ 471.800647] (NULL device *): gadget not registered. [ 471.816679] Restarting system. U-Boot SPL 2014.04-00015-gb4422bd (Apr 22 2014 - 13:24:29) reading args spl_load_image_fat_os: error reading image args, err - -1 reading u-boot.img reading u-boot.img U-Boot 2014.04-00015-gb4422bd (Apr 22 2014 - 13:24:29) I2C: ready DRAM: 512 MiB NAND: 0 MiB MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1 *** Warning - readenv() failed, using default environment Net: not set. Validating first E-fuse MAC cpsw, usb_ether Hit any key to stop autoboot: 0 gpio: pin 53 (gpio 53) value is 1 Card did not respond to voltage select! mmc0(part 0) is current device Card did not respond to voltage select! gpio: pin 56 (gpio 56) value is 0 gpio: pin 55 (gpio 55) value is 0 gpio: pin 54 (gpio 54) value is 0 mmc1(part 0) is current device gpio: pin 54 (gpio 54) value is 1 SD/MMC found on device 1 reading uEnv.txt 1430 bytes read in 5 ms (279.3 KiB/s) gpio: pin 55 (gpio 55) value is 1 Loaded environment from uEnv.txt Importing environment from mmc ... Checking if uenvcmd is set ... gpio: pin 56 (gpio 56) value is 1 Running uenvcmd ... reading zImage 3717760 bytes read in 207 ms (17.1 MiB/s) reading initrd.img 2870007 bytes read in 161 ms (17 MiB/s) reading /dtbs/am335x-boneblack.dtb 25080 bytes read in 9 ms (2.7 MiB/s) Kernel image @ 0x82000000 [ 0x000000 - 0x38ba80 ] ## Flattened Device Tree blob at 88000000 Booting using the fdt blob at 0x88000000 Using Device Tree in place at 88000000, end 880091f7 Starting kernel ... Uncompressing Linux... done, booting the kernel. [ 0.381330] omap2_mbox_probe: platform not supported [ 0.548334] tps65217-bl tps65217-bl: no platform data provided [ 0.612295] bone-capemgr bone_capemgr.9: slot #0: No cape found [ 0.649400] bone-capemgr bone_capemgr.9: slot #1: No cape found [ 0.686508] bone-capemgr bone_capemgr.9: slot #2: No cape found [ 0.723617] bone-capemgr bone_capemgr.9: slot #3: No cape found [ 0.739777] bone-capemgr bone_capemgr.9: slot #6: BB-BONELT-HDMIN conflict P8.45 (#5:BB-BONELT-HDMI) [ 0.749383] bone-capemgr bone_capemgr.9: slot #6: Failed verification [ 0.756140] bone-capemgr bone_capemgr.9: loader: failed to load slot-6 BB-BONELT-HDMIN:00A0 (prio 2) [ 0.772667] omap_hsmmc mmc.5: of_parse_phandle_with_args of 'reset' failed [ 0.835220] pinctrl-single 44e10800.pinmux: pin 44e10854 already requested by 44e10800.pinmux; cannot claim for gpio-leds.8 [ 0.846932] pinctrl-single 44e10800.pinmux: pin-21 (gpio-leds.8) status -22 [ 0.854211] pinctrl-single 44e10800.pinmux: could not request pin 21 on device pinctrl-single Loading, please wait... Scanning for Btrfs filesystems systemd-fsck[201]: rootfs: clean, 104688/230144 files, 746829/919296 blocks Debian GNU/Linux 7 beaglebone ttyO0 default username:password is [debian:temppwd] Support/FAQ: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian The IP Address for usb0 is: 192.168.7.2 beaglebone login: [ 11.036817] libphy: PHY 4a101000.mdio:01 not found [ 11.042014] net eth0: phy 4a101000.mdio:01 not found on slave 1 Entry: Boot from uSD (and installing new kernel) Date: Sun Sep 14 16:59:57 CEST 2014 Using the card from my phone which incidentally has a FAT and a linux partition. root@beaglebone:/media/A787-15E1# cp /boot/uboot/MLO . root@beaglebone:/media/A787-15E1# cp /boot/uboot/u-boot.img . root@beaglebone:/media/A787-15E1# cp /boot/uboot/initrd.img . root@beaglebone:/media/A787-15E1# cp /boot/uboot/zImage . root@beaglebone:/media/A787-15E1# cp /boot/uboot/uEnv.txt . (EDIT: also copy SOC.sh - file with info stored as shell variables) It seems to boot from device 0 (uSD) instead of 1 (eMMC). mmc0 is current device gpio: pin 54 (gpio 54) value is 1 SD/MMC found on device 0 reading uEnv.txt 1430 bytes read in 6 ms (232.4 KiB/s) Now need to edit the U-Boot config. My uSD isn't large enough to copy the whole system, but it should be enough to safely boot with a different kernel. Current: 3.8.13-bone47 It seems the kernel and the modules are not installed from a debian package. Is there a standard way? See [1]. Here [2] is a collection of kernels. Currently the latest one is: wget https://rcn-ee.net/deb/wheezy-armhf/v3.17.0-rc4-bone2/install-me.sh Looks like a couple of things need to be taken care of: - dts - firmware So maybe best to let the script do this, but not yet overwrite the files in the /boot/uboot FAT partition. Simplest way seems to be to unmount /boot/uboot before running the script. This is what I did: cd /boot umount uboot wget https://rcn-ee.net/deb/wheezy-armhf/v3.17.0-rc4-bone2/install-me.sh mv install-me.sh install-me-v3.17.0-rc4-bone2.sh chmod +x install-me-v3.17.0-rc4-bone2.sh ./install-me-v3.17.0-rc4-bone2.sh mv uboot uboot-3.17.0-rc4-bone2 mkdir uboot tar zcf uboot-3.17.0-rc4-bone2.tar.gz uboot-3.17.0-rc4-bone2 mount uboot Then copy the contents of uboot-3.17.0-rc4-bone2 to the root of the SD card FAT partition: cp -av uboot-3.17.0-rc4-bone2/* /media/A787-15E1/ root@beaglebone:~# cat /proc/version Linux version 3.17.0-rc4-bone2 (root@a5-imx6q-wandboard-2gb) (gcc version 4.6.3 (Debian 4.6.3-14) ) #1 Mon Sep 8 21:15:00 UTC 2014 [1] http://datko.net/2014/03/21/bbb_upgrade_3_13/ [2] https://rcn-ee.net/deb/wheezy-armhf/ Entry: kernel install-me.sh console log Date: Sun Sep 14 17:36:47 CEST 2014 root@beaglebone:/boot# ./install-me-v3.17.0-rc4-bone2.sh ./install-me-v3.17.0-rc4-bone2.sh wget: [1.13.4] wget: [this version of wget does not support sni, using --no-check-certificate] wget: [http://en.wikipedia.org/wiki/Server_Name_Indication] p11-kit: invalid config filename, will be ignored in the future: /etc/pkcs11/modules/gnome-keyring-module 2014-09-14 15:37:19 URL:https://rcn-ee.net/deb/wheezy-armhf/v3.17.0-rc4-bone2/ [1496/1496] -> "/tmp/deb/index.html" [1] --2014-09-14 15:37:19-- https://rcn-ee.net/deb/wheezy-armhf/v3.17.0-rc4-bone2/linux-image-3.17.0-rc4-bone2_1wheezy_armhf.deb p11-kit: invalid config filename, will be ignored in the future: /etc/pkcs11/modules/gnome-keyring-module Resolving rcn-ee.net (rcn-ee.net)... 69.163.222.213 Connecting to rcn-ee.net (rcn-ee.net)|69.163.222.213|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 24221472 (23M) [application/x-debian-package] Saving to: `/tmp/deb/linux-image-3.17.0-rc4-bone2_1wheezy_armhf.deb' 100%[======================================>] 24,221,472 2.78M/s in 14s 2014-09-14 15:37:37 (1.61 MB/s) - `/tmp/deb/linux-image-3.17.0-rc4-bone2_1wheezy_armhf.deb' saved [24221472/24221472] --2014-09-14 15:37:38-- https://rcn-ee.net/deb/wheezy-armhf/v3.17.0-rc4-bone2/3.17.0-rc4-bone2-dtbs.tar.gz p11-kit: invalid config filename, will be ignored in the future: /etc/pkcs11/modules/gnome-keyring-module Resolving rcn-ee.net (rcn-ee.net)... 69.163.222.213 Connecting to rcn-ee.net (rcn-ee.net)|69.163.222.213|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 593278 (579K) [application/x-tar] Saving to: `/tmp/deb/3.17.0-rc4-bone2-dtbs.tar.gz' 100%[======================================>] 593,278 371K/s in 1.6s 2014-09-14 15:37:43 (371 KB/s) - `/tmp/deb/3.17.0-rc4-bone2-dtbs.tar.gz' saved [593278/593278] Installing [3.17.0-rc4-bone2-dtbs.tar.gz] Installing [linux-image-3.17.0-rc4-bone2_1wheezy_armhf.deb] Selecting previously unselected package linux-image-3.17.0-rc4-bone2. (Reading database ... 82268 files and directories currently installed.) Unpacking linux-image-3.17.0-rc4-bone2 (from .../linux-image-3.17.0-rc4-bone2_1wheezy_armhf.deb) ... Setting up linux-image-3.17.0-rc4-bone2 (1wheezy) ... update-initramfs: Generating /boot/initrd.img-3.17.0-rc4-bone2 --2014-09-14 15:38:22-- https://rcn-ee.net/deb/wheezy-armhf/v3.17.0-rc4-bone2/thirdparty p11-kit: invalid config filename, will be ignored in the future: /etc/pkcs11/modules/gnome-keyring-module Resolving rcn-ee.net (rcn-ee.net)... 69.163.222.213 Connecting to rcn-ee.net (rcn-ee.net)|69.163.222.213|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 158 [text/plain] Saving to: `/tmp/deb/thirdparty' 100%[======================================>] 158 --.-K/s in 0s 2014-09-14 15:38:26 (438 KB/s) - `/tmp/deb/thirdparty' saved [158/158] --2014-09-14 15:38:26-- https://rcn-ee.net/deb/wheezy-armhf/v3.17.0-rc4-bone2/RT2870STA.dat p11-kit: invalid config filename, will be ignored in the future: /etc/pkcs11/modules/gnome-keyring-module Resolving rcn-ee.net (rcn-ee.net)... 69.163.222.213 Connecting to rcn-ee.net (rcn-ee.net)|69.163.222.213|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 1222 (1.2K) [text/plain] Saving to: `/etc/Wireless/RT2870STA/RT2870STA.dat' 100%[======================================>] 1,222 --.-K/s in 0s 2014-09-14 15:38:29 (3.05 MB/s) - `/etc/Wireless/RT2870STA/RT2870STA.dat' saved [1222/1222] ----------------------------- ----------------------------- `/boot/vmlinuz-3.17.0-rc4-bone2' -> `/boot/uboot/zImage' `/boot/initrd.img-3.17.0-rc4-bone2' -> `/boot/uboot/initrd.img' ----------------------------- Script done: please reboot root@beaglebone:/boot# Entry: Files on boot partition Date: Sun Sep 14 17:39:43 CEST 2014 root@beaglebone:/boot/uboot# find . . ./dtbs ./dtbs/am335x-bone-lcd7-01-00a2.dtb ./dtbs/omap3-gta04.dtb ./dtbs/am335x-bone-crypto-00a0.dtb ./dtbs/omap3-overo-storm-summit.dtb ./dtbs/omap3-overo-palo43.dtb ./dtbs/omap3430-sdp.dtb ./dtbs/am335x-boneblack-lcd4-01-00a1.dtb ./dtbs/am3517_mt_ventoux.dtb ./dtbs/omap3-overo-storm-gallop43.dtb ./dtbs/am335x-bone.dtb ./dtbs/am335x-bone-lcd4-01-00a1.dtb ./dtbs/omap3-overo-summit.dtb ./dtbs/omap3-overo-storm-chestnut43.dtb ./dtbs/omap3-zoom3.dtb ./dtbs/am335x-bone-audio.dtb ./dtbs/omap3-igep0030.dtb ./dtbs/am335x-boneblack-audio.dtb ./dtbs/am335x-bone-ttyO2.dtb ./dtbs/am3517-craneboard.dtb ./dtbs/omap3-lilly-dbb056.dtb ./dtbs/am335x-boneblack-ttyO5.dtb ./dtbs/omap3-evm.dtb ./dtbs/omap3-cm-t3730.dtb ./dtbs/am335x-boneblack-4dcape-70t.dtb ./dtbs/am335x-base0033.dtb ./dtbs/omap3-sbc-t3517.dtb ./dtbs/omap3-n900.dtb ./dtbs/am335x-pepper.dtb ./dtbs/am335x-boneblack-4dcape-70.dtb ./dtbs/am335x-evmsk.dtb ./dtbs/omap3-evm-37xx.dtb ./dtbs/omap3-beagle-xm.dtb ./dtbs/am335x-boneblack-4dcape-43t.dtb ./dtbs/am335x-boneblack-ttyO2.dtb ./dtbs/am335x-boneblack-4dcape-43.dtb ./dtbs/omap3-beagle-xm-ab.dtb ./dtbs/am335x-boneblack-ttyO4.dtb ./dtbs/am335x-bone-lcd7-01-00a3.dtb ./dtbs/omap3-cm-t3530.dtb ./dtbs/omap3-devkit8000.dtb ./dtbs/omap3-overo-storm-alto35.dtb ./dtbs/am335x-bone-ttyO1.dtb ./dtbs/omap3-overo-alto35.dtb ./dtbs/am3517-evm.dtb ./dtbs/omap3-overo-tobi.dtb ./dtbs/omap3-overo-storm-palo43.dtb ./dtbs/am335x-bone-ttyO4.dtb ./dtbs/am335x-boneblack-rtc-01-00a1.dtb ./dtbs/omap3-beagle.dtb ./dtbs/omap3-cm-t3517.dtb ./dtbs/omap3-ldp.dtb ./dtbs/omap3-n950.dtb ./dtbs/am335x-boneblack-lcd7-01-00a3.dtb ./dtbs/omap3-overo-chestnut43.dtb ./dtbs/omap3-sbc-t3530.dtb ./dtbs/am335x-boneblack-crypto-00a0.dtb ./dtbs/am335x-bone-cape-bone-argus.dtb ./dtbs/am335x-boneblack.dtb ./dtbs/am335x-bone-rtc-01-00a1.dtb ./dtbs/am335x-boneblack-cape-bone-argus.dtb ./dtbs/am335x-boneblack-ttyO1.dtb ./dtbs/am335x-boneblack-lcd3-01-00a2.dtb ./dtbs/omap3-n9.dtb ./dtbs/omap3-overo-gallop43.dtb ./dtbs/am335x-bone-lcd3-01-00a2.dtb ./dtbs/am335x-nano.dtb ./dtbs/am335x-bone-ttyO5.dtb ./dtbs/am335x-boneblack-lcd7-01-00a2.dtb ./dtbs/omap3-sbc-t3730.dtb ./dtbs/am335x-evm.dtb ./dtbs/omap3-overo-storm-tobi.dtb ./dtbs/omap3-igep0020.dtb ./zImage ./initrd.img Entry: dtbs Date: Sun Sep 14 17:45:53 CEST 2014 So what is this dtbs business? dtb = device tree binary dts = device tree source [1] http://elinux.org/Device_Tree Entry: pruss on 3.17.0-rc4-bone2 Date: Sun Sep 14 17:51:28 CEST 2014 Hmm... no uio_pruss module.. Guess that means to build a new kernel or at least the driver. [1] https://rcn-ee.net/deb/wheezy-armhf/v3.17.0-rc4-bone2/defconfig Entry: TODO Date: Sun Sep 14 17:58:46 CEST 2014 - build pruss module for 3.17.0-rc4-bone2 from linux git[1] and config[2] - figure out what support is needed (firmware, device tree, initrd) Entry: Building linux kernel Date: Sun Sep 14 20:25:46 CEST 2014 git clone https://github.com/torvalds/linux.git cd linux git checkout 3.17.0-rc4 git checkout -b bbb wget https://rcn-ee.net/deb/wheezy-armhf/v3.17.0-rc4-bone2/defconfig mv defconfig arch/arm/configs/beaglebone_defconfig make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- beaglebone_defconfig make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- menuconfig make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- LOADADDR=0x82000000 -j4 uImage dtbs make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- modules (don't use arm-linux-gnueabihf- ?) I took LOADADDR from uEnv.txt us the "uImage-dtb.am335x-boneblack" step necessary? Some other notes [4]. So with all these different approach I'm left with the questions: - does a vanilla kernel work or is a different branch necessary? - does the dtb need to be compiled in? - what about firmware? This[5] is the official one. Looks like it got switched to 3.14 recently[6]: So the "-bone" is close to mainline (small # of patches). The "-ti" we are a basing on a ti branch: (git.ti.com, patchset >20Mb).. Plus the 'debian' linux-image-armmp will also work once we switch to jessie.. (you can even install ubuntu's linux-image *.deb) the bootloader will find it. Maybe stick to 3.8? My bbb is running 3.8.13-bone47 which in git has moved to 3.8.13-bone64 This is compiled here[7]. That one does have CONFIG_UIO_PRUSS=m in config[8]. Let's try. [1] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git [2] https://rcn-ee.net/deb/wheezy-armhf/v3.17.0-rc4-bone2/defconfig [3] http://elinux.org/Building_BBB_Kernel [4] http://eewiki.net/display/linuxonarm/BeagleBone+Black [5] https://github.com/beagleboard/linux [6] http://permalink.gmane.org/gmane.comp.hardware.beagleboard.user/72908 [7] https://rcn-ee.net/deb/wheezy-armhf/v3.8.13-bone64/ [8] https://rcn-ee.net/deb/wheezy-armhf/v3.8.13-bone64/defconfig Entry: 3.8.13-bone64 /sys/class/uio Date: Sun Sep 14 22:00:27 CEST 2014 still empty.. [1] http://github.jfet.org/BBKNotes2.html Entry: UIO, remoteproc, rpmsg Date: Sun Sep 14 22:01:17 CEST 2014 [1] https://www.kernel.org/doc/htmldocs/uio-howto/about.html [2] https://www.kernel.org/doc/Documentation/remoteproc.txt [3] https://www.kernel.org/doc/Documentation/rpmsg.txt Entry: UIO or remoteproc/rpmsg Date: Sun Sep 14 22:15:26 CEST 2014 Maybe best to wait a bit until there is clarity!! [1] Posted by TimHarron on Aug 08 2014 10:00 AM 1. It is said that for next SDK based on kernel 3.14 LTS, the beaglebone community code and TI code will be pretty much aligned for PRU. I want to know in which direction either in UIO driver side or RemoteProc driver side, PRU software will be aligned ? A: We are going the remoteproc/rpmsg route. I believe the plan is to eventually phase out the uio driver completely, but to my knowledge that process has not yet begun in earnest. [1] http://e2e.ti.com/support/arm/sitara_arm/f/791/t/360568.aspx Entry: Conclusion Date: Sun Sep 14 22:17:49 CEST 2014 Not ready yet. Go back to 3.2 to get a working uio_pruss driver? asked on irc: 22:23 < doelie> hi. which kernel is recommended for playing with the PRUs? i tried 3.8.13-bone47 (original) and 3.8.13-bone64 but both seem to give empty /sys/class/uio after modprobe uio_pruss 22:23 < doelie> this is a bbb from digikey, 2 months ago, running debian 22:33 < LuaStoned> doelie what do you want to do with /sys/class/uio? 22:35 < doelie> LuaStoned: access the PRUs using libprussdrv.so -- is there another way? 22:36 -!- konradoo77 [~debian@151.248.42.178] has joined #beagle 22:37 < LuaStoned> well, I just started reading about the PRU two days ago.. this getting started guide helped me quite a bit: http://www.element14.com/community/community/designcenter/single-board-computers/next-gen_beaglebone//blog/2013/05/22/bbb--working-with-the-pru-icssprussv2 22:42 < doelie> thanks i'll have a look at the device tree stuff. 22:43 < doelie> what i read though is that kernel 3.8 has problems with the driver: 22:43 < doelie> https://groups.google.com/forum/?fromgroups=#!topic/beagleboard/gqCjxh4uZi0 22:43 < doelie> ppl mention using 3.2 22:44 < doelie> i wonder if a more recent one is better? 22:44 < LuaStoned> I tested various example programs and they seem to run fine? 22:44 < doelie> what kernel are you running? 22:44 < LuaStoned> btw I'm on 3.8.13-xenomai bone53 22:44 < doelie> did you compile from source? 22:44 < LuaStoned> Yeah 22:45 < doelie> ok i should probably try that.. where did you get the xenomai tree? 22:45 < LuaStoned> https://github.com/cdsteinkuehler/linux-dev 22:46 < LuaStoned> I'm pretty sure the default / most recent kernel works just fine if you follow the steps mentioned Entry: TODO: PRU Date: Sun Sep 14 22:51:05 CEST 2014 Follow instructions here [1] [1] http://www.element14.com/community/community/designcenter/single-board-computers/next-gen_beaglebone//blog/2013/05/22/bbb--working-with-the-pru-icssprussv2 Entry: Xenomai Date: Sun Sep 14 23:03:21 CEST 2014 https://github.com/cdsteinkuehler/linux-dev http://brunosmartins.info/xenomai-on-the-beaglebone-black-in-14-easy-steps/ rtnet: http://comments.gmane.org/gmane.linux.real-time.rtnet.user/4077 Entry: HDMI cape Date: Mon Sep 15 15:03:01 CEST 2014 Need to disable HDMI cape[1]. Before: root@beaglebone:~# cat /sys/devices/bone_capemgr.9/slots 0: 54:PF--- 1: 55:PF--- 2: 56:PF--- 3: 57:PF--- 4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G 5: ff:P-O-L Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI After disabling HDMI in uEnv.txt : ##Disable HDMI optargs=capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN root@beaglebone:/sys/devices/bone_capemgr.9# cat slots 0: 54:PF--- 1: 55:PF--- 2: 56:PF--- 3: 57:PF--- 4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G 5: ff:P-O-- Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI 6: ff:P-O-- Bone-Black-HDMIN,00A0,Texas Instrument,BB-BONELT-HDMIN root@beaglebone:/sys/devices/bone_capemgr.9# echo BB-BEAGLELOGIC > /sys/devices/bone_capemgr.*/slots [ 98.424752] bone-capemgr bone_capemgr.9: part_number 'BB-BEAGLELOGIC', version 'N/A' [ 98.424930] bone-capemgr bone_capemgr.9: slot #7: generic override [ 98.424974] bone-capemgr bone_capemgr.9: bone: Using override eeprom data at slot 7 [ 98.425023] bone-capemgr bone_capemgr.9: slot #7: 'Override Board Name,00A0,Override Manuf,BB-BEAGLELOGIC' [ 98.427402] bone-capemgr bone_capemgr.9: slot #7: Requesting part number/version based 'BB-BEAGLELOGIC-00A0.dtbo [ 98.427464] bone-capemgr bone_capemgr.9: slot #7: Requesting firmware 'BB-BEAGLELOGIC-00A0.dtbo' for board-name 'Override Board Name', version '00A0' [ 98.427521] bone-capemgr bone_capemgr.9: slot #7: dtbo 'BB-BEAGLELOGIC-00A0.dtbo' loaded; converting to live tree [ 98.428513] bone-capemgr bone_capemgr.9: slot #7: #2 overlays [ 98.449458] omap_hwmod: pruss: failed to hardreset [ 98.455454] pru-rproc 4a300000.prurproc: #8 PRU interrupts registered [ 98.455631] pru-rproc 4a300000.prurproc: sysevent-to-channel-map [17] <- 1 [ 98.455665] pru-rproc 4a300000.prurproc: sysevent-to-channel-map [18] <- 0 [ 98.455698] pru-rproc 4a300000.prurproc: sysevent-to-channel-map [19] <- 2 [ 98.455731] pru-rproc 4a300000.prurproc: sysevent-to-channel-map [20] <- 3 [ 98.455763] pru-rproc 4a300000.prurproc: sysevent-to-channel-map [21] <- 0 [ 98.455795] pru-rproc 4a300000.prurproc: sysevent-to-channel-map [22] <- 1 [ 98.455827] pru-rproc 4a300000.prurproc: sysevent-to-channel-map [24] <- 4 [ 98.455859] pru-rproc 4a300000.prurproc: sysevent-to-channel-map [25] <- 5 [ 98.455891] pru-rproc 4a300000.prurproc: sysevent-to-channel-map [26] <- 6 [ 98.455923] pru-rproc 4a300000.prurproc: sysevent-to-channel-map [27] <- 7 [ 98.455970] pru-rproc 4a300000.prurproc: channel-to-host-interrupt-map [0] <- 0 [ 98.456003] pru-rproc 4a300000.prurproc: channel-to-host-interrupt-map [1] <- 1 [ 98.456035] pru-rproc 4a300000.prurproc: channel-to-host-interrupt-map [2] <- 2 [ 98.456066] pru-rproc 4a300000.prurproc: channel-to-host-interrupt-map [3] <- 3 [ 98.456098] pru-rproc 4a300000.prurproc: channel-to-host-interrupt-map [4] <- 0 [ 98.456129] pru-rproc 4a300000.prurproc: channel-to-host-interrupt-map [5] <- 6 [ 98.456161] pru-rproc 4a300000.prurproc: channel-to-host-interrupt-map [6] <- 1 [ 98.456192] pru-rproc 4a300000.prurproc: channel-to-host-interrupt-map [7] <- 7 [ 98.456263] pru-rproc 4a300000.prurproc: found #2 PRUs [ 98.462551] pru-rproc 4a300000.prurproc: No resource-table node node; slave PRU [ 98.462674] pru-rproc 4a300000.prurproc: No resource-table node node; slave PRU [ 98.463097] remoteproc0: 4a300000.prurproc is available [ 98.463128] remoteproc0: Note: remoteproc is still under development and considered experimental. [ 98.463154] remoteproc0: THE BINARY FORMAT IS NOT YET FINALIZED, and backward compatibility isn't yet guaranteed. [ 98.468006] remoteproc0: powering up 4a300000.prurproc [ 98.525236] remoteproc0: failed to load beaglelogic-pru1 [ 98.531471] remoteproc0: request_firmware failed: -2 [ 98.537110] pru-rproc 4a300000.prurproc: rproc_boot failed [ 98.542994] remoteproc1: releasing 4a300000.prurproc [ 98.548496] pru-rproc: probe of 4a300000.prurproc failed with error -2 [ 98.549831] bone-capemgr bone_capemgr.9: slot #7: Applied #2 overlays. root@beaglebone:/sys/devices/bone_capemgr.9# modprobe beaglelogic [ 213.551129] BeagleLogic loaded and initializing [ 213.551224] beaglelogic: probe of pru-beaglelogic.12 failed with error -1 Missing firmware: -rw-r--r-- 1 root root 6679 Jun 22 18:38 beaglelogic-firmware.tar.gz -rw-r--r-- 1 debian admin 2566 Jun 22 18:36 BB-BEAGLELOGIC-00A0.dtbo -rw-rw-r-- 1 debian admin 11160 Jun 21 16:14 beaglelogic-pru0 -rw-rw-r-- 1 debian admin 12648 Jun 21 16:14 beaglelogic-pru1 Get it here[2] now it loads: root@beaglebone:~# echo BB-BEAGLELOGIC > /sys/devices/bone_capemgr.*/slots [ 35.172109] bone-capemgr bone_capemgr.9: part_number 'BB-BEAGLELOGIC', version 'N/A' [ 35.172287] bone-capemgr bone_capemgr.9: slot #7: generic override [ 35.172333] bone-capemgr bone_capemgr.9: bone: Using override eeprom data at slot 7 [ 35.172383] bone-capemgr bone_capemgr.9: slot #7: 'Override Board Name,00A0,Override Manuf,BB-BEAGLELOGIC' [ 35.172634] bone-capemgr bone_capemgr.9: slot #7: Requesting part number/version based 'BB-BEAGLELOGIC-00A0.dtbo [ 35.172681] bone-capemgr bone_capemgr.9: slot #7: Requesting firmware 'BB-BEAGLELOGIC-00A0.dtbo' for board-name 'Override Board Name', version '00A0' [ 35.172736] bone-capemgr bone_capemgr.9: slot #7: dtbo 'BB-BEAGLELOGIC-00A0.dtbo' loaded; converting to live tree [ 35.176193] bone-capemgr bone_capemgr.9: slot #7: #2 overlays [ 35.196956] omap_hwmod: pruss: failed to hardreset [ 35.203512] pru-rproc 4a300000.prurproc: #8 PRU interrupts registered [ 35.203690] pru-rproc 4a300000.prurproc: sysevent-to-channel-map [17] <- 1 [ 35.203727] pru-rproc 4a300000.prurproc: sysevent-to-channel-map [18] <- 0 [ 35.203760] pru-rproc 4a300000.prurproc: sysevent-to-channel-map [19] <- 2 [ 35.203793] pru-rproc 4a300000.prurproc: sysevent-to-channel-map [20] <- 3 [ 35.203824] pru-rproc 4a300000.prurproc: sysevent-to-channel-map [21] <- 0 [ 35.203856] pru-rproc 4a300000.prurproc: sysevent-to-channel-map [22] <- 1 [ 35.203888] pru-rproc 4a300000.prurproc: sysevent-to-channel-map [24] <- 4 [ 35.203920] pru-rproc 4a300000.prurproc: sysevent-to-channel-map [25] <- 5 [ 35.203952] pru-rproc 4a300000.prurproc: sysevent-to-channel-map [26] <- 6 [ 35.203983] pru-rproc 4a300000.prurproc: sysevent-to-channel-map [27] <- 7 [ 35.204029] pru-rproc 4a300000.prurproc: channel-to-host-interrupt-map [0] <- 0 [ 35.204062] pru-rproc 4a300000.prurproc: channel-to-host-interrupt-map [1] <- 1 [ 35.204094] pru-rproc 4a300000.prurproc: channel-to-host-interrupt-map [2] <- 2 [ 35.204125] pru-rproc 4a300000.prurproc: channel-to-host-interrupt-map [3] <- 3 [ 35.204156] pru-rproc 4a300000.prurproc: channel-to-host-interrupt-map [4] <- 0 [ 35.204188] pru-rproc 4a300000.prurproc: channel-to-host-interrupt-map [5] <- 6 [ 35.204220] pru-rproc 4a300000.prurproc: channel-to-host-interrupt-map [6] <- 1 [ 35.204251] pru-rproc 4a300000.prurproc: channel-to-host-interrupt-map [7] <- 7 [ 35.204323] pru-rproc 4a300000.prurproc: found #2 PRUs [ 35.208620] pru-rproc 4a300000.prurproc: No resource-table node node; slave PRU [ 35.208738] pru-rproc 4a300000.prurproc: No resource-table node node; slave PRU [ 35.209173] remoteproc0: 4a300000.prurproc is available [ 35.209203] remoteproc0: Note: remoteproc is still under development and considered experimental. [ 35.209229] remoteproc0: THE BINARY FORMAT IS NOT YET FINALIZED, and backward compatibility isn't yet guaranteed. [ 35.216359] remoteproc0: powering up 4a300000.prurproc [ 35.216746] remoteproc0: Booting fw image beaglelogic-pru1, size 12648 [ 35.216810] remoteproc0: PRU#1 bootcnt=0 [ 35.216838] remoteproc0: PRU#1 entry-point 0x764 [ 35.216864] remoteproc0: remote processor 4a300000.prurproc is now up [ 35.217084] remoteproc1: 4a300000.prurproc is available [ 35.217112] remoteproc1: Note: remoteproc is still under development and considered experimental. [ 35.217137] remoteproc1: THE BINARY FORMAT IS NOT YET FINALIZED, and backward compatibility isn't yet guaranteed. [ 35.220244] remoteproc1: powering up 4a300000.prurproc [ 35.220566] remoteproc1: Booting fw image beaglelogic-pru0, size 11160 [ 35.220626] remoteproc1: PRU#0 bootcnt=0 [ 35.220654] remoteproc1: PRU#0 entry-point 0x310 [ 35.220679] remoteproc1: remote processor 4a300000.prurproc is now up [ 35.220804] pru-rproc 4a300000.prurproc: Loaded OK [ 35.225423] bone-capemgr bone_capemgr.9: slot #7: Applied #2 overlays. root@beaglebone:~# modprobe beaglelogic [ 97.089144] BeagleLogic loaded and initializing [ 97.091533] misc beaglelogic: BeagleLogic PRU Firmware version: 0.2 [ 97.091624] misc beaglelogic: Device supports max 128 vector transfers [ 97.091700] misc beaglelogic: Valid PRU capture context structure found at offset 0000 [ 97.091763] misc beaglelogic: Default sample rate=50000000 Hz, sampleunit=1, triggerflags=0. Buffer in units of 4194304 bytes each [1] https://github.com/abhishek-kakkar/BeagleLogic/wiki/Getting-Started [2] https://github.com/abhishek-kakkar/BeagleLogic/wiki/Build-BeagleLogic Entry: capemgr Date: Mon Sep 15 15:26:30 CEST 2014 What does it mean to manage a cape? It's about dynamic device tree management. source: linux/firmware/capes installed: /lib/firmware [1] http://elinux.org/Capemgr Entry: Playing with kernel Date: Mon Sep 15 15:28:42 CEST 2014 First set up debricking strategy. Might be best to setup network boot, though doesn't add much value if booting from SD. Entry: Octavo OSD335x-SM has CM3 for power management Date: Wed Jan 31 21:26:10 EST 2018 Exactly what I was looking for! I don't find much documentation for it though. Lot's of bad information. I can't find it in the Octavo docs, so maybe it is just not there? http://linuxgizmos.com/tiny-pocketbeagle-is-the-rpi-zero-of-the-beaglebone-world/ "Dual 32-bit 200MHz Cortex-M3 based programmable real-time units (PRUs) for low-latency, real-time applications." https://hackaday.com/2017/09/23/the-tiny-25-pocketbone/ "What's up with the extra Cortex M3 in the description? It's not shown in the Octavio block diagram, but that would be kind neat to have on the side." "There's an M3 that's used for power management. If you want to use power scaling, then you load a firmware blob into the M3 at boot time. Otherwise it sits unused. I don't know if there's any other use for it." So definitely one m3 and two prus: root@pocket0:/sys# dmesg|grep remoteproc [ 2.279375] remoteproc0: wkup_m3 is available [ 2.279394] remoteproc0: Note: remoteproc is still under development and considered experimental. [ 2.279402] remoteproc0: THE BINARY FORMAT IS NOT YET FINALIZED, and backward compatibility isn't yet guaranteed. [ 2.377736] remoteproc0: powering up wkup_m3 [ 2.378069] remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217148 [ 2.378391] remoteproc0: remote processor wkup_m3 is now up [ 11.721878] remoteproc1: 4a338000.pru1 is available [ 11.721907] remoteproc1: Note: remoteproc is still under development and considered experimental. [ 11.721916] remoteproc1: THE BINARY FORMAT IS NOT YET FINALIZED, and backward compatibility isn't yet guaranteed. [ 11.722585] remoteproc1: powering up 4a338000.pru1 [ 11.722764] remoteproc1: Booting fw image am335x-pru1-fw, size 35392 [ 11.722827] remoteproc1: remote processor 4a338000.pru1 is now up [ 11.723394] remoteproc2: 4a334000.pru0 is available [ 11.723409] remoteproc2: Note: remoteproc is still under development and considered experimental. [ 11.723417] remoteproc2: THE BINARY FORMAT IS NOT YET FINALIZED, and backward compatibility isn't yet guaranteed. [ 11.724957] remoteproc2: powering up 4a334000.pru0 [ 11.725204] remoteproc2: Booting fw image am335x-pru0-fw, size 36296 [ 11.725267] remoteproc2: remote processor 4a334000.pru0 is now up https://plus.google.com/+HennerZeller/posts/ctNDjUx5VCp "What is the ARM Cortex-M3 in the #pocketbeagle for and how can I make use of it ?" https://github.com/beagleboard/am33x-cm3 https://github.com/beagleboard/am33x-cm3/blob/master/Documentation/SA_PM_Firmware.pdf So looks like this is best left alone -- integral to how the system works? Entry: PRU SRAM->DRAM path Date: Thu Feb 1 14:54:05 EST 2018 https://github.com/abhishek-kakkar/BeagleLogic/wiki PRU1 is the sampler: R31 -> R21-R28, then across broadside https://github.com/abhishek-kakkar/BeagleLogic/blob/master/firmware/beaglelogic-pru1-core.asm XOUT 10, &R21, 36 LDI R31, PRU1_PRU0_INTERRUPT + 16 ; jab PRU0 PRU0 moves data from register file out to RAM? ; Wait for and clear the buffer ready signal from PRU1 WBS R31, 30 SBCO &R0, C0, 0x24, 4 XIN 10, &R21, 36 ; Get the logic data from PRU1 SBBO &R21, R18, 0, 32 ; Write buffer ; Signal ARM that one buffer is now ready LDI R31, 32 | (SYSEV_PRU0_TO_ARM_A - 16) Questions: - broadside connect with XOUT,XIN ? See 5.2.4 https://elinux.org/images/d/da/Am335xPruReferenceGuide.pdf PRU0/1 Scratch Pad Scratch pad (SPAD) memory and broadside direct connect, transfer in one clock cycle between PRU0,SPAD, then again SPAD,PRU1. There are 3 banks. - SBCO, SBBO? Store Byte Burst with Constant Table Offset (SBCO) Store Byte Burst (SBBO) So what memory does this go into? Passed into the run() routine. It's passed in through capture_context which is set at 0x0000 So it appears that: - ARM can access this memory - We can write in to ARM memory ARM uses: #include pruss_request_mem_region(bldev->pruss, PRUSS_MEM_DRAM0, &bldev->pru0sram); Phytec alsho has a board.. Here's some source: https://stash.phytec.com/projects/PUB/repos/linux-phytec-ti/browse For code, it seems simplest to start the project as a modification of the beagle logic PRU firmware and Linux driver. Entry: Buildroot Date: Sun Mar 11 10:38:12 EDT 2018 Problem: serial port config. I need console access first. dd if=/i/buildroot/home/tom/exo/br/target/bbb/images/sdcard.img sdcard.img doesn't work. the backup bootloader does start. maybe instead of using sd card, use network boot for now? board_name=[A335PBGL] ... I guess the question is: why doesn't the buildroot image boot out of the box on PocketBeagle? Skip this step? Use the bootloader + /boot directory including kernel from the debian image. Just get it to work asap. TODO: also copy /lib/firmware TODO: mkdir dev run U-Boot SPL 2017.09-00002-g0f3f1c7907 (Oct 09 2017 - 15:30:2 Trying to boot from MMC1 U-Boot 2017.09-00002-g0f3f1c7907 (Oct 09 2017 - 15:30:22 -0otloader-Builder-607 CPU : AM335X-GP rev 2.1 I2C: ready DRAM: 512 MiB No match for driver 'omap_hsmmc' No match for driver 'omap_hsmmc' Some drivers were not found Reset Source: Power-on reset has occurred. MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1 Using default environment Model: BeagleBoard.org PocketBeagle not set. Validating first E-fuse MAC Net: No ethernet found. Press SPACE to abort autoboot in 2 seconds board_name=[A335PBGL] ... switch to partitions #0, OK mmc0 is current device SD/MMC found on device 0 ** Bad device 0:2 0x82000000 ** ** Bad device 0:2 0x82000000 ** switch to partitions #0, OK mmc0 is current device Scanning mmc 0:1... gpio: pin 56 (gpio 56) value is 0 gpio: pin 55 (gpio 55) value is 0 gpio: pin 54 (gpio 54) value is 0 gpio: pin 53 (gpio 53) value is 1 switch to partitions #0, OK mmc0 is current device gpio: pin 54 (gpio 54) value is 1 Checking for: /uEnv.txt ... Checking for: /boot.scr ... Checking for: /boot/boot.scr ... Checking for: /boot/uEnv.txt ... gpio: pin 55 (gpio 55) value is 1 2045 bytes read in 17 ms (117.2 KiB/s) Loaded environment from /boot/uEnv.txt Checking if uname_r is set in /boot/uEnv.txt... gpio: pin 56 (gpio 56) value is 1 Running uname_boot ... loading /boot/vmlinuz-4.4.91-ti-r133 ... 8886912 bytes read in 579 ms (14.6 MiB/s) loading /boot/dtbs/4.4.91-ti-r133/am335x-pocketbeagle.dtb ... 117513 bytes read in 69 ms (1.6 MiB/s) uboot_overlays: [fdt_buffer=0x60000] ... uboot_overlays: unable to find [mmc 0:1 /lib/firmware/AM335X-PRU-RPROC-4-4-TI-00A0.dtbo]... loading /boot/initrd.img-4.4.91-ti-r133 ... 5416133 bytes read in 357 ms (14.5 MiB/s) debug: [console=ttyO0,115200n8 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 quiet] ... debug: [bootz 0x82000000 0x88080000:52a4c5 0x88000000] ... ## Flattened Device Tree blob at 88000000 Booting using the fdt blob at 0x88000000 Loading Ramdisk to 8fad5000, end 8ffff4c5 ... OK Loading Device Tree to 8fab5000, end 8fad4b08 ... OK Starting kernel ... [ 0.001715] clocksource_probe: no matching clocksources found [ 2.126777] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle [ 2.285522] omap_voltage_late_init: Voltage driver support not added [ 2.293789] PM: Cannot get wkup_m3_ipc handle [ 2.816589] musb-hdrc musb-hdrc.1.auto: VBUS_ERROR in a_wait_vrise (80, git clone https://github.com/abhishek-kakkar/BeagleLogic cd BeagleLogic sudo ./install.sh First, I need the tools. See if he has an image with the tools installed? tom@panda:~/humanetics/BeagleLogic/firmware$ make Makefile:28: *** ******************************************************************************* PRU_CGT environment variable is not set. Examples given: (Desktop Linux) export PRU_CGT=/path/to/pru/code/gen/tools/ti-cgt-pru_2.1.2 (Windows) set PRU_CGT=C:/path/to/pru/code/gen/tools/ti-cgt-pru_2.1.2 (ARM Linux*) export PRU_CGT=/usr/share/ti/cgt-pru *ARM Linux also needs to create a symbolic link to the /usr/bin/ directory in order to use the same Makefile (ARM Linux) ln -s /usr/bin/ /usr/share/ti/cgt-pru/bin ******************************************************************************* . Stop. Entry: Pin muxing Date: Thu Apr 19 11:10:21 EDT 2018 http://www.ofitselfso.com/BeagleNotes/BeagleboneBlackPinMuxModes.php This has similar information for the pocketbeagle, spread out over multiple tables: https://github.com/beagleboard/pocketbeagle/wiki/System-Reference-Manual#31_Whats_In_the_Package How does the beaglelogic configure this? What is the beaglebone default? I find several confusing differences. - writing pinmux directly: https://stackoverflow.com/questions/27892485/how-can-i-edit-a-pinmux-for-beaglebone-black-on-linux-kernel-3-17 Entry: BBB SRM Date: Thu Apr 19 12:35:39 EDT 2018 https://github.com/beagleboard/beaglebone-black/wiki/System-Reference-Manual Entry: Installing TI tools Date: Tue May 1 11:42:53 EDT 2018 tom@panda:~/humanetics/notes/pru$ ./ti_cgt_pru_2.2.1_linux_installer_x86.bin ---------------------------------------------------------------------------- Created with an evaluation version of BitRock InstallBuilder Welcome to the PRU Code Generation Tools Setup Wizard. ---------------------------------------------------------------------------- Select Installation Directory Please specify the directory where PRU Code Generation Tools will be installed. The installation requires 150917 KB. Destination Directory [/home/tom/priv/git-private/humanetics/notes/pru/ti-cgt-pru_2.2.1]: /home/tom/lib/ti-cgt-pru_2.2.1 ---------------------------------------------------------------------------- Setup is now ready to begin installing PRU Code Generation Tools on your computer. Do you want to continue? [Y/n]: y ---------------------------------------------------------------------------- Please wait while Setup installs PRU Code Generation Tools on your computer. Installing 0% ______________ 50% ______________ 100% ######################################### ---------------------------------------------------------------------------- Setup has finished installing PRU Code Generation Tools on your computer. tom@panda:~/humanetics/BeagleLogic/firmware$ export PRU_CGT=/home/tom/lib/ti-cgt-pru_2.2.1 tom@panda:~/humanetics/BeagleLogic/firmware$ make ************************************************************ Building project: firmware Building file: beaglelogic-pru0.c Invoking: PRU Compiler /home/tom/lib/ti-cgt-pru_2.2.1/bin/clpru --include_path=/home/tom/lib/ti-cgt-pru_2.2.1/include --include_path=/usr/lib/ti/pru-software-support-package/include --include_path=/usr/lib/ti/pru-software-support-package/include/am335x -v3 -O2 --display_error_number --endian=little --hardware_mac=on --obj_directory=release --pp_directory=release -ppd -ppa -fe release/beaglelogic-pru0.object beaglelogic-pru0.c "beaglelogic-pru0.c", line 18: fatal error #1965: cannot open source file "pru_cfg.h" 1 catastrophic error detected in the compilation of "beaglelogic-pru0.c". Compilation terminated. >> Compilation failure Makefile:101: recipe for target 'release/beaglelogic-pru0.object' failed make: *** [release/beaglelogic-pru0.object] Error 1 Different tools version? Nope. Tried different tools, but pru_cfg.h is not included. These are likely from the linux kernel. Maybe try to build kernel driver first. Entry: BeagleLogic archive Date: Tue May 1 11:46:53 EDT 2018 Starting here: tom@panda:~/humanetics/BeagleLogic$ git-log |head 3cea157d312a685547a2ca9aa66cefacd1fd2cee docs: Fix BeagleLogic standalone link Entry: Beaglelogic kernel driver Date: Tue May 1 12:02:45 EDT 2018 Get the kernel version currently running on the beaglebone. root@bone1:~# cat /proc/version Linux version 4.4.91-ti-r133 (root@b7-am57xx-beagle-x15-2gb) (gcc version 6.3.0 20170516 (Debian 6.3.0-18) ) #1 SMP Tue Oct 10 05:18:08 UTC 2017 Track this down. Find the damn kernel, basically. https://github.com/beagleboard/linux tom@panda:~/humanetics$ git clone https://github.com/beagleboard/linux.git tom@panda:~/humanetics/linux-beagleboard$ git checkout 4.14-rt tom@panda:~/humanetics/linux-beagleboard$ find -name '*bb.org*defconfig' ./arch/arm/configs/bb.org_defconfig tom@panda:~/humanetics/linux-beagleboard$ cp arch/arm/configs/bb.org_defconfig .config Entry: using buildroot Date: Wed May 2 17:22:09 EDT 2018 Seems some things are not compatible. tom@buildroot:~/BeagleLogic$ ./hatd_build.sh [ ! -z "$CROSS_COMPILE" ] make -C /home/tom/gw_buildroot/target/bbb/build/linux-adde2ca9f86797071f6e7b2b9e779fa5e4a8f3cd M=/home/tom/BeagleLogic/kernel ARCH=arm modules make[1]: Entering directory '/home/tom/gw_buildroot/target/bbb/build/linux-adde2ca9f86797071f6e7b2b9e779fa5e4a8f3cd' CC [M] /home/tom/BeagleLogic/kernel/beaglelogic.o /home/tom/BeagleLogic/kernel/beaglelogic.c: In function 'beaglelogic_probe': /home/tom/BeagleLogic/kernel/beaglelogic.c:1203:17: error: too many arguments to function 'pruss_get' bldev->pruss = pruss_get(dev, NULL); ^~~~~~~~~ In file included from /home/tom/BeagleLogic/kernel/beaglelogic.c:24:0: include/linux/pruss.h:101:29: note: declared here static inline struct pruss *pruss_get(struct device *dev) ^~~~~~~~~ /home/tom/BeagleLogic/kernel/beaglelogic.c:1263:8: error: implicit declaration of function 'rproc_set_firmware' [-Werror=implicit-function-declaration] ret = rproc_set_firmware(bldev->pru0, bldev->fw_data->fw_names[0]); ^~~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors scripts/Makefile.build:264: recipe for target '/home/tom/BeagleLogic/kernel/beaglelogic.o' failed make[2]: *** [/home/tom/BeagleLogic/kernel/beaglelogic.o] Error 1 Makefile:1401: recipe for target '_module_/home/tom/BeagleLogic/kernel' failed make[1]: *** [_module_/home/tom/BeagleLogic/kernel] Error 2 make[1]: Leaving directory '/home/tom/gw_buildroot/target/bbb/build/linux-adde2ca9f86797071f6e7b2b9e779fa5e4a8f3cd' Makefile:11: recipe for target 'all' failed make: *** [all] Error 2 tom@buildroot:~/BeagleLogic$ Maybe first figure out what version of kernel to use, then to adjust buildroot? What is buildroot using? BR2_LINUX_KERNEL_CUSTOM_REPO_URL="git://git.ti.com/processor-sdk/processor-sdk-linux.git" BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="adde2ca9f86797071f6e7b2b9e779fa5e4a8f3cd" BR2_LINUX_KERNEL_DEFCONFIG="omap2plus" BR2_LINUX_KERNEL_INTREE_DTS_NAME="am335x-evm am335x-bone am335x-boneblack am335x-evmsk" Buildroot bump patch was introduced 2017-01-18: http://buildroot-busybox.2317881.n4.nabble.com/PATCH-configs-beaglebone-bump-kernel-version-to-4-4-32-td154604.html This is mentioned in the readme: v4.9.31-ti-r41 So not clear what to do here.. Pick out that particular version? Let's clone the repo and see what patches are there. Current buildroot head has: a75d8e93056181d512f6c818e8627bd4554aaf92 http://processors.wiki.ti.com/index.php/Processor_SDK_Linux_Kernel_Release_Notes based on 4.9.59 That should work Just change it? Let's diff it first https://raw.githubusercontent.com/buildroot/buildroot/master/configs/beaglebone_defconfig tom@buildroot:~$ diff -Naur gw_buildroot/buildroot/configs/beaglebone_defconfig /tmp/beaglebone_defconfig --- gw_buildroot/buildroot/configs/beaglebone_defconfig 2018-03-14 20:22:35.356150976 +0000 +++ /tmp/beaglebone_defconfig 2018-05-02 21:41:49.322782612 +0000 @@ -1,13 +1,13 @@ BR2_arm=y BR2_cortex_a8=y BR2_GLOBAL_PATCH_DIR="board/beaglebone/patches" -BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_4=y +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_9=y BR2_TARGET_GENERIC_GETTY_PORT="ttyO0" BR2_ROOTFS_POST_IMAGE_SCRIPT="board/beaglebone/post-image.sh" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="git://git.ti.com/processor-sdk/processor-sdk-linux.git" -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="f9f6f0db2d5e4f9d2ff46eb31a5a05276a92ed7d" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="a75d8e93056181d512f6c818e8627bd4554aaf92" BR2_LINUX_KERNEL_DEFCONFIG="omap2plus" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="am335x-evm am335x-bone am335x-boneblack am335x-bonegreen am335x-evmsk" @@ -16,13 +16,11 @@ BR2_TARGET_UBOOT=y BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y BR2_TARGET_UBOOT_CUSTOM_VERSION=y -BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2016.09.01" +BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2018.01" BR2_TARGET_UBOOT_BOARD_DEFCONFIG="am335x_evm" BR2_TARGET_UBOOT_NEEDS_DTC=y # BR2_TARGET_UBOOT_FORMAT_BIN is not set BR2_TARGET_UBOOT_FORMAT_IMG=y -BR2_TARGET_UBOOT_FORMAT_CUSTOM=y -BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="spl/u-boot-spl.bin" BR2_TARGET_UBOOT_SPL=y BR2_TARGET_UBOOT_SPL_NAME="MLO" BR2_PACKAGE_HOST_DOSFSTOOLS=y Maybe just use the file as-is. Or upgrade the entire thing? I'm not sure about this: variable name changed: -BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_4=y +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_9=y I don't want to mess with this.. What if the default changed? Maybe just use current master buildroot? Ok, my current buildroot is actually a patched version with a downgraded erlang. EDIT: I had the wrong version... compiling again... EDIT: Erlang broken.. disabling for now Ok, boots and kernel module builds: tom@buildroot:~/BeagleLogic$ ./hatd_build.sh [ ! -z "$CROSS_COMPILE" ] make -C /home/tom/gw_buildroot/target/bbb/build/linux-a75d8e93056181d512f6c818e8627bd4554aaf92 M=/home/tom/BeagleLogic/kernel ARCH=arm modules make[1]: Entering directory '/home/tom/gw_buildroot/target/bbb/build/linux-a75d8e93056181d512f6c818e8627bd4554aaf92' CC [M] /home/tom/BeagleLogic/kernel/beaglelogic.o Building modules, stage 2. MODPOST 1 modules WARNING: "rproc_shutdown" [/home/tom/BeagleLogic/kernel/beaglelogic.ko] undefined! CC /home/tom/BeagleLogic/kernel/beaglelogic.mod.o LD [M] /home/tom/BeagleLogic/kernel/beaglelogic.ko make[1]: Leaving directory '/home/tom/gw_buildroot/target/bbb/build/linux-a75d8e93056181d512f6c818e8627bd4554aaf92' But pru_cfg.h is still missing. Is this somehow generated from something else? Entry: Missing header files Date: Wed May 2 21:57:44 EDT 2018 Found some here: https://github.com/dinuxbg/pru-gcc-examples/tree/master/hc-sr04-range-sensor/include/am335x Why are they not in the compiler tools? Here: https://github.com/jadonk/pru-software-support-package # Point to PRU SW Support Package installation # On a Debian BeagleBoard image this is at the following location PRU_SP_PATH ?= /usr/lib/ti/pru-software-support-package Still errors.. Different version still? http://www.ti.com/tool/PRU-SWPKG EDIT: I can compile module + PRU firmware on an image that boots up properly. Next is to figure out how to set run time config Entry: BeagleLogic run time config Date: Thu May 3 08:38:39 EDT 2018 # insmod beaglelogic.ko [39727.894926] beaglelogic: loading out-of-tree module taints kernel. [39727.901773] beaglelogic: Unknown symbol rproc_shutdown (err 0) [39727.911249] beaglelogic: Unknown symbol rproc_shutdown (err 0) insmod: can't insert 'beaglelogic.ko': unknown symbol in module, or unknown parameter Yeah what the flying fuck. This doesn't seem to come with PRU support. Entry: remoteproc Date: Thu May 3 12:05:57 EDT 2018 I had to work around running linux-menuconfig in buildroot. Using this line, which has HOSTCC variable removed from default: BR_BINARIES_DIR=/home/tom/gw_buildroot/target/bbb/images PKG_CONFIG_PATH="" /usr/bin/make -j24 -C /home/tom/gw_buildroot/target/bbb/build/linux-a75d8e93056181d512f6c818e8627bd4554aaf92 ARCH=arm INSTALL_MOD_PATH=/home/tom/gw_buildroot/target/bbb/target CROSS_COMPILE="/home/tom/gw_buildroot/target/bbb/host/bin/arm-buildroot-linux-uclibcgnueabihf-" DEPMOD=/home/tom/gw_buildroot/target/bbb/host/sbin/depmod INSTALL_MOD_STRIP=1 menuconfig Device Drivers -> Remoteproc drivers -> TI PRUSS remoteproc support tom@buildroot:~/gw_buildroot/target/bbb/build/linux-a75d8e93056181d512f6c818e8627bd4554aaf92$ cat .config|grep PRUSS CONFIG_PRUSS_REMOTEPROC=m I'm still not sure if this is right. I.e. does buildroot mess with the .config file I just created, or does it save it somewhere else? Modules are in the image, and they load, but no console messages about the processors. Likely, this is a device tree thing. So I think this is enough for now. Next: try to rebuild the exact kernel used in the default distribution, and get the device tree config. So the question is, where to get that information? Maybe at this point it makes sense to switch back to Debian? Entry: Beagle kernel configuration Date: Thu May 3 12:33:20 EDT 2018 What I need is two different DTS files: - beaglebone.org - buildroot Looking into /scp:tom@buildroot.zoo:/home/tom/gw_buildroot/defconfig/linux_bbb.defconfig CONFIG_ARM_APPENDED_DTB=y Appens DT to kernel image. I still don't see where the DTS is at. Look at the bootloader configuration. # mount /dev/mmcblk0p1 p1 # cd p1 # ls -al total 6212 drwxr-xr-x 2 root root 16384 Jan 1 1970 . drwxrwxrwt 3 root root 120 May 3 17:27 .. -rwxr-xr-x 1 root root 84396 May 3 16:16 MLO -rwxr-xr-x 1 root root 35961 May 3 16:16 am335x-bone.dtb -rwxr-xr-x 1 root root 37853 May 3 16:16 am335x-boneblack.dtb -rwxr-xr-x 1 root root 36217 May 3 16:16 am335x-bonegreen.dtb -rwxr-xr-x 1 root root 42939 May 3 16:16 am335x-evm.dtb -rwxr-xr-x 1 root root 41541 May 3 16:16 am335x-evmsk.dtb -rwxr-xr-x 1 root root 657632 May 3 16:16 u-boot.img -rwxr-xr-x 1 root root 376 May 3 16:16 uEnv.txt -rwxr-xr-x 1 root root 5397112 May 3 16:16 zImage # cat uEnv.txt bootpart=0:1 devtype=mmc bootdir= bootfile=zImage bootpartition=mmcblk0p2 set_mmc1=if test $board_name = A33515BB; then setenv bootpartition mmcblk1p2; fi set_bootargs=setenv bootargs console=ttyO0,115200n8 root=/dev/${bootpartition} rw rootfstype=ext4 rootwait uenvcmd=run set_mmc1; run set_bootargs;run loadimage;run loadfdt;printenv bootargs;bootz ${loadaddr} - ${fdtaddr} Let's look at the bootloader inside of it. loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile} board_name=A335BNLT if test $board_name = A335BNLT; then setenv fdtfile am335x-boneblack.dtb; How is this all configured? Is set to use this: uboot-2018.01/configs/am335x_evm_defconfig Can't make much sense of this... Is there a manual or something? Am I supposed to just know what to do here? I really need to figure out how the original images are booting. https://wiki.beyondlogic.org/index.php/BeagleBoneBlack_Building_Kernel Entry: bb.org_defconfig Date: Thu May 3 13:54:02 EDT 2018 googling for "bb.org_defconfig git" I arrive here: https://github.com/beagleboard/linux https://github.com/beagleboard/linux/blob/51dd09146da1e25a03f79bfac49cbf8f08812a0c/arch/arm/configs/bb.org_defconfig So that's a starting point. Current pocket1 is running: root@pocket1:~# cat /proc/version Linux version 4.4.91-ti-r133 (root@b7-am57xx-beagle-x15-2gb) (gcc version 6.3.0 20170516 (Debian 6.3.0-18) ) #1 SMP Tue Oct 10 05:18:08 UTC 2017 There are a LOT of dtb files in the standard distro: am335x-abbbi.dtb am335x-boneblack-wl1835mod.dtb am335x-siriusDEB.dtb am57xx-evm-reva3.dtb am335x-arduino-tre.dtb am335x-boneblue-ArduPilot.dtb am335x-sl50.dtb dra71-evm.dtb am335x-baltos-ir5221.dtb am335x-boneblue.dtb am335x-vsc8531bbb.dtb dra71-evm-lcd-auo-g101evn01.0.dtb am335x-base0033.dtb am335x-bone-cape-bone-argus.dtb am335x-wega-rdk.dtb dra72-evm.dtb am335x-boneblack-audio.dtb am335x-bone.dtb am437x-gp-evm.dtb dra72-evm-lcd-lg.dtb am335x-boneblack-bbb-exp-c.dtb am335x-bonegreen-ctag-face.dtb am437x-gp-evm-hdmi.dtb dra72-evm-lcd-osd101t2587.dtb am335x-boneblack-bbb-exp-r.dtb am335x-bonegreen.dtb am437x-idk-evm.dtb dra72-evm-lcd-osd.dtb am335x-boneblack-bbbmini.dtb am335x-bonegreen-modio.dtb am437x-sk-evm.dtb dra72-evm-revc.dtb am335x-boneblack-cape-bone-argus.dtb am335x-bonegreen-overlay.dtb am43x-epos-evm.dtb dra72-evm-revc-lcd-osd101t2045.dtb am335x-boneblack-ctag-face.dtb am335x-bonegreen-wireless.dtb am571x-idk.dtb dra72-evm-revc-lcd-osd101t2587.dtb am335x-boneblack.dtb am335x-chiliboard.dtb am571x-idk-lcd-osd101t2587.dtb dra76-evm.dtb am335x-boneblack-emmc-overlay.dtb am335x-evm.dtb am571x-idk-lcd-osd.dtb dra7-evm.dtb am335x-boneblack-hdmi-overlay.dtb am335x-evmsk.dtb am571x-sndrblock.dtb dra7-evm-lcd-lg.dtb am335x-boneblack-lcd-ct43.dtb am335x-icev2.dtb am572x-idk.dtb dra7-evm-lcd-osd101t2587.dtb am335x-boneblack-modio.dtb am335x-lxm.dtb am572x-idk-lcd-osd101t2587.dtb dra7-evm-lcd-osd.dtb am335x-boneblack-nhdmi-overlay.dtb am335x-nano.dtb am572x-idk-lcd-osd.dtb omap5-cm-t54.dtb am335x-boneblack-overlay.dtb am335x-olimex-som.dtb am57xx-beagle-x15-ctag.dtb omap5-igep0050.dtb am335x-boneblack-roboticscape.dtb am335x-pepper.dtb am57xx-beagle-x15.dtb omap5-sbc-t54.dtb am335x-boneblack-uboot.dtb am335x-pocketbeagle.dtb am57xx-beagle-x15-revb1-ctag.dtb omap5-uevm.dtb am335x-boneblack-wireless.dtb am335x-pocketbone.dtb am57xx-beagle-x15-revb1.dtb am335x-boneblack-wireless-emmc-overlay.dtb am335x-sancloud-bbe.dtb am57xx-beagle-x15-revc.dtb am335x-boneblack-wireless-roboticscape.dtb am335x-sancloud-bbe-uboot.dtb am57xx-evm.dtb https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays Entry: Let's just try this -- I'm thoroughly confused Date: Thu May 3 14:23:53 EDT 2018 Version is arbitrary current version. tom@buildroot:~/gw_buildroot/defconfig$ git diff bbb diff --git a/defconfig/bbb b/defconfig/bbb index 4f0c200..7816ca0 100644 --- a/defconfig/bbb +++ b/defconfig/bbb @@ -1,7 +1,7 @@ BR2_arm=y BR2_cortex_a8=y BR2_GLOBAL_PATCH_DIR="board/beaglebone/patches" -BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_9=y +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_4=y BR2_TOOLCHAIN_BUILDROOT_CXX=y BR2_TARGET_GENERIC_GETTY_PORT="ttyO0" BR2_ROOTFS_POST_BUILD_SCRIPT="$(BASE_DIR)/../../bin/post_build.sh" @@ -9,11 +9,11 @@ BR2_ROOTFS_POST_FAKEROOT_SCRIPT="$(BASE_DIR)/../../bin/post_fakeroot.sh" BR2_ROOTFS_POST_IMAGE_SCRIPT="board/beaglebone/post-image.sh" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y -BR2_LINUX_KERNEL_CUSTOM_REPO_URL="git://git.ti.com/processor-sdk/processor-sdk-linux.git" -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="a75d8e93056181d512f6c818e8627bd4554aaf92" -BR2_LINUX_KERNEL_DEFCONFIG="omap2plus" +BR2_LINUX_KERNEL_CUSTOM_REPO_URL="git://github.com/beagleboard/linux.git" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="51dd09146da1e25a03f79bfac49cbf8f08812a0c" +BR2_LINUX_KERNEL_DEFCONFIG="bb.org" BR2_LINUX_KERNEL_DTS_SUPPORT=y -BR2_LINUX_KERNEL_INTREE_DTS_NAME="am335x-evm am335x-bone am335x-boneblack am335x-bonegreen am335x-evmsk" +BR2_LINUX_KERNEL_INTREE_DTS_NAME="am335x-boneblack" BR2_PACKAGE_E2FSPROGS=y BR2_PACKAGE_ERLANG=y BR2_PACKAGE_SQLITE=y Once that boots, prune it. It's probably easier to prune it once everything is running and the list of modules is known exactly. # find -name '*.ko' |grep pru ./modules/4.4.113/kernel/drivers/rpmsg/rpmsg_pru.ko ./modules/4.4.113/kernel/drivers/net/ethernet/ti/prueth.ko ./modules/4.4.113/kernel/drivers/uio/uio_pruss.ko ./modules/4.4.113/kernel/drivers/remoteproc/am437x_pruss_wrapper.ko ./modules/4.4.113/kernel/drivers/remoteproc/pruss_intc.ko ./modules/4.4.113/kernel/drivers/remoteproc/pruss.ko ./modules/4.4.113/kernel/drivers/remoteproc/pru_rproc.ko Buildroot has trouble with that kernel: can't open /dev/ttyO0: No such file or directory # ln -s ttyS0 ttyO0 This is likely a bootloader option. For now it is ok to leave it, since network login is possible. Next: load the pru firmware. What's the difference between what remoteproc expects: am335x-pru0-fw, am335x-pru1-fw And: tom@buildroot:~/BeagleLogic$ find -name '*.out' ./firmware/release/beaglelogic-pru0.out ./firmware/release/beaglelogic-pru1.out Just copied them over. [ 1342.264407] remoteproc1: 4a334000.pru0 is available [ 1342.269578] remoteproc1: Note: remoteproc is still under development and considered experimental. [ 1342.278634] remoteproc1: THE BINARY FORMAT IS NOT YET FINALIZED, and backward compatibility isn't yet guaranteed. [ 1342.290571] pru-rproc 4a334000.pru0: booting the PRU core manually [ 1342.297023] remoteproc1: powering up 4a334000.pru0 [ 1342.302734] remoteproc1: Booting fw image am335x-pru0-fw, size 56216 [ 1342.309586] ti-pruss 4a300000.pruss: configured system_events = 0x0000000001d30000 intr_channels = 0x00000037 host_intr = 0x00000037 [ 1342.321630] remoteproc1: remote processor 4a334000.pru0 is now up [ 1342.327894] pru-rproc 4a334000.pru0: PRU rproc node /ocp/pruss@4a300000/pru0@4a334000 probed successfully [ 1342.338566] remoteproc2: 4a338000.pru1 is available [ 1342.343658] remoteproc2: Note: remoteproc is still under development and considered experimental. [ 1342.352699] remoteproc2: THE BINARY FORMAT IS NOT YET FINALIZED, and backward compatibility isn't yet guaranteed. [ 1342.364161] pru-rproc 4a338000.pru1: booting the PRU core manually [ 1342.370584] remoteproc2: powering up 4a338000.pru1 [ 1342.376136] remoteproc2: Booting fw image am335x-pru1-fw, size 31296 [ 1342.382770] remoteproc2: remote processor 4a338000.pru1 is now up [ 1342.389052] pru-rproc 4a338000.pru1: PRU rproc node /ocp/pruss@4a300000/pru1@4a338000 probed successfully Well at least there are no errors, and it seems to notice that there are interrupts PRU0->ARM. Entry: DTS Date: Thu May 3 15:39:10 EDT 2018 Where is it? tom@buildroot:~/gw_buildroot/target/bbb/build/linux-51dd09146da1e25a03f79bfac49cbf8f08812a0c$ find -name '*.dts' |grep bone ./arch/arm/boot/dts/am335x-bone-cape-bone-argus.dts ./arch/arm/boot/dts/am335x-bone.dts ./arch/arm/boot/dts/am335x-boneblack-audio.dts ./arch/arm/boot/dts/am335x-boneblack-bbb-exp-c.dts ./arch/arm/boot/dts/am335x-boneblack-bbb-exp-r.dts ./arch/arm/boot/dts/am335x-boneblack-bbbmini.dts ./arch/arm/boot/dts/am335x-boneblack-cape-bone-argus.dts ./arch/arm/boot/dts/am335x-boneblack-ctag-face.dts ./arch/arm/boot/dts/am335x-boneblack-custom.dts ./arch/arm/boot/dts/am335x-boneblack-emmc-overlay.dts ./arch/arm/boot/dts/am335x-boneblack-hdmi-overlay.dts ./arch/arm/boot/dts/am335x-boneblack-lcd-ct43.dts ./arch/arm/boot/dts/am335x-boneblack-modio.dts ./arch/arm/boot/dts/am335x-boneblack-nhdmi-overlay.dts ./arch/arm/boot/dts/am335x-boneblack-overlay.dts ./arch/arm/boot/dts/am335x-boneblack-roboticscape.dts ./arch/arm/boot/dts/am335x-boneblack-uboot.dts ./arch/arm/boot/dts/am335x-boneblack-wireless-emmc-overlay.dts ./arch/arm/boot/dts/am335x-boneblack-wireless-roboticscape.dts ./arch/arm/boot/dts/am335x-boneblack-wireless.dts ./arch/arm/boot/dts/am335x-boneblack-wl1835mod.dts ./arch/arm/boot/dts/am335x-boneblack.dts ./arch/arm/boot/dts/am335x-boneblue-ArduPilot.dts ./arch/arm/boot/dts/am335x-boneblue-mmap.dts ./arch/arm/boot/dts/am335x-boneblue.dts ./arch/arm/boot/dts/am335x-bonegreen-ctag-face.dts ./arch/arm/boot/dts/am335x-bonegreen-modio.dts ./arch/arm/boot/dts/am335x-bonegreen-overlay.dts ./arch/arm/boot/dts/am335x-bonegreen-wireless.dts ./arch/arm/boot/dts/am335x-bonegreen.dts ./arch/arm/boot/dts/am335x-pocketbone.dts Entry: Compiling beagle logic code Date: Thu May 3 16:01:53 EDT 2018 Doesnt work with that 4.4 kernel. So what should I do, really? Nothing is consistent. I'm just going to modify it.. See how that goes. Nope.. there are missing functions etc.. It seems at least this is supposed to work for the later versions. I NEED SOMETHING THAT WORKS FIRST Let's look at BeagleLogic git history to find inspiration. Entry: Versions Date: Thu May 3 16:34:54 EDT 2018 It seems this was moved to make compatible with 4.9, and no longer compatible with 4.4 The question is: do I revert those changes and stick to 4.4? Let's download the latest image, and see where it's at. What about picking 4.9-rt from beagleboard.org? 4a10a494f997b8082afb37fcad1a8da62f28d865 4.9.88-ti-rt-r111 bb.org_defconfig Alright... now when I do modprobe pru_rproc, nothing happens. Maybe put the dts compiler in the image so I can see what's actually running? Or just figure out how to traverse it. https://unix.stackexchange.com/questions/265890/is-it-possible-to-get-the-information-for-a-device-tree-using-sys-of-a-running /proc/device-tree or /sys/firmware/devicetree/base ./ocp/pruss_soc_bus@4a326000 ./ocp/pruss_soc_bus@4a326000/pruss@4a300000 ./ocp/pruss_soc_bus@4a326000/pruss@4a300000/pru@4a338000 ./ocp/pruss_soc_bus@4a326000/pruss@4a300000/pru@4a334000 ./ocp/mailbox@480C8000/mbox_pru1 ./ocp/mailbox@480C8000/mbox_pru0 ./ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_20_pru_uart_pin ./ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_19_pru_uart_pin ./ocp/l4_wkup@44c00000/prcm@200000/clocks/pruss_ocp_gclk@530 So they seem to be there. Why no dmesg? # cp beaglelogic-pru0.out /lib/firmware/am335x-pru0-fw # cp beaglelogic-pru1.out /lib/firmware/am335x-pru1-fw https://groups.google.com/forum/#!topic/beagleboard/4P9NdglojBo Kumar Abhishek 11/14/17 Which kernel version are you using? If it's the 4.9 version (most likely as it is the Stretch image), some additional steps are required because the binary won't start up automatically at boot as it does in kernel version 4.4. This is a change that happened done going from 4.4-4.9. To boot the binary, once you build and put it into /lib/firmware you would have to manually boot it. Go to /sys/class/remoteproc in a root shell There should be 3 directories, remoteproc0, remoteproc1, remoteproc2. To find which is the correct one for PRU0 for example, do: cat /sys/class/remoteproc/remoteproc1/device/of_node/label . It should say "pru0" (at least it does on my board) Once you have found the correct remoteproc directory, cd into it. Let's for example assume for PRU0 the directory is /sys/class/remoteproc/remoteproc1 Then you have to set the name for the firmware you have copied into /lib/firmware using: echo am335x-pru0-fw > firmware . Then you have to start the device using: echo start > state . To stop the PRU, do: echo stop > state . I hope this should get the rpmsg driver to show up. Pastebin your kernel logs so that I can take a look. Resource table is a way of signifying to the remoteproc driver: the PRU interrupts it should configure on PRU boot, virtqueues used for PRU<->Kernel communication The resource table is placed in an ELF section that the remoteproc kernel driver reads before it loads the firmware into the PRUs. Regards Abhishek remoteproc1,2 are missing Entry: I need to make a choice... Date: Thu May 3 17:37:49 EDT 2018 and then get it to work. Going for the newer version is likely going to be the best idea. What is in this one? http://debian.beagleboard.org/images/bone-debian-9.3-iot-armhf-2018-03-05-4gb.img.xz 4.9.82-ti-r102 So I gues I can figure it out from there. EDIT: So figure out what the configuration difference is? [ 60.666423] ti-pruss 4a300000.pruss: creating PRU cores and other child platform devices [ 60.769949] remoteproc remoteproc1: 4a334000.pru0 is available [ 60.770093] pru-rproc 4a334000.pru0: PRU rproc node /ocp/pruss_soc_bus@4a326000/pruss@4a300000/pru@4a334000 probed successfully [ 60.824108] remoteproc remoteproc2: 4a338000.pru1 is available [ 60.840648] pru-rproc 4a338000.pru1: PRU rproc node /ocp/pruss_soc_bus@4a326000/pruss@4a300000/pru@4a338000 probed successfully root@beaglebone:~# lsmod Module Size Used by usb_f_mass_storage 51462 2 usb_f_acm 8610 2 u_serial 13482 3 usb_f_acm usb_f_ecm 11619 2 usb_f_rndis 26944 2 u_ether 13962 2 usb_f_ecm,usb_f_rndis libcomposite 55456 16 usb_f_ecm,usb_f_acm,usb_f_mass_storage,usb_f_rndis pruss_soc_bus 4788 0 evdev 13811 1 8021q 24278 0 garp 7357 1 8021q mrp 9301 1 8021q stp 2686 1 garp llc 6287 2 garp,stp iptable_nat 2512 0 nf_conntrack_ipv4 12035 1 nf_defrag_ipv4 2016 1 nf_conntrack_ipv4 nf_nat_ipv4 6857 1 iptable_nat nf_nat 18928 1 nf_nat_ipv4 nf_conntrack 117486 3 nf_conntrack_ipv4,nf_nat_ipv4,nf_nat iptable_mangle 2303 0 iptable_filter 2453 0 uio_pdrv_genirq 4205 0 uio 11036 1 uio_pdrv_genirq spidev 9322 0 pru_rproc 14966 0 pruss_intc 9092 1 pru_rproc pruss 10889 1 pru_rproc tieqep 9111 0 ip_tables 14529 3 iptable_mangle,iptable_filter,iptable_nat x_tables 22165 3 iptable_mangle,ip_tables,iptable_filter Fastest way to find this might be to go to the linux source, and find out what the OF node is that carries the information needed to perform the probe. Entry: buildroot error Date: Thu May 3 21:23:09 EDT 2018 >>> Executing post-image script board/beaglebone/post-image.sh file(am335x-evm.dtb): stat(/home/tom/gw_buildroot/target/bbb/images/am335x-evm.dtb) failed: No such file or directory vfat(boot.vfat): could not setup am335x-evm.dtb Makefile:761: recipe for target 'target-post-image' failed make[2]: *** [target-post-image] Error 1 make[2]: Leaving directory '/home/tom/gw_buildroot/buildroot' Makefile:7: recipe for target 'bbb.build' failed make[1]: *** [bbb.build] Error 2 make[1]: Leaving directory '/home/tom/gw_buildroot' Makefile:2: recipe for target 'all' failed make: *** [all] Error 2 .config says: BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2018.01" But then during building: mkdir -p /home/tom/gw_buildroot/target/bbb/target/etc ( \ echo "NAME=Buildroot"; \ echo "VERSION=2018.05-git-01170-g7e85734709"; \ echo "ID=buildroot"; \ echo "VERSION_ID=2018.05-git"; \ echo "PRETTY_NAME=\"Buildroot 2018.05-git\"" \ Why is this different? OK I know: I did "buildroot-menuconfig", and it's picking that? Removing .config file, and running defconfig again. It still picks 2018.05 Yeah I don't understand why this suddenly fails Let's remove all custom buildroot options, and see if there's another dts. tom@buildroot:~/gw_buildroot/defconfig$ diff -Naur ../buildroot/configs/beaglebone_defconfig bbb --- ../buildroot/configs/beaglebone_defconfig 2018-05-03 12:21:12.029373183 +0000 +++ bbb 2018-05-03 20:59:20.196308153 +0000 @@ -2,17 +2,35 @@ BR2_cortex_a8=y BR2_GLOBAL_PATCH_DIR="board/beaglebone/patches" BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_9=y +BR2_TOOLCHAIN_BUILDROOT_CXX=y BR2_TARGET_GENERIC_GETTY_PORT="ttyO0" +BR2_ROOTFS_POST_BUILD_SCRIPT="$(BASE_DIR)/../../bin/post_build.sh" +BR2_ROOTFS_POST_FAKEROOT_SCRIPT="$(BASE_DIR)/../../bin/post_fakeroot.sh" BR2_ROOTFS_POST_IMAGE_SCRIPT="board/beaglebone/post-image.sh" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y -BR2_LINUX_KERNEL_CUSTOM_REPO_URL="git://git.ti.com/processor-sdk/processor-sdk-linux.git" -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="a75d8e93056181d512f6c818e8627bd4554aaf92" -BR2_LINUX_KERNEL_DEFCONFIG="omap2plus" +BR2_LINUX_KERNEL_CUSTOM_REPO_URL="git://github.com/beagleboard/linux.git" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="4a10a494f997b8082afb37fcad1a8da62f28d865" +BR2_LINUX_KERNEL_DEFCONFIG="bb.org" BR2_LINUX_KERNEL_DTS_SUPPORT=y -BR2_LINUX_KERNEL_INTREE_DTS_NAME="am335x-evm am335x-bone am335x-boneblack am335x-bonegreen am335x-evmsk" +BR2_LINUX_KERNEL_INTREE_DTS_NAME="am335x-boneblack" +BR2_PACKAGE_E2FSPROGS=y +BR2_PACKAGE_ERLANG=y +BR2_PACKAGE_SQLITE=y +BR2_PACKAGE_READLINE=y +BR2_PACKAGE_DROPBEAR=y +BR2_PACKAGE_IPTABLES=y +BR2_PACKAGE_NTP=y +BR2_PACKAGE_NTP_NTPDATE=y +BR2_PACKAGE_OPENVPN=y +BR2_PACKAGE_RSYNC=y +BR2_PACKAGE_SOCAT=y +BR2_PACKAGE_TCPDUMP=y +BR2_PACKAGE_SCREEN=y BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_4=y +BR2_TARGET_ROOTFS_EXT2_SIZE="200M" +BR2_TARGET_ROOTFS_EXT2_INODES=200000 BR2_TARGET_UBOOT=y BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y BR2_TARGET_UBOOT_CUSTOM_VERSION=y I think it's this one: -BR2_LINUX_KERNEL_INTREE_DTS_NAME="am335x-evm am335x-bone am335x-boneblack am335x-bonegreen am335x-evmsk" +BR2_LINUX_KERNEL_INTREE_DTS_NAME="am335x-boneblack" Let's recompile. tom@buildroot:~/gw_buildroot/target/bbb/build/linux-4a10a494f997b8082afb37fcad1a8da62f28d865$ rm .stamp_built tom@buildroot:~/gw_buildroot/target/bbb/build/linux-4a10a494f997b8082afb37fcad1a8da62f28d865$ rm .stamp_images_installed tom@buildroot:~/gw_buildroot/target/bbb/build/linux-4a10a494f997b8082afb37fcad1a8da62f28d865$ rm .stamp_target_installed Entry: Comparing configurations Date: Fri May 4 08:06:13 EDT 2018 To see DTB parsed out: tom@buildroot:~$ cd /tmp Buildroot: tom@buildroot:/tmp$ ~/gw_buildroot/target/bbb/host/bin/dtc ~/gw_buildroot/target/bbb/build/linux-4a10a494f997b8082afb37fcad1a8da62f28d865/arch/arm/boot/dts/am335x-boneblack.dtb >br.dts Debian: tom@buildroot:/tmp$ scp root@10.1.3.105:/boot/dtbs/4.9.82-ti-r102/am335x-boneblack.dtb . tom@buildroot:/tmp$ ~/gw_buildroot/target/bbb/host/bin/dtc /tmp/am335x-boneblack.dtb >deb.dts tom@buildroot:/tmp$ diff -Naur br.dts deb.dts --- br.dts 2018-05-04 12:17:18.877921596 +0000 +++ deb.dts 2018-05-04 12:17:26.901921876 +0000 @@ -2263,7 +2263,7 @@ #address-cells = <0x1>; #size-cells = <0x1>; ranges; - status = "disabled"; + status = "okay"; linux,phandle = <0xe0>; phandle = <0xe0>; @@ -2274,7 +2274,7 @@ #address-cells = <0x1>; #size-cells = <0x1>; ranges; - status = "disabled"; + status = "okay"; linux,phandle = <0xe1>; phandle = <0xe1>; @@ -2298,7 +2298,7 @@ interrupt-parent = <0x4b>; interrupts = <0x10 0x11>; interrupt-names = "vring", "kick"; - status = "disabled"; + status = "okay"; linux,phandle = <0xe2>; phandle = <0xe2>; }; @@ -2311,7 +2311,7 @@ interrupt-parent = <0x4b>; interrupts = <0x12 0x13>; interrupt-names = "vring", "kick"; - status = "disabled"; + status = "okay"; linux,phandle = <0xe3>; phandle = <0xe3>; }; OK, so they are just off. Next: create a DTS to override the default. Entry: Something weird going on with booting that 4.9 image Date: Fri May 4 11:56:00 EDT 2018 Often it just doesn't start properly. Power cycling doesn't fix it. When I boot 4.4 image, then 4.9, then it seems fine. 4.4 always boots EDIT: Keep getting this. Inserting 4.4 fixes the boot process. I'm erasing the eMMC, see if that does anything. root@bone1-49:~# dd if=/dev/zero of=/dev/mmcblk1 Nope. Same behavior. Entry: PRU enable Date: Mon May 7 07:19:31 EDT 2018 Add a place to put the device tree config. We don't need overlays, since configuration will be fixed per board. Simplest here is to put it in the linux git. Or maintain it as patch or file that is copied into the tree. The latter seems better as it doesn't require maintenance of yet another large linux repo. tom@buildroot:~/gw_buildroot/target/bbb$ find -name am335x-boneblack.dts ./build/linux-headers-4a10a494f997b8082afb37fcad1a8da62f28d865/arch/arm/boot/dts/am335x-boneblack.dts ./build/uboot-2018.01/arch/arm/dts/am335x-boneblack.dts ./build/linux-4a10a494f997b8082afb37fcad1a8da62f28d865/arch/arm/boot/dts/am335x-boneblack.dts Now, why does uboot have its own? Maybe it needs some information as well? It would be nice go get a final answer on that. For now it seems best to just focus on what is found in the linux tree. OTOH, placing it inside the tree makes it easier to build the kernel separately for incremental updates. I'm going to need to change this a couple of times, so maybe better to "host" it somewhere else. Or, can I have a single linux repository? EDIT: Doesn't need to be solved right now. Incremental setup: - buildroot:cross/Makefile has linux-hatd-octavo target - dts modifications are in cross/am335x-boneblack.dts tom@buildroot:~/cross$ ~/gw_buildroot/target/bbb/host/bin/dtc linux-hatd-octavo/arch/arm/boot/dts/am335x-boneblack.dtb Added these: / { ocp { pruss_soc_bus@4a326000 { status = "okay"; pruss@4a300000 { status = "okay"; pru@4a334000 { status = "okay"; }; pru@4a338000 { status = "okay"; }; }; }; }; }; # cat /sys/devices/platform/ocp/4a326000.pruss-soc-bus/of_node/status okay but the rest is not there? # cd /sys/devices/platform/ocp/ # find -name '*pru*' ./4a326000.pruss-soc-bus ./480c8000.mailbox/mbox/mbox_pru1 ./480c8000.mailbox/mbox/mbox_pru0 on the pocket1: Not there either.. WTF am I missing? Let's bring up the other bbb in Debian 4.9 Entry: New setup Date: Mon May 7 09:26:12 EDT 2018 Work only with bbb. bone0 has system on eMMC (/dev/mmcblk1) to boot from sd: press switch near SD card across power cycle (not just reset). I need to start managing these SD cards. Instead of naming the hostname after the board, give the sd cards a special name. Entry: zoe USB crashed again Date: Mon May 7 10:58:10 EDT 2018 I need to figure out a way to make this more robust. Also, the bb49 not booting properly is a real pain. What about keeping it simpler and installing the kernels on the buildroot-generated images? What do I need running at the same time? - A kernel that has a working pru remoteproc config - My buildroot kernel Use two boards for this. If bb49 doesn't work, then use something else. Constraints: - bb49 doesn't seem to start PRU on pocketbeagles - bone0 will start from eMMC by default - So this one works: bone0 @ 10.1.3.177 root@bb49:~# dmesg|grep pru [ 51.557874] ti-pruss 4a300000.pruss: creating PRU cores and other child platform devices [ 51.608418] remoteproc remoteproc1: 4a334000.pru0 is available [ 51.608539] pru-rproc 4a334000.pru0: PRU rproc node /ocp/pruss_soc_bus@4a326000/pruss@4a300000/pru@4a334000 probed successfully [ 51.635311] remoteproc remoteproc2: 4a338000.pru1 is available [ 51.635437] pru-rproc 4a338000.pru1: PRU rproc node /ocp/pruss_soc_bus@4a326000/pruss@4a300000/pru@4a338000 probed successfully But it needs to be powered on with SD card button pressed. Does it reboot properly? Seems so. But it doesn't take its IP address, so I've added (sleep 60; ifup usb0)& to /etc/rc.local which seems to fix it - The other one also comes up bone1 @ 10.1.3.105 Entry: bb49 Date: Mon May 7 12:01:36 EDT 2018 root@bb49:/sys/devices/platform/ocp# find -name '*pru*' ./4a326000.pruss-soc-bus ./4a326000.pruss-soc-bus/4a300000.pruss ./4a326000.pruss-soc-bus/4a300000.pruss/4a338000.pru1 ./4a326000.pruss-soc-bus/4a300000.pruss/4a334000.pru0 ./480c8000.mailbox/mbox/mbox_pru1 ./480c8000.mailbox/mbox/mbox_pru0 So why are they active here? What am I missing? Here's the dmesg of bb49: [ 0.000000] Booting Linux on physical CPU 0x0 [ 0.000000] Linux version 4.9.82-ti-r102 (root@b2-am57xx-beagle-x15-2gb) (gcc version 6.3.0 20170516 (Debian 6.3.0-18) ) #1 SMP PREEMPT Thu Feb 22 01:16:12 UTC 2018 [ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache [ 0.000000] OF: fdt:Machine model: TI AM335x BeagleBone Black [ 0.000000] cma: Reserved 48 MiB at 0x9c800000 [ 0.000000] Memory policy: Data cache writeback [ 0.000000] On node 0 totalpages: 130560 [ 0.000000] free_area_init_node: node 0, pgdat c14e98c0, node_mem_map df961000 [ 0.000000] Normal zone: 1148 pages used for memmap [ 0.000000] Normal zone: 0 pages reserved [ 0.000000] Normal zone: 130560 pages, LIFO batch:31 [ 0.000000] CPU: All CPU(s) started in SVC mode. [ 0.000000] AM335X ES2.1 (sgx neon) [ 0.000000] percpu: Embedded 15 pages/cpu @df902000 s31884 r8192 d21364 u61440 [ 0.000000] pcpu-alloc: s31884 r8192 d21364 u61440 alloc=15*4096 [ 0.000000] pcpu-alloc: [0] 0 [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 129412 [ 0.000000] Kernel command line: console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 quiet [ 0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes) [ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes) [ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes) [ 0.000000] Memory: 439628K/522240K available (12288K kernel code, 1155K rwdata, 4364K rodata, 1024K init, 751K bss, 33460K reserved, 49152K cma-reserved, 0K highmem) [ 0.000000] Virtual kernel memory layout: vector : 0xffff0000 - 0xffff1000 ( 4 kB) fixmap : 0xffc00000 - 0xfff00000 (3072 kB) vmalloc : 0xe0000000 - 0xff800000 ( 504 MB) lowmem : 0xc0000000 - 0xdfe00000 ( 510 MB) pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB) modules : 0xbf000000 - 0xbfe00000 ( 14 MB) .text : 0xc0008000 - 0xc0d00000 (13280 kB) .init : 0xc1300000 - 0xc1400000 (1024 kB) .data : 0xc1400000 - 0xc1520cc8 (1156 kB) .bss : 0xc1522000 - 0xc15ddfb0 ( 752 kB) [ 0.000000] Preemptible hierarchical RCU implementation. [ 0.000000] Build-time adjustment of leaf fanout to 32. [ 0.000000] RCU restricting CPUs from NR_CPUS=2 to nr_cpu_ids=1. [ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=1 [ 0.000000] NR_IRQS:16 nr_irqs:16 16 [ 0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts [ 0.000000] OMAP clockevent source: timer2 at 24000000 Hz [ 0.000023] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns [ 0.000045] clocksource: timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns [ 0.000055] OMAP clocksource: timer1 at 24000000 Hz [ 0.001921] clocksource_probe: no matching clocksources found [ 0.002517] Console: colour dummy device 80x30 [ 0.002545] WARNING: Your 'console=ttyO0' has been replaced by 'ttyS0' [ 0.002551] This ensures that you still see kernel messages. Please [ 0.002556] update your kernel commandline. [ 0.002579] Calibrating delay loop... 995.32 BogoMIPS (lpj=1990656) [ 0.020871] pid_max: default: 32768 minimum: 301 [ 0.021163] Security Framework initialized [ 0.021176] Yama: becoming mindful. [ 0.021232] AppArmor: AppArmor initialized [ 0.021445] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes) [ 0.021455] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes) [ 0.022663] CPU: Testing write buffer coherency: ok [ 0.022732] ftrace: allocating 39681 entries in 117 pages [ 0.135109] CPU0: thread -1, cpu 0, socket -1, mpidr 0 [ 0.135172] Setting up static identity map for 0x80100000 - 0x80100060 [ 0.180873] Brought up 1 CPUs [ 0.180893] SMP: Total of 1 processors activated (995.32 BogoMIPS). [ 0.180900] CPU: All CPU(s) started in SVC mode. [ 0.182514] devtmpfs: initialized [ 0.225183] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3 [ 0.225757] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns [ 0.225782] futex hash table entries: 256 (order: 2, 16384 bytes) [ 0.229556] xor: measuring software checksum speed [ 0.268892] arm4regs : 1213.000 MB/sec [ 0.308837] 8regs : 1091.000 MB/sec [ 0.348835] 32regs : 1088.000 MB/sec [ 0.388835] neon : 1669.000 MB/sec [ 0.388842] xor: using function: neon (1669.000 MB/sec) [ 0.388862] pinctrl core: initialized pinctrl subsystem [ 0.390380] NET: Registered protocol family 16 [ 0.394180] DMA: preallocated 1024 KiB pool for atomic coherent allocations [ 0.462512] omap_hwmod: debugss: _wait_target_disable failed [ 0.512877] cpuidle: using governor ladder [ 0.524863] cpuidle: using governor menu [ 0.540763] OMAP GPIO hardware version 0.1 [ 0.567514] No ATAGs? [ 0.567538] hw-breakpoint: debug architecture 0x4 unsupported. [ 0.568289] omap4_sram_init:Unable to allocate sram needed to handle errata I688 [ 0.568301] omap4_sram_init:Unable to get sram pool needed to handle errata I688 [ 0.680905] raid6: neonx2 gen() 1902 MB/s [ 0.748882] raid6: neonx2 xor() 1172 MB/s [ 0.748890] raid6: using algorithm neonx2 gen() 1902 MB/s [ 0.748895] raid6: .... xor() 1172 MB/s, rmw enabled [ 0.748901] raid6: using intx1 recovery algorithm [ 0.759887] edma 49000000.edma: TI EDMA DMA engine driver [ 0.766538] SCSI subsystem initialized [ 0.769034] libata version 3.00 loaded. [ 0.769382] usbcore: registered new interface driver usbfs [ 0.769453] usbcore: registered new interface driver hub [ 0.769568] usbcore: registered new device driver usb [ 0.770686] omap_i2c 44e0b000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c0_pins, deferring probe [ 0.771680] omap_i2c 4802a000.i2c: bus 1 rev0.11 at 100 kHz [ 0.773249] omap_i2c 4819c000.i2c: bus 2 rev0.11 at 100 kHz [ 0.773532] media: Linux media interface: v0.10 [ 0.773599] Linux video capture interface: v2.00 [ 0.773700] pps_core: LinuxPPS API ver. 1 registered [ 0.773707] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti [ 0.773730] PTP clock support registered [ 0.774829] omap-mailbox 480c8000.mailbox: omap mailbox rev 0x400 [ 0.777293] Advanced Linux Sound Architecture Driver Initialized. [ 0.778117] NetLabel: Initializing [ 0.778127] NetLabel: domain hash size = 128 [ 0.778132] NetLabel: protocols = UNLABELED CIPSOv4 [ 0.778204] NetLabel: unlabeled traffic allowed by default [ 0.781332] clocksource: Switched to clocksource timer1 [ 0.909575] VFS: Disk quotas dquot_6.6.0 [ 0.909696] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes) [ 0.910107] AppArmor: AppArmor Filesystem Enabled [ 0.926050] NET: Registered protocol family 2 [ 0.927095] TCP established hash table entries: 4096 (order: 2, 16384 bytes) [ 0.927143] TCP bind hash table entries: 4096 (order: 3, 32768 bytes) [ 0.927202] TCP: Hash tables configured (established 4096 bind 4096) [ 0.927275] UDP hash table entries: 256 (order: 1, 8192 bytes) [ 0.927296] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes) [ 0.927516] NET: Registered protocol family 1 [ 0.936505] RPC: Registered named UNIX socket transport module. [ 0.936514] RPC: Registered udp transport module. [ 0.936519] RPC: Registered tcp transport module. [ 0.936524] RPC: Registered tcp NFSv4.1 backchannel transport module. [ 0.936541] PCI: CLS 0 bytes, default 64 [ 0.937732] Unpacking initramfs... [ 1.089400] random: fast init done [ 1.373060] Freeing initrd memory: 5952K [ 1.373807] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 counters available [ 1.377761] audit: initializing netlink subsys (disabled) [ 1.377865] audit: type=2000 audit(1.308:1): initialized [ 1.383412] workingset: timestamp_bits=14 max_order=17 bucket_order=3 [ 1.383600] zbud: loaded [ 1.388858] NFS: Registering the id_resolver key type [ 1.388897] Key type id_resolver registered [ 1.388903] Key type id_legacy registered [ 1.388921] nfs4filelayout_init: NFSv4 File Layout Driver Registering... [ 1.389405] fuse init (API version 7.26) [ 1.389849] orangefs_debugfs_init: called with debug mask: :none: :0: [ 1.390137] orangefs_init: module version upstream loaded [ 1.390144] SGI XFS with ACLs, security attributes, realtime, no debug enabled [ 1.410772] Key type asymmetric registered [ 1.410787] Asymmetric key parser 'x509' registered [ 1.410924] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 245) [ 1.415252] io scheduler noop registered [ 1.415262] io scheduler deadline registered [ 1.415367] io scheduler cfq registered (default) [ 1.418285] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568 [ 1.425203] gpio-of-helper ocp:cape-universal: ready [ 1.437138] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle [ 1.439540] Serial: 8250/16550 driver, 6 ports, IRQ sharing disabled [ 1.443297] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 158, base_baud = 3000000) is a 8250 [ 1.456285] console [ttyS0] enabled [ 1.457443] 48022000.serial: ttyS1 at MMIO 0x48022000 (irq = 159, base_baud = 3000000) is a 8250 [ 1.458343] 48024000.serial: ttyS2 at MMIO 0x48024000 (irq = 160, base_baud = 3000000) is a 8250 [ 1.459174] 481a8000.serial: ttyS4 at MMIO 0x481a8000 (irq = 161, base_baud = 3000000) is a 8250 [ 1.462605] omap_rng 48310000.rng: OMAP Random Number Generator ver. 20 [ 1.462935] [drm] Initialized [ 1.466958] at24 2-0054: 32768 byte 24c256 EEPROM, writable, 1 bytes/write [ 1.467287] at24 2-0055: 32768 byte 24c256 EEPROM, writable, 1 bytes/write [ 1.467521] at24 2-0056: 32768 byte 24c256 EEPROM, writable, 1 bytes/write [ 1.467761] at24 2-0057: 32768 byte 24c256 EEPROM, writable, 1 bytes/write [ 1.497583] libphy: Fixed MDIO Bus: probed [ 1.498639] CAN device driver interface [ 1.500287] c_can_platform 481cc000.can: c_can_platform device registered (regs=fa1cc000, irq=168) [ 1.501545] c_can_platform 481d0000.can: c_can_platform device registered (regs=fa1d0000, irq=169) [ 1.557448] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6 [ 1.557465] davinci_mdio 4a101000.mdio: detected phy mask fffffffe [ 1.558354] davinci_mdio: dt: updated phy_id[0] from phy_mask[fffffffe] [ 1.572867] libphy: 4a101000.mdio: probed [ 1.572895] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver SMSC LAN8710/LAN8720 [ 1.574203] cpsw 4a100000.ethernet: Detected MACID = 7c:66:9d:4e:30:68 [ 1.574355] cpsw 4a100000.ethernet: cpts: overflow check period 1250 (jiffies) [ 1.578788] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver [ 1.578868] ehci-pci: EHCI PCI platform driver [ 1.578944] ehci-platform: EHCI generic platform driver [ 1.579357] ehci-omap: OMAP-EHCI Host Controller driver [ 1.580382] usbcore: registered new interface driver usb-storage [ 1.583804] 47401300.usb-phy supply vcc not found, using dummy regulator [ 1.590631] 47401b00.usb-phy supply vcc not found, using dummy regulator [ 1.594890] musb-hdrc musb-hdrc.1: MUSB HDRC host driver [ 1.594933] musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus number 1 [ 1.595239] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002 [ 1.595250] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 1.595257] usb usb1: Product: MUSB HDRC host driver [ 1.595265] usb usb1: Manufacturer: Linux 4.9.82-ti-r102 musb-hcd [ 1.595272] usb usb1: SerialNumber: musb-hdrc.1 [ 1.596451] hub 1-0:1.0: USB hub found [ 1.596531] hub 1-0:1.0: 1 port detected [ 1.610492] omap_rtc 44e3e000.rtc: already running [ 1.611043] omap_rtc 44e3e000.rtc: rtc core: registered 44e3e000.rtc as rtc0 [ 1.613038] i2c /dev entries driver [ 1.616322] omap_wdt: OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec [ 1.618279] cpuidle: enable-method property 'ti,am3352' found operations [ 1.620237] omap_hsmmc 48060000.mmc: Got CD GPIO [ 1.696862] mmc0: host does not support reading read-only switch, assuming write-enable [ 1.699938] ledtrig-cpu: registered to indicate activity on CPUs [ 1.700633] omap-aes 53500000.aes: OMAP AES hw accel rev: 3.2 [ 1.701074] mmc0: new high speed SDHC card at address 0002 [ 1.702362] omap-aes 53500000.aes: will run requests pump with realtime priority [ 1.707664] mmcblk0: mmc0:0002 MSD04 3.73 GiB [ 1.710808] omap-sham 53100000.sham: hw accel on OMAP rev 4.3 [ 1.711318] mmcblk0: p1 [ 1.718321] hidraw: raw HID events driver (C) Jiri Kosina [ 1.719059] usbcore: registered new interface driver usbhid [ 1.719067] usbhid: USB HID core driver [ 1.719761] remoteproc remoteproc0: wkup_m3 is available [ 1.723166] ti_am3359-tscadc 44e0d000.tscadc: chan 0 step_avg truncating to 16 [ 1.723183] ti_am3359-tscadc 44e0d000.tscadc: chan 1 step_avg truncating to 16 [ 1.723190] ti_am3359-tscadc 44e0d000.tscadc: chan 2 step_avg truncating to 16 [ 1.723198] ti_am3359-tscadc 44e0d000.tscadc: chan 3 step_avg truncating to 16 [ 1.723206] ti_am3359-tscadc 44e0d000.tscadc: chan 4 step_avg truncating to 16 [ 1.723213] ti_am3359-tscadc 44e0d000.tscadc: chan 5 step_avg truncating to 16 [ 1.723221] ti_am3359-tscadc 44e0d000.tscadc: chan 6 step_avg truncating to 16 [ 1.723228] ti_am3359-tscadc 44e0d000.tscadc: chan 7 step_avg truncating to 16 [ 1.730213] wireguard: WireGuard 0.0.20180218 loaded. See www.wireguard.com for information. [ 1.730227] wireguard: Copyright (C) 2015-2018 Jason A. Donenfeld . All Rights Reserved. [ 1.730597] NET: Registered protocol family 10 [ 1.736052] mip6: Mobile IPv6 [ 1.736078] NET: Registered protocol family 17 [ 1.736098] can: controller area network core (rev 20120528 abi 9) [ 1.736173] NET: Registered protocol family 29 [ 1.736325] Key type dns_resolver registered [ 1.736332] mpls_gso: MPLS GSO support [ 1.736656] omap_voltage_late_init: Voltage driver support not added [ 1.744247] PM: Cannot get wkup_m3_ipc handle [ 1.749001] ThumbEE CPU extension supported. [ 1.749029] Registering SWP/SWPB emulation handler [ 1.750378] registered taskstats version 1 [ 1.750511] zswap: loaded using pool lzo/zbud [ 1.756543] Btrfs loaded, crc32c=crc32c-generic [ 1.766481] mmc1: new high speed MMC card at address 0001 [ 1.773697] mmcblk1: mmc1:0001 MMC04G 3.60 GiB [ 1.785769] mmcblk1boot0: mmc1:0001 MMC04G partition 1 2.00 MiB [ 1.793729] mmcblk1boot1: mmc1:0001 MMC04G partition 2 2.00 MiB [ 1.795253] mmcblk1: p1 p2 [ 1.800102] Key type encrypted registered [ 1.800127] AppArmor: AppArmor sha1 policy hashing enabled [ 1.956234] tda998x 0-0070: found TDA19988 [ 1.957999] tilcdc 4830e000.lcdc: bound 0-0070 (ops tda998x_ops) [ 1.958029] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013). [ 1.958035] [drm] No driver support for vblank timestamp query. [ 1.958433] tilcdc 4830e000.lcdc: No connectors reported connected with modes [ 1.958453] [drm] Cannot find any crtc or sizes - going 1024x768 [ 1.967279] Console: switching to colour frame buffer device 128x48 [ 1.972572] tilcdc 4830e000.lcdc: fb0: frame buffer device [ 1.996470] input: tps65217_pwr_but as /devices/platform/ocp/44e0b000.i2c/i2c-0/0-0024/tps65217-pwrbutton/input/input0 [ 1.997032] tps65217 0-0024: TPS65217 ID 0xe version 1.2 [ 1.997646] at24 0-0050: 32768 byte 24c256 EEPROM, writable, 1 bytes/write [ 1.997743] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz [ 1.999248] remoteproc remoteproc0: powering up wkup_m3 [ 1.999794] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217148 [ 2.001792] remoteproc remoteproc0: remote processor wkup_m3 is now up [ 2.001812] wkup_m3_ipc 44e11324.wkup_m3_ipc: CM3 Firmware Version = 0x192 [ 2.003073] asoc-simple-card sound: hdmi-hifi.0 <-> 48038000.mcasp mapping ok [ 2.005178] PM: bootloader does not support rtc-only! [ 2.006650] omap_rtc 44e3e000.rtc: setting system clock to 2018-05-07 15:36:25 UTC (1525707385) [ 2.006664] of_cfs_init [ 2.006812] of_cfs_init: OK [ 2.007794] PM: Hibernation image not present or could not be loaded. [ 2.007944] ALSA device list: [ 2.007954] #0: TI BeagleBone Black [ 2.010421] Freeing unused kernel memory: 1024K [ 14.858943] EXT4-fs (mmcblk0p1): mounted filesystem with ordered data mode. Opts: (null) [ 15.518422] ip_tables: (C) 2000-2006 Netfilter Core Team [ 15.565742] systemd[1]: systemd 232 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN) [ 15.566513] systemd[1]: Detected architecture arm. [ 15.576143] systemd[1]: Set hostname to . [ 16.244712] systemd[1]: Listening on Journal Audit Socket. [ 16.246864] systemd[1]: Created slice User and Session Slice. [ 16.247295] systemd[1]: Listening on fsck to fsckd communication Socket. [ 16.247711] systemd[1]: Listening on Journal Socket (/dev/log). [ 16.248834] systemd[1]: Created slice System Slice. [ 16.253836] systemd[1]: Mounting /sys/kernel/debug... [ 16.264964] systemd[1]: Mounting POSIX Message Queue File System... [ 16.488516] eqep 48300180.eqep: ver. 1.0 [ 16.488741] eqep 48300180.eqep: count_mode:0 [ 16.488751] eqep 48300180.eqep: invert_qa:1 [ 16.488759] eqep 48300180.eqep: invert_qb:1 [ 16.488767] eqep 48300180.eqep: invert_qi:0 [ 16.488775] eqep 48300180.eqep: invert_qs:0 [ 16.488783] eqep 48300180.eqep: swap_inputs:0 [ 16.488792] eqep 48300180.eqep: QDECCTL:0x0180 [ 16.488800] eqep 48300180.eqep: QPOSINIT:0x00000000 [ 16.488807] eqep 48300180.eqep: QPOSMAX:0xffffffff [ 16.488815] eqep 48300180.eqep: QPOSCNT:0x00000000 [ 16.488823] eqep 48300180.eqep: omit_interrupt:0 [ 16.488831] eqep 48300180.eqep: QEINT:0x0800 [ 16.488838] eqep 48300180.eqep: QUPRD:0x05f5e100 [ 16.488845] eqep 48300180.eqep: QEPCTL:0x009e write [ 16.488852] eqep 48300180.eqep: QEPCTL:0x009e read [ 16.488879] eqep 48300180.eqep: irq:193, clk_rate:100000000 [ 16.497937] eqep 48302180.eqep: ver. 1.0 [ 16.501937] eqep 48302180.eqep: count_mode:0 [ 16.501949] eqep 48302180.eqep: invert_qa:1 [ 16.501958] eqep 48302180.eqep: invert_qb:1 [ 16.501966] eqep 48302180.eqep: invert_qi:0 [ 16.501973] eqep 48302180.eqep: invert_qs:0 [ 16.501981] eqep 48302180.eqep: swap_inputs:0 [ 16.501990] eqep 48302180.eqep: QDECCTL:0x0180 [ 16.501998] eqep 48302180.eqep: QPOSINIT:0x00000000 [ 16.502005] eqep 48302180.eqep: QPOSMAX:0xffffffff [ 16.502012] eqep 48302180.eqep: QPOSCNT:0x00000000 [ 16.502022] eqep 48302180.eqep: omit_interrupt:0 [ 16.502029] eqep 48302180.eqep: QEINT:0x0800 [ 16.502037] eqep 48302180.eqep: QUPRD:0x05f5e100 [ 16.502044] eqep 48302180.eqep: QEPCTL:0x009e write [ 16.502051] eqep 48302180.eqep: QEPCTL:0x009e read [ 16.502083] eqep 48302180.eqep: irq:194, clk_rate:100000000 [ 16.502523] eqep 48304180.eqep: ver. 1.0 [ 16.502688] eqep 48304180.eqep: count_mode:0 [ 16.502697] eqep 48304180.eqep: invert_qa:1 [ 16.502706] eqep 48304180.eqep: invert_qb:1 [ 16.502713] eqep 48304180.eqep: invert_qi:0 [ 16.502720] eqep 48304180.eqep: invert_qs:0 [ 16.502728] eqep 48304180.eqep: swap_inputs:0 [ 16.502736] eqep 48304180.eqep: QDECCTL:0x0180 [ 16.502744] eqep 48304180.eqep: QPOSINIT:0x00000000 [ 16.502751] eqep 48304180.eqep: QPOSMAX:0xffffffff [ 16.502758] eqep 48304180.eqep: QPOSCNT:0x00000000 [ 16.502766] eqep 48304180.eqep: omit_interrupt:0 [ 16.502773] eqep 48304180.eqep: QEINT:0x0800 [ 16.502780] eqep 48304180.eqep: QUPRD:0x05f5e100 [ 16.502787] eqep 48304180.eqep: QEPCTL:0x009e write [ 16.502794] eqep 48304180.eqep: QEPCTL:0x009e read [ 16.502816] eqep 48304180.eqep: irq:196, clk_rate:100000000 [ 17.256738] EXT4-fs (mmcblk0p1): re-mounted. Opts: errors=remount-ro [ 17.756974] systemd-journald[749]: Received request to flush runtime journal from PID 1 [ 22.715367] random: crng init done [ 23.570985] nf_conntrack version 0.5.0 (8192 buckets, 32768 max) [ 24.498264] net eth0: initializing cpsw version 1.12 (0) [ 24.498290] cpsw 4a100000.ethernet: initialized cpsw ale version 1.4 [ 24.498300] cpsw 4a100000.ethernet: ALE Table size 1024 [ 24.570205] SMSC LAN8710/LAN8720 4a101000.mdio:00: attached PHY driver [SMSC LAN8710/LAN8720] (mii_bus:phy_addr=4a101000.mdio:00, irq=-1) [ 24.633512] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready [ 25.293240] using random self ethernet address [ 25.293260] using random host ethernet address [ 25.472300] using random self ethernet address [ 25.472320] using random host ethernet address [ 25.876869] Mass Storage Function, version: 2009/09/11 [ 25.876894] LUN: removable file: (no medium) [ 26.171177] usb0: HOST MAC 7c:66:9d:4e:30:69 [ 26.175672] usb0: MAC 7c:66:9d:4e:30:6a [ 26.189754] usb1: HOST MAC 7c:66:9d:4e:30:6c [ 26.190052] usb1: MAC 7c:66:9d:4e:30:6d [ 26.741301] configfs-gadget gadget: high-speed config #1: c [ 52.034230] ti-pruss 4a300000.pruss: creating PRU cores and other child platform devices [ 52.070247] remoteproc remoteproc1: 4a334000.pru0 is available [ 52.070364] pru-rproc 4a334000.pru0: PRU rproc node /ocp/pruss_soc_bus@4a326000/pruss@4a300000/pru@4a334000 probed successfully [ 52.099357] remoteproc remoteproc2: 4a338000.pru1 is available [ 52.099479] pru-rproc 4a338000.pru1: PRU rproc node /ocp/pruss_soc_bus@4a326000/pruss@4a300000/pru@4a338000 probed successfully [ 109.815663] musb-hdrc musb-hdrc.1: VBUS_ERROR in a_wait_bcon (89, . All Rights Reserved. -ip_tables: (C) 2000-2006 Netfilter Core Team NET: Registered protocol family 10 mip6: Mobile IPv6 NET: Registered protocol family 17 @@ -208,19 +229,13 @@ registered taskstats version 1 zswap: loaded using pool lzo/zbud Btrfs loaded, crc32c=crc32c-generic -Key type encrypted registered -AppArmor: AppArmor sha1 policy hashing enabled -mmc0: new high speed SD card at address b368 -mmcblk0: mmc0:b368 N1BW1 1.92 GiB - mmcblk0: p1 p2 mmc1: new high speed MMC card at address 0001 -input: tps65217_pwr_but as /devices/platform/ocp/44e0b000.i2c/i2c-0/0-0024/tps65217-pwrbutton/input/input0 -tps65217 0-0024: TPS65217 ID 0xe version 1.2 -at24 0-0050: 32768 byte 24c256 EEPROM, writable, 1 bytes/write mmcblk1: mmc1:0001 MMC04G 3.60 GiB mmcblk1boot0: mmc1:0001 MMC04G partition 1 2.00 MiB mmcblk1boot1: mmc1:0001 MMC04G partition 2 2.00 MiB -random: fast init done + mmcblk1: p1 p2 +Key type encrypted registered +AppArmor: AppArmor sha1 policy hashing enabled tda998x 0-0070: found TDA19988 tilcdc 4830e000.lcdc: bound 0-0070 (ops tda998x_ops) [drm] Supports vblank timestamp caching Rev 2 (21.10.2013). @@ -229,37 +244,112 @@ [drm] Cannot find any crtc or sizes - going 1024x768 Console: switching to colour frame buffer device 128x48 tilcdc 4830e000.lcdc: fb0: frame buffer device +input: tps65217_pwr_but as /devices/platform/ocp/44e0b000.i2c/i2c-0/0-0024/tps65217-pwrbutton/input/input0 +tps65217 0-0024: TPS65217 ID 0xe version 1.2 +at24 0-0050: 32768 byte 24c256 EEPROM, writable, 1 bytes/write omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz remoteproc remoteproc0: powering up wkup_m3 -remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217168 -bone_capemgr bone_capemgr: Baseboard: 'A335BNLT,00A5,5000BBBK2900' -bone_capemgr bone_capemgr: compatible-baseboard=ti,beaglebone-black - #slots=4 +remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217148 remoteproc remoteproc0: remote processor wkup_m3 is now up -wkup_m3_ipc 44e11324.wkup_m3_ipc: CM3 Firmware Version = 0x193 -bone_capemgr bone_capemgr: slot #0: No cape found -bone_capemgr bone_capemgr: slot #1: No cape found -bone_capemgr bone_capemgr: slot #2: No cape found -bone_capemgr bone_capemgr: slot #3: No cape found -bone_capemgr bone_capemgr: initialized OK. +wkup_m3_ipc 44e11324.wkup_m3_ipc: CM3 Firmware Version = 0x192 asoc-simple-card sound: hdmi-hifi.0 <-> 48038000.mcasp mapping ok PM: bootloader does not support rtc-only! -omap_rtc 44e3e000.rtc: setting system clock to 2000-01-01 00:00:01 UTC (946684801) +omap_rtc 44e3e000.rtc: setting system clock to 2018-05-07 15:36:25 UTC (1525707385) of_cfs_init of_cfs_init: OK PM: Hibernation image not present or could not be loaded. ALSA device list: #0: TI BeagleBone Black -EXT4-fs (mmcblk0p2): recovery complete -EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null) -VFS: Mounted root (ext4 filesystem) on device 179:2. -devtmpfs: mounted Freeing unused kernel memory: 1024K -EXT4-fs (mmcblk0p2): re-mounted. Opts: data=ordered +EXT4-fs (mmcblk0p1): mounted filesystem with ordered data mode. Opts: (null) +ip_tables: (C) 2000-2006 Netfilter Core Team +systemd[1]: systemd 232 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN) +systemd[1]: Detected architecture arm. +systemd[1]: Set hostname to . +systemd[1]: Listening on Journal Audit Socket. +systemd[1]: Created slice User and Session Slice. +systemd[1]: Listening on fsck to fsckd communication Socket. +systemd[1]: Listening on Journal Socket (/dev/log). +systemd[1]: Created slice System Slice. +systemd[1]: Mounting /sys/kernel/debug... +systemd[1]: Mounting POSIX Message Queue File System... +eqep 48300180.eqep: ver. 1.0 +eqep 48300180.eqep: count_mode:0 +eqep 48300180.eqep: invert_qa:1 +eqep 48300180.eqep: invert_qb:1 +eqep 48300180.eqep: invert_qi:0 +eqep 48300180.eqep: invert_qs:0 +eqep 48300180.eqep: swap_inputs:0 +eqep 48300180.eqep: QDECCTL:0x0180 +eqep 48300180.eqep: QPOSINIT:0x00000000 +eqep 48300180.eqep: QPOSMAX:0xffffffff +eqep 48300180.eqep: QPOSCNT:0x00000000 +eqep 48300180.eqep: omit_interrupt:0 +eqep 48300180.eqep: QEINT:0x0800 +eqep 48300180.eqep: QUPRD:0x05f5e100 +eqep 48300180.eqep: QEPCTL:0x009e write +eqep 48300180.eqep: QEPCTL:0x009e read +eqep 48300180.eqep: irq:193, clk_rate:100000000 +eqep 48302180.eqep: ver. 1.0 +eqep 48302180.eqep: count_mode:0 +eqep 48302180.eqep: invert_qa:1 +eqep 48302180.eqep: invert_qb:1 +eqep 48302180.eqep: invert_qi:0 +eqep 48302180.eqep: invert_qs:0 +eqep 48302180.eqep: swap_inputs:0 +eqep 48302180.eqep: QDECCTL:0x0180 +eqep 48302180.eqep: QPOSINIT:0x00000000 +eqep 48302180.eqep: QPOSMAX:0xffffffff +eqep 48302180.eqep: QPOSCNT:0x00000000 +eqep 48302180.eqep: omit_interrupt:0 +eqep 48302180.eqep: QEINT:0x0800 +eqep 48302180.eqep: QUPRD:0x05f5e100 +eqep 48302180.eqep: QEPCTL:0x009e write +eqep 48302180.eqep: QEPCTL:0x009e read +eqep 48302180.eqep: irq:194, clk_rate:100000000 +eqep 48304180.eqep: ver. 1.0 +eqep 48304180.eqep: count_mode:0 +eqep 48304180.eqep: invert_qa:1 +eqep 48304180.eqep: invert_qb:1 +eqep 48304180.eqep: invert_qi:0 +eqep 48304180.eqep: invert_qs:0 +eqep 48304180.eqep: swap_inputs:0 +eqep 48304180.eqep: QDECCTL:0x0180 +eqep 48304180.eqep: QPOSINIT:0x00000000 +eqep 48304180.eqep: QPOSMAX:0xffffffff +eqep 48304180.eqep: QPOSCNT:0x00000000 +eqep 48304180.eqep: omit_interrupt:0 +eqep 48304180.eqep: QEINT:0x0800 +eqep 48304180.eqep: QUPRD:0x05f5e100 +eqep 48304180.eqep: QEPCTL:0x009e write +eqep 48304180.eqep: QEPCTL:0x009e read +eqep 48304180.eqep: irq:196, clk_rate:100000000 +EXT4-fs (mmcblk0p1): re-mounted. Opts: errors=remount-ro +systemd-journald[749]: Received request to flush runtime journal from PID 1 +random: crng init done +nf_conntrack version 0.5.0 (8192 buckets, 32768 max) net eth0: initializing cpsw version 1.12 (0) cpsw 4a100000.ethernet: initialized cpsw ale version 1.4 cpsw 4a100000.ethernet: ALE Table size 1024 SMSC LAN8710/LAN8720 4a101000.mdio:00: attached PHY driver [SMSC LAN8710/LAN8720] (mii_bus:phy_addr=4a101000.mdio:00, irq=-1) IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready -cpsw 4a100000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx -IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready -random: crng init done +using random self ethernet address +using random host ethernet address +using random self ethernet address +using random host ethernet address +Mass Storage Function, version: 2009/09/11 +LUN: removable file: (no medium) +usb0: HOST MAC 7c:66:9d:4e:30:69 +usb0: MAC 7c:66:9d:4e:30:6a +usb1: HOST MAC 7c:66:9d:4e:30:6c +usb1: MAC 7c:66:9d:4e:30:6d +configfs-gadget gadget: high-speed config #1: c +ti-pruss 4a300000.pruss: creating PRU cores and other child platform devices +remoteproc remoteproc1: 4a334000.pru0 is available +pru-rproc 4a334000.pru0: PRU rproc node /ocp/pruss_soc_bus@4a326000/pruss@4a300000/pru@4a334000 probed successfully +remoteproc remoteproc2: 4a338000.pru1 is available +pru-rproc 4a338000.pru1: PRU rproc node /ocp/pruss_soc_bus@4a326000/pruss@4a300000/pru@4a338000 probed successfully +musb-hdrc musb-hdrc.1: VBUS_ERROR in a_wait_bcon (89, bb49.dts tom@panda:~$ dtc -I dtb -O dts bbbr.dtb >bbbr.dts Yeah diff is huge. I need to take a closer look at how bb49 boots up. Entry: bb49 uBoot log Date: Mon May 7 12:50:44 EDT 2018 U-Boot SPL 2018.01-00002-ge9ff418fb8 (Feb 20 2018 - 20:14:57) Trying to boot from MMC1 U-Boot 2018.01-00002-ge9ff418fb8 (Feb 20 2018 - 20:14:57 -0600), Build: jenkins-github_Bootloader-Builder-38 CPU : AM335X-GP rev 2.1 I2C: ready DRAM: 512 MiB No match for driver 'omap_hsmmc' No match for driver 'omap_hsmmc' Some drivers were not found Reset Source: Global external warm reset has occurred. Reset Source: Global warm SW reset has occurred. Reset Source: Power-on reset has occurred. MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1 Using default environment Board: BeagleBone Black not set. Validating first E-fuse MAC BeagleBone Black: BeagleBone: cape eeprom: i2c_probe: 0x54: BeagleBone: cape eeprom: i2c_probe: 0x55: BeagleBone: cape eeprom: i2c_probe: 0x56: BeagleBone: cape eeprom: i2c_probe: 0x57: Net: eth0: MII MODE cpsw, usb_ether Press SPACE to abort autoboot in 2 seconds board_name=[A335BNLT] ... board_rev=[000C] ... switch to partitions #0, OK mmc0 is current device SD/MMC found on device 0 ** Bad device 0:2 0x82000000 ** ** Bad device 0:2 0x82000000 ** switch to partitions #0, OK mmc0 is current device Scanning mmc 0:1... gpio: pin 56 (gpio 56) value is 0 gpio: pin 55 (gpio 55) value is 0 gpio: pin 54 (gpio 54) value is 0 gpio: pin 53 (gpio 53) value is 1 switch to partitions #0, OK mmc0 is current device gpio: pin 54 (gpio 54) value is 1 Checking for: /uEnv.txt ... Checking for: /boot.scr ... Checking for: /boot/boot.scr ... Checking for: /boot/uEnv.txt ... gpio: pin 55 (gpio 55) value is 1 1879 bytes read in 40 ms (44.9 KiB/s) Loaded environment from /boot/uEnv.txt Checking if uname_r is set in /boot/uEnv.txt... gpio: pin 56 (gpio 56) value is 1 Running uname_boot ... loading /boot/vmlinuz-4.9.82-ti-r102 ... 9970640 bytes read in 667 ms (14.3 MiB/s) uboot_overlays: [uboot_base_dtb=am335x-boneblack-uboot.dtb] ... uboot_overlays: Switching too: dtb=am335x-boneblack-uboot.dtb ... loading /boot/dtbs/4.9.82-ti-r102/am335x-boneblack-uboot.dtb ... 61622 bytes read in 60 ms (1002.9 KiB/s) uboot_overlays: [fdt_buffer=0x60000] ... uboot_overlays: loading /lib/firmware/BB-BONE-eMMC1-01-00A0.dtbo ... 1440 bytes read in 232 ms (5.9 KiB/s) uboot_overlays: loading /lib/firmware/BB-HDMI-TDA998x-00A0.dtbo ... 5127 bytes read in 440 ms (10.7 KiB/s) uboot_overlays: loading /lib/firmware/BB-ADC-00A0.dtbo ... 711 bytes read in 426 ms (1000 Bytes/s) uboot_overlays: loading /lib/firmware/univ-bbb-EVA-00A0.dtbo ... 62008 bytes read in 253 ms (239.3 KiB/s) loading /boot/initrd.img-4.9.82-ti-r102 ... 6092348 bytes read in 416 ms (14 MiB/s) debug: [console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 quiet] ... debug: [bootz 0x82000000 0x88080000:5cf63c 88000000] ... ## Flattened Device Tree blob at 88000000 Booting using the fdt blob at 0x88000000 Loading Ramdisk to 8fa30000, end 8ffff63c ... OK reserving fdt memory region: addr=88000000 size=7e000 Loading Device Tree to 8f9af000, end 8fa2ffff ... OK So this is what it's loading: loading /boot/dtbs/4.9.82-ti-r102/am335x-boneblack-uboot.dtb ... uboot_overlays: loading /lib/firmware/BB-BONE-eMMC1-01-00A0.dtbo ... uboot_overlays: loading /lib/firmware/BB-HDMI-TDA998x-00A0.dtbo ... uboot_overlays: loading /lib/firmware/BB-ADC-00A0.dtbo ... uboot_overlays: loading /lib/firmware/univ-bbb-EVA-00A0.dtbo ... Entry: Move forward Date: Mon May 7 13:11:16 EDT 2018 This is not really getting me there. I need some way to first get it working, then figure out why it's working... Just copy the dtb from one device to another. ssh root@bb49 dtc -I fs -O dtb /sys/firmware/devicetree/base >am335x-boneblack.dtb ssh root@bbbr mount /dev/mmcblk0p1 /mnt scp am335x-boneblack.dtb root@bbbr:/mnt ssh root@bbbr umount /mnt tom@zoe:~$ minicom -C /tmp/bbbr -D /d/bone1 -b 115200 ok that just completely didn't boot copied it back i gues the only thing left is to create a new dtb from the dtbs that uboot is loading. Entry: Overlays Date: Mon May 7 13:26:54 EDT 2018 google for these loading /boot/dtbs/4.9.82-ti-r102/am335x-boneblack-uboot.dtb ... uboot_overlays: loading /lib/firmware/BB-BONE-eMMC1-01-00A0.dtbo ... uboot_overlays: loading /lib/firmware/BB-HDMI-TDA998x-00A0.dtbo ... uboot_overlays: loading /lib/firmware/BB-ADC-00A0.dtbo ... uboot_overlays: loading /lib/firmware/univ-bbb-EVA-00A0.dtbo ... So this does mention PRUSS https://github.com/beagleboard/bb.org-overlays/blob/master/src/arm/univ-bbb-EVA-00A0.dts Also a file specific for PRU enabling: https://github.com/beagleboard/bb.org-overlays/blob/master/src/arm/AM335X-PRU-RPROC-4-9-TI-00A0.dts I can't find the source for am335x-boneblack-uboot.dtb So let's dump it OK, so that doesn't make a difference. I need to start over and find exactly the same setup. I don't see how else to get this going.. Entry: How to compile the debian images? Date: Mon May 7 13:50:40 EDT 2018 git clone git://github.com/beagleboard/image-builder.git && cd image-builder ./beagleboard.org_image.sh They say it only works on ARM. I only really need the kernel, so I guess I'll manage.. This needs to run on arm, but let it do its unpacking. tom@buildroot:~/image-builder$ ./beagleboard.org_jessie_image.sh Yeah I can't make much sense if this either. Start with kconfig? Entry: bb49:/proc/config.gz Date: Mon May 7 14:13:22 EDT 2018 -CONFIG_UIO_PRUSS=m Maybe I had set this as a module? Full diff isn't much: -# CONFIG_RCU_EXPERT is not set +CONFIG_RT_GROUP_SCHED=y +CONFIG_SLAB=y +CONFIG_OPROFILE=m +CONFIG_JUMP_LABEL=y -CONFIG_PREEMPT_RT_FULL=y -CONFIG_EFI=y +CONFIG_CPU_IDLE=y +CONFIG_CPU_IDLE_GOV_LADDER=y +CONFIG_ARM_CPUIDLE=y +CONFIG_BCACHE=m -CONFIG_FB_EFI=y +CONFIG_LEDS_TRIGGER_CPU=y -CONFIG_RTC_DRV_EFI=y -CONFIG_UIO_PRUSS=m -CONFIG_EFI_VARS=y Entry: I can't get this shit too work... too much mud Date: Mon May 7 14:46:56 EDT 2018 Really, I need only this: - linux kernel with correct version - .config - dts How to find those? Is the PRU enabled by the bootloader maybe? Entry: Reconstruct the image Date: Mon May 7 14:48:52 EDT 2018 1. same kernel 2. same dts 3. same bootloader Same kernel first: Adjusting buildroot config to use the one in the current debian image: http://debian.beagleboard.org/images/bone-debian-9.3-iot-armhf-2018-03-05-4gb.img.xz 4.9.82-ti-r102 960d4b4bc998942d0642df2246a79c6cd5e9eb5d Yeah that didn't do much either. What am I missing. Entry: /sys mention of pru Date: Mon May 7 15:54:37 EDT 2018 # cd /sys # find -name '*pru*' ./devices/platform/ocp/4a326000.pruss-soc-bus ./devices/platform/ocp/480c8000.mailbox/mbox/mbox_pru1 ./devices/platform/ocp/480c8000.mailbox/mbox/mbox_pru0 ./class/mbox/mbox_pru1 ./class/mbox/mbox_pru0 ./firmware/devicetree/base/__symbols__/mbox_pru1 ./firmware/devicetree/base/__symbols__/P9_19_pru_uart_pin ./firmware/devicetree/base/__symbols__/pru1 ./firmware/devicetree/base/__symbols__/pruss ./firmware/devicetree/base/__symbols__/pruss_soc_bus ./firmware/devicetree/base/__symbols__/P9_20_pru_uart_pin ./firmware/devicetree/base/__symbols__/mbox_pru0 ./firmware/devicetree/base/__symbols__/pru0 ./firmware/devicetree/base/__symbols__/pruss_ocp_gclk ./firmware/devicetree/base/__symbols__/pruss_mdio ./firmware/devicetree/base/__symbols__/pruss_intc ./firmware/devicetree/base/ocp/pruss_soc_bus@4a326000 ./firmware/devicetree/base/ocp/pruss_soc_bus@4a326000/pruss@4a300000 ./firmware/devicetree/base/ocp/pruss_soc_bus@4a326000/pruss@4a300000/pru@4a338000 ./firmware/devicetree/base/ocp/pruss_soc_bus@4a326000/pruss@4a300000/pru@4a334000 ./firmware/devicetree/base/ocp/mailbox@480C8000/mbox_pru1 ./firmware/devicetree/base/ocp/mailbox@480C8000/mbox_pru0 ./firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_20_pru_uart_pin ./firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_19_pru_uart_pin ./firmware/devicetree/base/ocp/l4_wkup@44c00000/prcm@200000/clocks/pruss_ocp_gclk@530 ./bus/platform/devices/4a326000.pruss-soc-bus ./bus/platform/drivers/pru-rproc ./bus/platform/drivers/ti-pruss ./bus/platform/drivers/pruss-intc ./module/pru_rproc ./module/pru_rproc/drivers/platform:pru-rproc ./module/pruss ./module/pruss/holders/pru_rproc ./module/pruss/drivers/platform:ti-pruss ./module/pruss_intc ./module/pruss_intc/holders/pru_rproc ./module/pruss_intc/drivers/platform:pruss-intc Diff with the other one: tom@zoe:~$ ssh root@bbbr find /sys -name '*pru*' > find_pru_bbbr tom@zoe:~$ ssh root@bb49 find /sys -name '*pru*' > find_pru_bb49 tom@zoe:~$ diff -Naur find_pru_bbbr find_pru_bb49 | grep '^+' +++ find_pru_bb49 2018-05-07 15:57:25.281996203 -0400 +/sys/kernel/debug/clk/pruss_ocp_gclk +/sys/devices/platform/ocp/4a326000.pruss-soc-bus/4a300000.pruss +/sys/devices/platform/ocp/4a326000.pruss-soc-bus/4a300000.pruss/4a338000.pru1 +/sys/devices/platform/ocp/4a326000.pruss-soc-bus/4a300000.pruss/4a334000.pru0 +/sys/firmware/devicetree/base/__symbols__/P9_30_pruout_pin +/sys/firmware/devicetree/base/__symbols__/P9_92_pruin_pin +/sys/firmware/devicetree/base/__symbols__/P9_30_pruin_pin +/sys/firmware/devicetree/base/__symbols__/P9_24_pru_uart_pin +/sys/firmware/devicetree/base/__symbols__/P9_42_pru_ecap_pin +/sys/firmware/devicetree/base/__symbols__/P9_26_pruin_pin +/sys/firmware/devicetree/base/__symbols__/P9_27_pruout_pin +/sys/firmware/devicetree/base/__symbols__/P8_15_pru_ecap_pin +/sys/firmware/devicetree/base/__symbols__/P9_91_pruout_pin +/sys/firmware/devicetree/base/__symbols__/P8_15_pruin_pin +/sys/firmware/devicetree/base/__symbols__/P9_24_pruin_pin +/sys/firmware/devicetree/base/__symbols__/P9_17_pru_uart_pin +/sys/firmware/devicetree/base/__symbols__/P9_21_pru_uart_pin +/sys/firmware/devicetree/base/__symbols__/P9_26_pru_uart_pin +/sys/firmware/devicetree/base/__symbols__/P8_11_pruout_pin +/sys/firmware/devicetree/base/__symbols__/P9_27_pruin_pin +/sys/firmware/devicetree/base/__symbols__/P9_92_pruout_pin +/sys/firmware/devicetree/base/__symbols__/P9_41_pruin_pin +/sys/firmware/devicetree/base/__symbols__/P9_91_pruin_pin +/sys/firmware/devicetree/base/__symbols__/P9_18_pru_uart_pin +/sys/firmware/devicetree/base/__symbols__/P9_22_pru_uart_pin +/sys/firmware/devicetree/base/__symbols__/P8_12_pruout_pin +/sys/firmware/devicetree/base/__symbols__/P8_16_pruin_pin +/sys/firmware/devicetree/base/ocp/pruss@4a300000 +/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_42_pru_ecap_pin +/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_91_pruout_pin +/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_27_pruin_pin +/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_41_pruin_pin +/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_91_pruin_pin +/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P8_15_pru_ecap_pin +/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P8_11_pruout_pin +/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_92_pruout_pin +/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P8_16_pruin_pin +/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_17_pru_uart_pin +/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_21_pru_uart_pin +/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_26_pru_uart_pin +/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P8_12_pruout_pin +/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_18_pru_uart_pin +/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_92_pruin_pin +/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_22_pru_uart_pin +/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_30_pruin_pin +/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_30_pruout_pin +/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_26_pruin_pin +/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_27_pruout_pin +/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P8_15_pruin_pin +/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_24_pruin_pin +/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_24_pru_uart_pin +/sys/bus/platform/devices/4a300000.pruss +/sys/bus/platform/devices/4a338000.pru1 +/sys/bus/platform/devices/4a334000.pru0 +/sys/bus/platform/drivers/pru-rproc/4a338000.pru1 +/sys/bus/platform/drivers/pru-rproc/4a334000.pru0 +/sys/bus/platform/drivers/ti-pruss/4a300000.pruss +/sys/bus/platform/drivers/pruss-soc-bus +/sys/bus/platform/drivers/pruss-soc-bus/4a326000.pruss-soc-bus +/sys/module/pruss_soc_bus +/sys/module/pruss_soc_bus/drivers/platform:pruss-soc-bus this was it: # modprobe pruss_soc_bus [ 784.591205] ti-pruss 4a300000.pruss: creating PRU cores and other child platform devices [ 784.603419] remoteproc remoteproc1: 4a334000.pru0 is available [ 784.609603] pru-rproc 4a334000.pru0: PRU rproc node /ocp/pruss_soc_bus@4a326000/pruss@4a300000/pru@4a334000 probed successfully [ 784.623308] remoteproc remoteproc2: 4a338000.pru1 is available [ 784.629481] pru-rproc 4a338000.pru1: PRU rproc node /ocp/pruss_soc_bus@4a326000/pruss@4a300000/pru@4a338000 probed successfully Entry: Today, action day Date: Tue May 8 08:28:01 EDT 2018 Get the PRU to do something. First, set up beaglelogic code so I can compile and deploy. Assume kernel sources are in buildroot staging dir. Entry: Remoteproc and RPMsg Date: Tue May 8 09:30:23 EDT 2018 http://processors.wiki.ti.com/index.php/PRU-ICSS_Remoteproc_and_RPMsg echo 'am335x-pru0-fw' > /sys/class/remoteproc/remoteproc1/firmware echo 'am335x-pru1-fw' > /sys/class/remoteproc/remoteproc2/firmware echo 'start' > /sys/class/remoteproc/remoteproc1/state echo 'start' > /sys/class/remoteproc/remoteproc2/state [63936.328531] remoteproc remoteproc1: powering up 4a334000.pru0 [63936.335474] remoteproc remoteproc1: Booting fw image am335x-pru0-fw, size 56464 [63936.343738] ti-pruss 4a300000.pruss: configured system_events = 0x0000000001d30000 intr_channels = 0x00000037 host_intr = 0x00000037 [63936.356414] remoteproc remoteproc1: remote processor 4a334000.pru0 is now up [63947.627878] remoteproc remoteproc2: powering up 4a338000.pru1 [63947.634644] remoteproc remoteproc2: Booting fw image am335x-pru1-fw, size 31384 [63947.642861] remoteproc remoteproc2: remote processor 4a338000.pru1 is now up Next: get beaglelogic to do something. Probably needs DT changes. Entry: tutorials Date: Tue May 8 22:29:49 EDT 2018 http://theduchy.ualr.edu/?p=996 http://processors.wiki.ti.com/index.php/PRU_Training:_Hands-on_Labs Entry: BeagleLogic setup Date: Wed May 9 07:48:00 EDT 2018 Just work through the motions. Question: how to convert the dt overlay to include directly into the dt? Entry: Changing DT props at run time Date: Tue May 15 09:07:54 EDT 2018 https://developer.ridgerun.com/wiki/index.php?title=Edit_device_tree_at_run_time sudo apt-get install device-tree-compiler fdtdump fdtget fdtput Entry: Next: configure PRU pins Date: Tue May 15 16:03:10 EDT 2018 This is a pinmux thing. Where is that configured? dtc is now on the target, so have it dump config. EDIT: # cat /usr/bin/dts.sh #!/bin/sh exec dtc -I fs -O dts /sys/firmware/devicetree/base dts.sh |grep P9 Looking at that file doesn't help me much, but it might be good to start from a concrete goal: I want to put 10MHz on PRU1 GPO pin 0. Search for this backwards: R1 P8_45 pr1_pru1_pru_r30_0 GPIO2_6 http://ofitselfso.com/BeagleNotes/UsingDeviceTreesToConfigurePRUIOPins.php - build and execute DT overlay - mount -t debugfs none /sys/kernel/debug - /sys/kernel/debug/pinctrl/44e10800.pinmux/pins Bit Number 8 7 6 5 4 3 2 1 0 c r s p m m m m = 3 mode bits [0-7] p = 0 pullups/pulldowns enabled, 1 pullups/pulldowns disabled s = 0 pulldown selected, 1 pullup selected r = 0 pin is output, 1 pin is input c = 0 fast slew control, 1 = slow slew control "is the PinMux pin at offset 0x838 in use by anything else"? /sys/kernel/debug/pinctrl/44e10800.pinmux/pinmux-pins P8_16 Mode6 /* * This is a template-generated file from BoneScript */ /dts-v1/; /plugin/; /{ compatible = "ti,beaglebone", "ti,beaglebone-black"; part_number = "BS_PINMODE_P8_16_0x26"; exclusive-use = "P8.16", "pr1_pru0_pru_r31_14"; fragment@0 { target = <&am33xx_pinmux>; __overlay__ { bs_pinmode_P8_16_0x26: pinmux_bs_pinmode_P8_16_0x26 { pinctrl-single,pins = <0x038 0x26>; }; }; }; fragment@1 { target = <&ocp>; __overlay__ { bs_pinmode_P8_16_0x26_pinmux { compatible = "bone-pinmux-helper"; status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&bs_pinmode_P8_16_0x26>; }; }; }; }; So questions. - Why are there two things instead of one? - What the fuck does this all mean? Aha. There are two things, because the top one creates a node inside the am33xx_pinmux node, and the bottom one references it. It seems the parent node (ocp) is rather arbitrary. So how to do this: - look up the pin mode in /sys/kernel/debug/pinctrl/44e10800.pinmux/pins In reference manual, pinmux is part of 44C00000 L4_WKUP 44E10000 Control Module 44E10800 pin mux Pin mux documentation is in 9.3.1.50 conf__ register, and Table 9-10, Control Module Registers Table/ See /sys/kernel/debug/pinctrl/44e10800.pinmux/pins This relates pin number, pin control address and control value. Now, how to map Beaglebone P8,P9 pins to mux pin number? I still want this one: R1 P8_45 pr1_pru1_pru_r30_0 GPIO2_6 So let's grep in linux/arch/arm/boot/dts/*bone* Found something here: am335x-bone-common-universal.dtsi P8_45_pinmux { compatible = "bone-pinmux-helper"; status = "okay"; pinctrl-names = "default", "gpio", "gpio_pu", "gpio_pd", "pruout", "pruin","pwm", "hdmi"; pinctrl-0 = <&P8_45_default_pin>; pinctrl-1 = <&P8_45_gpio_pin>; pinctrl-2 = <&P8_45_gpio_pu_pin>; pinctrl-3 = <&P8_45_gpio_pd_pin>; pinctrl-4 = <&P8_45_pruout_pin>; pinctrl-5 = <&P8_45_pruin_pin>; pinctrl-6 = <&P8_45_pwm_pin>; pinctrl-7 = <&P8_45_hdmi_pin>; }; The individual pin configurations are in am335x-bone-common-universal-pins.dtsi /* P8_45 (ZCZ ball R1 ) hdmi */ P8_45_default_pin: pinmux_P8_45_default_pin { pinctrl-single,pins = <0x0a0 0x27>; }; /* Mode 7, Pull-Down, RxActive */ P8_45_gpio_pin: pinmux_P8_45_gpio_pin { pinctrl-single,pins = <0x0a0 0x2F>; }; /* Mode 7, RxActive */ P8_45_gpio_pu_pin: pinmux_P8_45_gpio_pu_pin { pinctrl-single,pins = <0x0a0 0x37>; }; /* Mode 7, Pull-Up, RxActive */ P8_45_gpio_pd_pin: pinmux_P8_45_gpio_pd_pin { pinctrl-single,pins = <0x0a0 0x27>; }; /* Mode 7, Pull-Down, RxActive */ P8_45_pruout_pin: pinmux_P8_45_pruout_pin { pinctrl-single,pins = <0x0a0 0x05>; }; /* Mode 5, Pull-Down*/ P8_45_pruin_pin: pinmux_P8_45_pruin_pin { pinctrl-single,pins = <0x0a0 0x26>; }; /* Mode 6, Pull-Down, RxActive */ P8_45_pwm_pin: pinmux_P8_45_pwm_pin { pinctrl-single,pins = <0x0a0 0x03>; }; /* Mode 3, Pull-Down*/ P8_45_hdmi_pin: pinmux_P8_45_hdmi_pin { pinctrl-single,pins = <0x0a0 0x08>; }; /* lcd_data0.lcd_data0, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ Questions: - what is "bone-pinmux-helper"? - what does "compatible" mean? What I get from this is that pinmux allows to switch between pincontrols. Also, I probably need to disable HDMI. HDMI is 40-59 44e108a0-44e108ec # cat pinmux-pins |grep hdmi pin 40 (PIN40): 0-0070 (GPIO UNCLAIMED) function nxp_hdmi_bonelt_pins group nxp_hdmi_bonelt_pins pin 41 (PIN41): 0-0070 (GPIO UNCLAIMED) function nxp_hdmi_bonelt_pins group nxp_hdmi_bonelt_pins pin 42 (PIN42): 0-0070 (GPIO UNCLAIMED) function nxp_hdmi_bonelt_pins group nxp_hdmi_bonelt_pins pin 43 (PIN43): 0-0070 (GPIO UNCLAIMED) function nxp_hdmi_bonelt_pins group nxp_hdmi_bonelt_pins pin 44 (PIN44): 0-0070 (GPIO UNCLAIMED) function nxp_hdmi_bonelt_pins group nxp_hdmi_bonelt_pins pin 45 (PIN45): 0-0070 (GPIO UNCLAIMED) function nxp_hdmi_bonelt_pins group nxp_hdmi_bonelt_pins pin 46 (PIN46): 0-0070 (GPIO UNCLAIMED) function nxp_hdmi_bonelt_pins group nxp_hdmi_bonelt_pins pin 47 (PIN47): 0-0070 (GPIO UNCLAIMED) function nxp_hdmi_bonelt_pins group nxp_hdmi_bonelt_pins pin 48 (PIN48): 0-0070 (GPIO UNCLAIMED) function nxp_hdmi_bonelt_pins group nxp_hdmi_bonelt_pins pin 49 (PIN49): 0-0070 (GPIO UNCLAIMED) function nxp_hdmi_bonelt_pins group nxp_hdmi_bonelt_pins pin 50 (PIN50): 0-0070 (GPIO UNCLAIMED) function nxp_hdmi_bonelt_pins group nxp_hdmi_bonelt_pins pin 51 (PIN51): 0-0070 (GPIO UNCLAIMED) function nxp_hdmi_bonelt_pins group nxp_hdmi_bonelt_pins pin 52 (PIN52): 0-0070 (GPIO UNCLAIMED) function nxp_hdmi_bonelt_pins group nxp_hdmi_bonelt_pins pin 53 (PIN53): 0-0070 (GPIO UNCLAIMED) function nxp_hdmi_bonelt_pins group nxp_hdmi_bonelt_pins pin 54 (PIN54): 0-0070 (GPIO UNCLAIMED) function nxp_hdmi_bonelt_pins group nxp_hdmi_bonelt_pins pin 55 (PIN55): 0-0070 (GPIO UNCLAIMED) function nxp_hdmi_bonelt_pins group nxp_hdmi_bonelt_pins pin 56 (PIN56): 0-0070 (GPIO UNCLAIMED) function nxp_hdmi_bonelt_pins group nxp_hdmi_bonelt_pins pin 57 (PIN57): 0-0070 (GPIO UNCLAIMED) function nxp_hdmi_bonelt_pins group nxp_hdmi_bonelt_pins pin 58 (PIN58): 0-0070 (GPIO UNCLAIMED) function nxp_hdmi_bonelt_pins group nxp_hdmi_bonelt_pins pin 59 (PIN59): 0-0070 (GPIO UNCLAIMED) function nxp_hdmi_bonelt_pins group nxp_hdmi_bonelt_pins pin 108 (PIN108): 0-0070 (GPIO UNCLAIMED) function nxp_hdmi_bonelt_pins group nxp_hdmi_bonelt_pins Entry: Pin control subsystem Date: Tue May 15 20:28:08 EDT 2018 https://www.kernel.org/doc/Documentation/pinctrl.txt Entry: Another example for PRU pin config Date: Wed May 16 09:19:03 EDT 2018 https://gist.github.com/shirriff/11d3e9b550b6c33040548403750ea0e4 Entry: DT Date: Wed May 16 12:55:43 EDT 2018 Trying some DT things. Not getting what I expected.. # cat pinmux-pins |grep hatd pin 9 (PIN9): 4a300000.pruss (GPIO UNCLAIMED) function hatd_pru_pins group hatd_pru_pins Will now use copy& paste like this: &am33xx_pinmux { hatd_pru_pins: hatd_pru_pins { pinctrl-single,pins = < // Copied from am335-bone-common-universal-pins.dtsi // Can't figure out how else to just reference those definitions. 0x0a0 0x27 // P8_45_pruout_pin 0x0a4 0x27 // P8_46_pruout_pin >; }; }; Which works: # grep -re hatd * pingroups:group: hatd_pru_pins pinmux-functions:function: hatd_pru_pins, groups = [ hatd_pru_pins ] pinmux-pins:pin 40 (PIN40): 4a300000.pruss (GPIO UNCLAIMED) function hatd_pru_pins group hatd_pru_pins pinmux-pins:pin 41 (PIN41): 4a300000.pruss (GPIO UNCLAIMED) function hatd_pru_pins group hatd_pru_pins Entry: Next Date: Wed May 16 13:07:22 EDT 2018 So pins are set as output. This should now just work if I add some PRU code that performs toggling. Entry: PRU toggle Date: Mon May 21 07:33:48 EDT 2018 http://processors.wiki.ti.com/index.php/PRU_Assembly_Instructions#Set_Bit_.28SET.29 R30 = output (0=0) R31 = input (1=I) How to use CLR,SET on GPO R30, if reading from GPO reg isn't the same as writing? It seems a copy needs to be kept to be able to use: CLR R30, TEMPLATE, BIT That's not a big problem. Plenty of registers. Cycle counter? http://processors.wiki.ti.com/index.php/Programmable_Realtime_Unit PRU Cycle Count Register (0x000C) PRU Stall Count Register (0x0010) So make a minimal modification to the beaglelogic loop. Try the one that has 10MHz/8bit sampling. ; Generic delay loop macro ; Also includes a post-finish op DELAY .macro Rx, op SUB R0, Rx, 2 QBEQ $E?, R0, 0 $M?: SUB R0, R0, 1 QBNE $M?, R0, 0 $E?: op .endm samplexm8: MOV R21.b0, R31.b0 DELAY R14, NOP MOV R21.b1, R31.b0 DELAY R14, NOP $samplexm8$2: MOV R21.b2, R31.b0 DELAY R14, NOP MOV R21.b3, R31.b0 DELAY R14, NOP MOV R22.b0, R31.b0 DELAY R14, NOP MOV R22.b1, R31.b0 DELAY R14, NOP MOV R22.b2, R31.b0 DELAY R14, NOP MOV R22.b3, R31.b0 DELAY R14, NOP MOV R23.b0, R31.b0 DELAY R14, NOP MOV R23.b1, R31.b0 DELAY R14, NOP MOV R23.b2, R31.b0 DELAY R14, NOP MOV R23.b3, R31.b0 DELAY R14, NOP MOV R24.b0, R31.b0 DELAY R14, NOP MOV R24.b1, R31.b0 DELAY R14, NOP MOV R24.b2, R31.b0 DELAY R14, NOP MOV R24.b3, R31.b0 DELAY R14, NOP MOV R25.b0, R31.b0 DELAY R14, NOP MOV R25.b1, R31.b0 DELAY R14, NOP MOV R25.b2, R31.b0 DELAY R14, NOP MOV R25.b3, R31.b0 DELAY R14, NOP MOV R26.b0, R31.b0 DELAY R14, NOP MOV R26.b1, R31.b0 DELAY R14, NOP MOV R26.b2, R31.b0 DELAY R14, NOP MOV R26.b3, R31.b0 DELAY R14, NOP MOV R27.b0, R31.b0 DELAY R14, NOP MOV R27.b1, R31.b0 DELAY R14, NOP MOV R27.b2, R31.b0 DELAY R14, NOP MOV R27.b3, R31.b0 DELAY R14, NOP MOV R28.b0, R31.b0 DELAY R14, NOP MOV R28.b1, R31.b0 DELAY R14, NOP MOV R28.b2, R31.b0 DELAY R14, "ADD R29, R29, 32" MOV R28.b3, R31.b0 DELAY R14, "XOUT 10, &R21, 36" MOV R21.b0, R31.b0 DELAY R14, "LDI R31, PRU1_PRU0_INTERRUPT + 16" MOV R21.b1, R31.b0 DELAY R14, "JMP $samplexm8$2" So, for sure, the first thing I'm going to do is to make a generator for this that exposes the 3 different tasks: - DELAY - sample: R21-R28 8 x 4 bytes = 32 bytes preroll MOV R21.b0, R31.b0 MOV R21.b1, R31.b0 loop MOV R21.b2, R31.b0 MOV R21.b3, R31.b0 MOV R22.b0, R31.b0 MOV R22.b1, R31.b0 MOV R22.b2, R31.b0 MOV R22.b3, R31.b0 MOV R23.b0, R31.b0 MOV R23.b1, R31.b0 MOV R23.b2, R31.b0 MOV R23.b3, R31.b0 MOV R24.b0, R31.b0 MOV R24.b1, R31.b0 MOV R24.b2, R31.b0 MOV R24.b3, R31.b0 MOV R25.b0, R31.b0 MOV R25.b1, R31.b0 MOV R25.b2, R31.b0 MOV R25.b3, R31.b0 MOV R26.b0, R31.b0 MOV R26.b1, R31.b0 MOV R26.b2, R31.b0 MOV R26.b3, R31.b0 MOV R27.b0, R31.b0 MOV R27.b1, R31.b0 MOV R27.b2, R31.b0 MOV R27.b3, R31.b0 MOV R28.b0, R31.b0 MOV R28.b1, R31.b0 MOV R28.b2, R31.b0 MOV R28.b3, R31.b0 MOV R21.b0, R31.b0 MOV R21.b1, R31.b0 - transfer ADD R29, R29, 32 XOUT 10, &R21, 36 LDI R31, PRU1_PRU0_INTERRUPT + 16 JMP $samplexm8$2 The important part in the sample vs transfer, is that XOUT is called right before the next sample is read into the first register R21. How to abstract this out, so it becomes easy to weave it? Basic principles: - Try to do this without modifying beaglelogic ARM code - Keep PRU0 code the same as well, modify PRU1 only So analysis needs to be limited to PRU1 code. - Main loop is straightforward: - Sample into R21-R28 - XOUT to PRU0 - Interrupt PRU0 How large is the code memory? Important? If I use delay loops, I shouldn't run out. Main loop register use? R0 intermediate (DELAY) R14 delay count R21-R28 buffer R30,R31 IO Goal: - write an alternative PRU1 firmware similar to PRUDAQ, keeping the rest the same. - create a weaver There should be plenty of time to create some call/return functions. PRU has a pseudo CALL instruction, which is enough for a single stack level stored in a register. I.e. a code threader. JAL REG, ADDR : jump and link JMP REG.w0 : return Entry: Beaglelogic PRU1 startup Date: Mon May 21 08:22:20 EDT 2018 Analysis of beaglelogic control flow. - PRU1 goes into infinite loop. How does it exit? beaglelogic.c beaglelogic_stop: beaglelogic_request_stop wait_event_interruptible (->state == STATE_BL_INITIALIZED) STATE_BL_INITIALIZED is set in: - beaglelogic_serve_irq - beaglelogic_probe beaglelogic_request_stop = pruss_intc_trigger(bldev->to_bl_irq) This is set up as: bldev->to_bl_irq = platform_get_irq_byname(pdev, "to_bl"); From DTS: interrupts = <22>, <23>, <24>; interrupt-names = "from_bl_1", "to_bl", "from_bl_2"; PRU0 checks R31 bit 31: PRU interrupt 1 from INTC. What is INTC? PRU interrupt controller. http://processors.wiki.ti.com/index.php/PRU_Interrupt_Controller How does PRU1 get stopped? It is reset by PRU0 PCTRL_OTHER(0x0000) &= (uint16_t)~CONTROL_SOFT_RST_N; Entry: General "task" structure Date: Mon May 21 08:32:40 EDT 2018 PRU runs at 200MHz. Main loop is at 10MHz. There are 20 instructions per loop. Two are reserved for the general skeleton. This leaves 18 instructions per tick. Should scheduling be static or dynamic? Conceptually, there are only two tasks: - general sampling skeleton - interleaved code to run at each tick The sampling skeleton could provide the timing based on the cycle counter. Entry: Read cycle counter Date: Mon May 21 08:41:57 EDT 2018 Is memory-mapped at 0xC. https://nerdhut.de/2016/06/18/beaglebone-clock-cycle-counter/ Only counts up to 0xFFFFFFFF and needs to be reset (disabled then enabled). Looks like it will be too messy to use. Entry: Beaglelogic XOUT 10, &R21, 36 Date: Mon May 21 09:28:23 EDT 2018 10: Bank0 R21: start register 36: 36 bytes this is 32 data bytes + 4 bytes counter. the counter is apparently not used. http://theembeddedkitchen.net/beaglelogic-building-a-logic-analyzer-with-the-prus-part-1/449 Entry: Delay Date: Mon May 21 09:34:40 EDT 2018 ; Generic delay loop macro ; Also includes a post-finish op DELAY .macro Rx, op SUB R0, Rx, 2 QBEQ $E?, R0, 0 $M?: SUB R0, R0, 1 QBNE $M?, R0, 0 $E?: op .endm DELAY R14 is then: SUB R0, R14, 2 QBEQ done, R0, 0 ;; why this? loop: SUB R0, R0, 1 QBNE loop, R0, 0 done: I can use a simpler one. That QBEQ is not necessary. Entry: Instruction latencies Date: Mon May 21 10:18:15 EDT 2018 http://processors.wiki.ti.com/index.php/AM335x_PRU_Read_Latencies Entry: Monadic assembly language Date: Mon May 21 12:13:13 EDT 2018 What I want: - convert assembly program to trace, to allow timing validation - have something that looks like assembly as the "user interface" This is what it should look like: test :: m () test = do mov r10 r11 Assembly instructions do not return a value, so the type is just the monad in which it is evaluated. Essentially, a variant of a writer monad. Arguments do return a value, which is the reference to be passed to the implementation of mov. r10 :: m r Where r is to be determined, representing some kind of argument. This leads to the type mov :: m r -> m r -> m () To translate this to r -> r -> m(), it a default evaluation order is assumed: mov a b = do ra <- a rb <- b mov' ra rb where mov' :: r -> r -> m () This should provide enough of a skeleton. Entry: Jumps vs. unrolling Date: Mon May 21 12:50:55 EDT 2018 Two different semantics are needed: one that produces "assembly code", where jumps are represented symbolically, and one that executes the jumps. Executing the jumps is the same as inlining the code. This means a label "is" a program. main = do loop loop = do mov r10 r11 mov r11 r10 jmp loop As an assembly program, this should generate the label. As trace interpretation, this should generate the infintate trace. It needs to be done like this: main = do loop <- label mov r10 r11 mov r11 r10 jmp loop The base monad for trace is a state-continuation monad. I've done that before, and then it was also more instructive to implement it explicitly. Edit: labels need circular references, so some global state needs to be used to "patch" this. The test here is to write a mutually recursive loop structure. The idea is likely to separate declaration of labels from definition. test_loop = do label1 <- label label2 <- label def label1 $ do mov r10 r11 jmp label2 def label2 $ do mov r11 r10 jmp label1 It doesn't seem possible to use the Haskell language-level "letrec" to define graph data structures that have label-decoupling. This seems to point at something important: it is not possible to resolve this in a single pass. Or is it? No. The monad structure enforces strict order! So two pases are needeed: - construct flat program - interpret, using label table It seems to be either/or: - do not use explicit labels, and only be able to create infinite structures - use labels and use a two-pass approach a third way: create a "recursion stop" where unrolling stops if a label is found a second time, where it is replaced by a jump. This would allow code lie loop = do label "loop" mov r10 r11 mov r11 r10 loop Anyways... getting off track. It seems that an explicit interpreter is the way to go. This means the state continuation monad is not necessary. EDIT: Still trying the SC route. To make this two-pass, the first pass should produce a map of basic blocks. Then this can be executed by jumping into a particular basic block. Entry: Needs a rethink.... Date: Mon May 21 17:25:27 EDT 2018 To be able to "emulate" the coroutines, it is necessary to perform run-time jumps. I don't see a simpler way than using an explicit interpreter where memory is numerically indexed. Entry: 2-pass Date: Mon May 21 21:35:46 EDT 2018 So I now have a 2-pass that produces a list of instructions with jump targets properly encoded. I don't really need instructions though. An indexable list of state transformers is enough. EDIT: So an instruction is a state transformer, and a state is a Data.Map of registers + PC. Entry: Register byte access Date: Wed May 23 09:22:29 EDT 2018 This complicates things a bit. EDIT: Done Entry: Interleaving streams Date: Wed May 23 16:08:40 EDT 2018 Interesting problem. - phase + pre-roll - one of them needs the JMP In this case, there is the sampling, which needs to be started off at a particular well-defined point, and the transfer loop, which "locked" to the sample loop in that the write out needs to come right in between the last sample aquisition in the current block, and the first in the next block. It's easy to do by hand, but not so easy to automate. Conceptually, the sample loop needs to be "pulled up" a couple of ticks to allow for the write loop to align properly. That way the write loop can have a fixed position. How to express this? Suppose there are only two loops: - sample + I/O control loop - write out + nop pad EDIT: Got it. This is a door opener. Entry: knot tying for labels Date: Wed May 23 20:43:06 EDT 2018 https://stackoverflow.com/questions/11060565/tying-the-knot-with-a-state-monad https://wiki.haskell.org/wikiupload/1/14/TMR-Issue6.pdf Assembly: Circular Programming with Recursive do The idea is to pass in an environment, but not use it until there has been a path that produces the association table, such that the environment can then be fed into the computation. Entry: Trying Writer output for logs Date: Thu May 24 13:08:00 EDT 2018 But obviously, can't have infinite program. EDIT: Was fixable. Entry: Parameterizing the emulator Writer monoid Date: Thu May 24 17:06:05 EDT 2018 Would be good for instrumentation. Will require some type->data changes + instances. This is actually a lot of work to push that parameter all the way down and add tagging everywhere. There must be a simpler way. What is it I actually want to do. I want to record time stamps of particular events. Why not use (String,MachineState)? EDIT: Trying some more things. Currently it is not possible to interleave pseudo ops that do not take instruction space. It doesn't seem straightforward to change this. I'm already getting into the "implementation is law" part of this project it seems. Anyway, it is possible by modifying the Map. Probably a good idea to implement. This requires "zero width" instructions. EDIT: Working. Maybe try parameterizing the log anyway? This is the trick: {-# LANGUAGE GeneralizedNewtypeDeriving #-} Entry: Generic tracer works Date: Thu May 24 23:08:04 EDT 2018 let log = do -- This is the compile time context. -- Compile a pseudo instruction that will query Time at run time. pseudo $ do -- This is the run time context. t <- loadm Time tell $ "sample: " ++ show t ++ "\n" Now it is a bit confusing due to the compile time / run time distinction. What his does is to insert a pseudo instruction in the stream with the provided behavior. Entry: R30, R31 Date: Wed Jun 6 17:48:07 EDT 2018 gpio action: write R30 read R31 what about the other way around. Entry: changing pinmux at runtime Date: Mon Jun 11 12:49:05 EDT 2018 https://e2e.ti.com/support/arm/sitara_arm/f/791/t/591758?Linux-AM3358-Changing-pinmux-at-runtime https://briancode.wordpress.com/2015/01/06/working-with-pwm-on-a-beaglebone-black/ Note that the state can be set like this, root@beaglebone:~# echo pwm > /sys/devices/ocp.*/P9_14_pinmux.*/state EDIT: This says: NOTE: You CAN NOT use either SPI0 or SPI1 at runtime, IT MUST BE ENABLED AT BOOT in uEnv.txt https://elinux.org/BeagleBone_Black_Enable_SPIDEV Entry: I2C Date: Tue Jun 12 09:14:20 EDT 2018 TRM Section 21 3 Instances: one connected to wakeup and PRU, the others to MPU. Registers are at: l4_wkup 44c00000 i2c0 44e0b000 l4_per 48000000 i2c1 4802a000 i2c2 4819c000 For now, focus on one of them. Apart from initial setup, the I2C interrupts are most important to set up. There are 12 types described in 21.3.11. Section 21.3.15 How to Program I2C It is clear that modifying the linux driver is probably the way to go. There is already a lot of setup in there. There was the ti message: https://e2e.ti.com/support/arm/sitara_arm/f/791/t/501656 The i2c driver does not support the slave mode functionality. It configures the Sitara I2C controller as a master. In order to set sitara i2c as slave, you must set OMAP_I2C_CON_MST = 0x0; for this you need to modify the omap-i2c driver, specifically the i2c init function & omap_i2c_xfer_msg() function. Grepping for OMAP_I2C_CON_MST tom@buildroot:/i/buildroot/home/tom/gw_buildroot/bbb-linux$ grep -re OMAP_I2C_CON_MST * drivers/i2c/busses/i2c-omap.c:#define OMAP_I2C_CON_MST (1 << 10) /* Master/slave mode */ drivers/i2c/busses/i2c-omap.c: w = OMAP_I2C_CON_EN | OMAP_I2C_CON_MST | OMAP_I2C_CON_STT; Entry: drivers/i2c/busses/i2c-omap.c Date: Tue Jun 12 11:20:22 EDT 2018 I need to start at the very beginning. How does the driver get initialized? static int __init omap_i2c_init_driver(void) { return platform_driver_register(&omap_i2c_driver); } subsys_initcall(omap_i2c_init_driver); How does the kernel know to call that function? https://stackoverflow.com/questions/8832114/what-does-init-mean-in-the-linux-kernel-code include/linux/init.h So __init is just a marker to put code in a section that can later be discarded. I think the real entry point is determined by subsys_initcall(omap_i2c_init_driver); https://stackoverflow.com/questions/15541290/what-is-the-difference-between-module-init-and-subsys-initcall-while-initializin The next point is platform_driver_register(&omap_i2c_driver); Platform devices are devices that typically appear as autonomous entities in the system. ... What they usually have in common is direct addressing from a CPU bus. Platform drivers follow the standard driver model convention, where discovery/enumeration is handled outside the drivers, and drivers provide probe() and remove() methods. They support power management and shutdown notifications using the standard conventions. It uses the structure: struct platform_driver omap_i2c_driver = { .probe = omap_i2c_probe, .remove = omap_i2c_remove, .driver = { .name = "omap_i2c", .pm = OMAP_I2C_PM_OPS, .of_match_table = of_match_ptr(omap_i2c_of_match), }, }; Ignore PM for now, and assume that OF just gives the correct data. Move on to: omap_i2c_probe(struct platform_device *pdev) platform_get_irq() devm_kzalloc() platform_get_resource(), devm_ioremap_resource() of_match_device() platform_set_drvdata() init_completion() // synchronization infrastructure pm_*() // power management calls. do not touch. readw_relaxed(omap->base + 0x04); // revision, scheme omap->regs, omap->errata; // set based on revision, scheme omap->fifo_size // read register BUFSTAT_REG 0x10 to deterimine fifo size (not clear) omap_i2c_init() // reset hardware devm_request_irq() or devm_request_threaded_irq() // not clear which one i2c_set_adapdata() // hook up to i2c infrastructure? adap->algo = &omap_i2c_algo; // omap_i2c_xfer, omap_i2c_func adap->bus_recovery_info = &omap_i2c_bus_recovery_info; // ??? stuck bus stuff? i2c_add_numbered_adapter() // get i2c bus number pm_*() QUESTIONS: - completion? https://www.kernel.org/doc/Documentation/scheduler/completion.txt - generic i2c driver documentation? - do i know enough to start looking into slave mode? original slave mode patch: https://lwn.net/Articles/611332/ How to look at this particular patch? slave eeprom: drivers/i2c/i2c-slave-eeprom.c drivers/i2c/i2c-core.c - Documentation/i2c: drwxr-xr-x 1 446 May 17 17:32 busses -rw-r--r-- 1 8.7K Feb 21 16:20 dev-interface -rw-r--r-- 1 5.0K Feb 21 16:20 fault-codes -rw-r--r-- 1 6.0K Feb 21 16:20 functionality -rw-r--r-- 1 3.0K Feb 21 16:20 i2c-protocol -rw-r--r-- 1 2.3K Feb 21 16:20 i2c-stub -rw-r--r-- 1 15K Feb 21 16:20 i2c-topology -rw-r--r-- 1 9.6K Feb 21 16:20 instantiating-devices drwxr-xr-x 1 24 May 17 17:32 muxes -rw-r--r-- 1 1.9K Feb 21 16:20 old-module-parameters -rw-r--r-- 1 476 Feb 21 16:20 slave-eeprom-backend -rw-r--r-- 1 7.7K Feb 21 16:20 slave-interface -rw-r--r-- 1 9.3K Feb 21 16:20 smbus-protocol -rw-r--r-- 1 1.9K Feb 21 16:20 summary -rw-r--r-- 1 1.6K Feb 21 16:20 ten-bit-addresses -rw-r--r-- 1 6.8K Feb 21 16:20 upgrading-clients -rw-r--r-- 1 15K Feb 21 16:20 writing-clients The slave-* documentation is at least a starting point. Let's look at the diff first. Current gw_buildroot linux checkout does not have a .git directory, so find that first maybe? tom@buildroot:/i/buildroot/home/tom/cache/buildroot_dl/linux/git$ git log |head commit 960d4b4bc998942d0642df2246a79c6cd5e9eb5d Author: Robert Nelson Date: Wed Feb 21 15:20:40 2018 -0600 tom@buildroot:/i/buildroot/home/tom/cache/buildroot_dl/linux/git$ git blame Documentation/i2c/slave-eeprom-backend Blaming lines: 100% (14/14), done. d0c892f59c918 (Wolfram Sang 2015-03-23 09:26:38 +0100 1) Linux I2C slave eeprom backend d0c892f59c918 (Wolfram Sang 2015-03-23 09:26:38 +0100 2) ============================== d0c892f59c918 (Wolfram Sang 2015-03-23 09:26:38 +0100 3) d0c892f59c918 (Wolfram Sang 2015-03-23 09:26:38 +0100 4) by Wolfram Sang in 2014-15 d0c892f59c918 (Wolfram Sang 2015-03-23 09:26:38 +0100 5) d0c892f59c918 (Wolfram Sang 2015-03-23 09:26:38 +0100 6) This is a proof-of-concept backend which acts like an EEPROM on the connected d0c892f59c918 (Wolfram Sang 2015-03-23 09:26:38 +0100 7) I2C bus. The memory contents can be modified from userspace via this file d0c892f59c918 (Wolfram Sang 2015-03-23 09:26:38 +0100 8) located in sysfs: d0c892f59c918 (Wolfram Sang 2015-03-23 09:26:38 +0100 9) 2e049d6132eb9 (Masanari Iida 2016-02-02 20:41:25 +0900 10) /sys/bus/i2c/devices//slave-eeprom d0c892f59c918 (Wolfram Sang 2015-03-23 09:26:38 +0100 11) d0c892f59c918 (Wolfram Sang 2015-03-23 09:26:38 +0100 12) As of 2015, Linux doesn't support poll on binary sysfs files, so there is no 2e049d6132eb9 (Masanari Iida 2016-02-02 20:41:25 +0900 13) notification when another master changed the content. d0c892f59c918 (Wolfram Sang 2015-03-23 09:26:38 +0100 14) That main patch seems to be only documentation: tom@buildroot:/i/buildroot/home/tom/cache/buildroot_dl/linux/git$ git diff d0c892f59c918~1 d0c892f59c918 diff --git a/Documentation/i2c/slave-eeprom-backend b/Documentation/i2c/slave-eeprom-backend new file mode 100644 index 000000000000..c8444ef82acf --- /dev/null +++ b/Documentation/i2c/slave-eeprom-backend @@ -0,0 +1,14 @@ +Linux I2C slave eeprom backend +============================== + +by Wolfram Sang in 2014-15 + +This is a proof-of-concept backend which acts like an EEPROM on the connected +I2C bus. The memory contents can be modified from userspace via this file +located in sysfs: + + /sys/bus/i2c/devices//slave-eeprom + +As of 2015, Linux doesn't support poll on binary sysfs files, so there is no +notfication when another master changed the content. + Let's look at the slave c file instead. tom@buildroot:/i/buildroot/home/tom/cache/buildroot_dl/linux/git$ git blame drivers/i2c/i2c-slave-eeprom.c 389be323cfac3 (Wolfram Sang 2014-11-18 17:04:54 +0100 1) /* ... tom@buildroot:/i/buildroot/home/tom/cache/buildroot_dl/linux/git$ git diff 389be323cfac3~1 389be323cfac3 ... That is just the eeprom. Grepping... the following also includes noise. Second one is better. tom@buildroot:/i/buildroot/home/tom/cache/buildroot_dl/linux/git$ grep -re I2C_SLAVE . ... tom@buildroot:/i/buildroot/home/tom/cache/buildroot_dl/linux/git$ grep -re I2C_SLAVE_WRITE_REQUESTED . ./Documentation/i2c/slave-interface:* I2C_SLAVE_WRITE_REQUESTED (mandatory) ./drivers/i2c/busses/i2c-emev2.c: i2c_slave_event(priv->slave, I2C_SLAVE_WRITE_REQUESTED, ./drivers/i2c/busses/i2c-rcar.c: i2c_slave_event(priv->slave, I2C_SLAVE_WRITE_REQUESTED, &value); ./drivers/i2c/i2c-slave-eeprom.c: case I2C_SLAVE_WRITE_REQUESTED: ./include/linux/i2c.h: I2C_SLAVE_WRITE_REQUESTED, There is only this implementation: rcar Renesas RCar I2C unit emev2 Renesas EMEV2 SoC tom@buildroot:/i/buildroot/home/tom/cache/buildroot_dl/linux/git$ git blame include/linux/i2c.h |grep I2C_SLAVE_WRITE 5b77d162a3d73 (Wolfram Sang 2015-03-23 09:26:36 +0100 268) I2C_SLAVE_WRITE_REQUESTED, 5b77d162a3d73 (Wolfram Sang 2015-03-23 09:26:36 +0100 270) I2C_SLAVE_WRITE_RECEIVED, That's also just a minor patch. What am I looking for then? tom@buildroot:/i/buildroot/home/tom/cache/buildroot_dl/linux/git$ git log --pretty=oneline | grep "i2c: slave:" b4cdaf32ce04366ec143c2255492918c35f58691 Documentation: i2c: slave: give proper example for pm usage 38fa8afff0a99fe8caabbde0d590df3067cf695a Documentation: i2c: slave: describe buffer problems a bit better c6909d6f6f1082b8bb4c1b0ef3460a005c9dcb4d i2c: slave: print warning if slave flag not set 8366610283d08564f65a1af2ec8458df08418727 i2c: slave: fix the example how to instantiate from userspace 0c7cab96ec413a69af86965d94fb650f01c5887a i2c: slave: add error messages to slave core 976cf2056ccf1be1759f8c122d194c117c879e11 i2c: slave: docs: be more precise about the prerequsites d0c892f59c918535f902caea63637af87d931d91 i2c: slave: add documentation for i2c-slave-eeprom 5b77d162a3d7359a8a8d83776720da065bf4e77b i2c: slave: rework the slave API The Shiny New I2C Slave Framework - Wolfram Sang https://www.youtube.com/watch?v=JdQ21jlwb58 Wolram is: - I2C maintainer - consultant - part of Renesas kernel team - There is support for multi-master. It is tricky though. - Probably best to just be slave. - I2C slave events decouples backend (e.g. eeprom) from driver. - PM: slave needs to be on to listen for address - developed by shorting 2 busses, one master, one slave - rcar_reg_slave() : driver support to register slave - i2c_slave_event() : register backend to slave - event handlers are called in interrupt context (callback) - one event per data byte (no buffers) - address phase is always acknowledged - data phase ack depends on event handler return value - assumes clock stretching for flow control - write: _WRITE_REQUESTED, _WRITE_RECEIVED, _STOP - read: _READ_REQUESTED, _READ_PROCESSED, _STOP - _READ_PROCESSED is highlevel, so doesn't mean data went out. - driver side: straightforward, based on what interrupts come in - "somebody still using platform devices?" - no use case for user space client events - see i2c_slave_8bit_seconds_slave_cb,_probe,_remove example - read pointer problem: if you get another read, the previous one is assumed to be ok - some davinci code is in private somewhere... Entry: Building omap_i2c as a module Date: Tue Jun 12 17:57:09 EDT 2018 CONFIG_I2C_OMAP cannot be turned off? Seems so drivers/i2c/busses/Kconfig config I2C_OMAP tristate "OMAP I2C adapter" depends on ARCH_OMAP default y if MACH_OMAP_H3 || MACH_OMAP_OSK help If you say yes to this option, support will be included for the I2C interface on the Texas Instruments OMAP1/2 family of processors. Like OMAP1510/1610/1710/5912 and OMAP242x. For details see http://www.ti.com/omap. Entry: back to driver Date: Tue Jun 12 19:40:08 EDT 2018 Threaded irq? Avoids top/bottom half. https://www.quora.com/What-is-the-advantage-of-new-request_threaded_irq-over-request_irq Why is it checking this based on version? [ 0.724262] omap_i2c 4819c000.i2c: request_threaded_irq: 5040000b omap_i2c_isr_thread(int this_irq, void *dev_id) Debug messages are used: dev_dbg(omap->dev, "IRQ (ISR = 0x%04x)\n", stat); How to enable them? https://www.kernel.org/doc/html/v4.11/admin-guide/dynamic-debug-howto.html Enable per callsite. This is quite neat! # echo 'file svcsock.c line 1603 +p' >debugfs/dynamic_debug/control # cat debugfs/dynamic_debug/control To add slave support, focus first on the STAT and IE registers bits = omap_i2c_read_reg(omap, OMAP_I2C_IE_REG); stat = omap_i2c_read_reg(omap, OMAP_I2C_STAT_REG); /* I2C Status Register (OMAP_I2C_STAT): */ #define OMAP_I2C_STAT_XDR (1 << 14) /* TX Buffer draining */ #define OMAP_I2C_STAT_RDR (1 << 13) /* RX Buffer draining */ #define OMAP_I2C_STAT_BB (1 << 12) /* Bus busy */ #define OMAP_I2C_STAT_ROVR (1 << 11) /* Receive overrun */ #define OMAP_I2C_STAT_XUDF (1 << 10) /* Transmit underflow */ #define OMAP_I2C_STAT_AAS (1 << 9) /* Address as slave */ #define OMAP_I2C_STAT_BF (1 << 8) /* Bus Free */ #define OMAP_I2C_STAT_XRDY (1 << 4) /* Transmit data ready */ #define OMAP_I2C_STAT_RRDY (1 << 3) /* Receive data ready */ #define OMAP_I2C_STAT_ARDY (1 << 2) /* Register access ready */ #define OMAP_I2C_STAT_NACK (1 << 1) /* No ack interrupt enable */ #define OMAP_I2C_STAT_AL (1 << 0) /* Arbitration lost int ena */ OMAP_I2C_STAT_REG at 0x28 for v2. 21.4.1.5 I2C_IRQSTATUS Register (offset = 28h) [reset = 0h] #define OMAP_I2C_STAT_AAS (1 << 9) /* Address as slave */ IE reg is written from omap->iestate Set in static int omap_i2c_init(struct omap_i2c_dev *omap) omap->iestate = (OMAP_I2C_IE_XRDY | OMAP_I2C_IE_RRDY | OMAP_I2C_IE_ARDY | OMAP_I2C_IE_NACK | OMAP_I2C_IE_AL) | ((omap->fifo_size) ? (OMAP_I2C_IE_RDR | OMAP_I2C_IE_XDR) : 0); /* I2C Interrupt Enable Register (OMAP_I2C_IE): */ #define OMAP_I2C_IE_XDR (1 << 14) /* TX Buffer drain int enable */ #define OMAP_I2C_IE_RDR (1 << 13) /* RX Buffer drain int enable */ #define OMAP_I2C_IE_XRDY (1 << 4) /* TX data ready int enable */ #define OMAP_I2C_IE_RRDY (1 << 3) /* RX data ready int enable */ #define OMAP_I2C_IE_ARDY (1 << 2) /* Access ready int enable */ #define OMAP_I2C_IE_NACK (1 << 1) /* No ack interrupt enable */ #define OMAP_I2C_IE_AL (1 << 0) /* Arbitration lost int ena */ IE reg is at 0x2C So the ones that are ignored (not defined in source) #define OMAP_I2C_IE_AAS (1 << 9) /* Addressed as slave */ Other, unused interrupts 7: AERR access error 6: STC start condition 5: GC general call So, assumption is that if I2C_OA is set, slave mode is enabled. 21.4.1.20 I2C_OA Register (offset = A8h) [reset = 0h] Active transfer phase: between STT having been set to 1 and reception of ARDY. I2C mode register (I2C_CON) 0xA4 MST=1 : master mode automatically cleared at STOP set in omap_i2c_xfer_msg() So with this, look at the code again. I expect: - AAS slave access - RRDY receive data ready - XRDY transmit ready Does master turn off power? Check this again later. There's a timeout set: that would be the first thing to mess with. My main concern in the way the framework is implemented, is that the reads cannot be buffered easily. There isn't a lot of time between the read bit which likely causes the interrupt, and the byte being clocked out. At 10kHz, and in interrupt context, this should be fine though. Let's look at the actual case: - address received - command received - data reply When command is received, immediately the fifo can be filled. But the slave mode doesn't really allow for this. Maybe best to first hack it into the driver directly? Entry: Next Date: Wed Jun 13 09:44:43 EDT 2018 Set slave address and enable AAS interrupts. Device should be receiving something that way because it is in slave mode by default. Entry: power Date: Wed Jun 13 12:17:32 EDT 2018 https://www.kernel.org/doc/Documentation/power/runtime_pm.txt int pm_runtime_put_autosuspend(struct device *dev); - decrement the device's usage counter; if the result is 0 then run pm_request_autosuspend(dev) and return its result int pm_runtime_disable(struct device *dev); - increment the device's 'power.disable_depth' field (if the value of that field was previously zero, this prevents subsystem-level runtime PM callbacks from being run for the device), make sure that all of the pending runtime PM operations on the device are either completed or canceled; returns 1 if there was a resume request pending and it was necessary to execute the subsystem-level resume callback for the device to satisfy that request, otherwise 0 is returned So first try to understand if it actually suspends. Ok, it does. Now change the time. #define OMAP_I2C_PM_TIMEOUT 1000000 /* ms */ Entry: ARDY? Date: Wed Jun 13 15:46:53 EDT 2018 When a transaction is done. Entry: completions? Date: Wed Jun 13 17:58:53 EDT 2018 https://www.kernel.org/doc/Documentation/scheduler/completion.txt It appears that a command transfer only expects one salvo of interrupts, because at the end of the interrupt handler thread, the completion is invoked. Entry: IRQ_WAKE_THREAD Date: Wed Jun 13 18:02:12 EDT 2018 https://lwn.net/Articles/302043/ Entry: basic transfer working Date: Wed Jun 13 18:59:45 EDT 2018 0x0200 AAS 0x0010 XRDY 0x0008 RRDY [ 2101.757687] omap_i2c 4819c000.i2c: AAS [ 2101.761561] omap_i2c 4819c000.i2c: slave: 0x0218 [ 2101.766257] omap_i2c 4819c000.i2c: slave: XRDY, write DATA_REG [ 2101.772139] omap_i2c 4819c000.i2c: slave: 0x0008 [ 2101.776798] omap_i2c 4819c000.i2c: slave: 0x000e [ 2101.781455] omap_i2c 4819c000.i2c: slave: ARDY, end slave_mode 0x000e is: RRDY|ARDY|NACK Entry: slave mode first draft, before kernel events Date: Wed Jun 13 20:23:30 EDT 2018 if (omap->slave_mode) { if (stat & OMAP_I2C_STAT_RRDY) { uint8_t data = omap_i2c_read_reg(omap, OMAP_I2C_DATA_REG); dev_info(omap->dev, "slave: %04x RRDY, DATA_REG=%d\n", stat, data); omap_i2c_ack_stat(omap, OMAP_I2C_STAT_RRDY); } else if (stat & OMAP_I2C_STAT_XRDY) { uint8_t data = 123; dev_info(omap->dev, "slave: %04x XRDY, write DATA_REG=%d\n", stat, data); omap_i2c_write_reg(omap, OMAP_I2C_DATA_REG, data); omap_i2c_ack_stat(omap, OMAP_I2C_STAT_XRDY); } else if (stat & OMAP_I2C_STAT_ARDY) { dev_info(omap->dev, "slave: %04x ARDY, end slave_mode\n", stat); omap_i2c_ack_stat(omap, OMAP_I2C_STAT_ARDY); omap->slave_mode = 0; } else if (stat) { dev_info(omap->dev, "slave: %04x ???\n", stat); omap_i2c_ack_stat(omap, stat); } continue; } So basically, send an event when XRDY is there, but if the backend says there is nothing, don't ack the interrupt yet. Entry: register i2c slave mode Date: Thu Jun 14 11:56:20 EDT 2018 # modprobe i2c-slave-eeprom # echo slave-24c02 0x1040 >/sys/devices/platform/ocp/4819c000.i2c/i2c-2/new_device [ 276.463975] omap_i2c 4819c000.i2c: OA = 64, iestate = 621f [ 276.479475] i2c i2c-2: new_device: Instantiated device slave-24c02 at 0x40 How to unregister? https://www.kernel.org/doc/Documentation/i2c/instantiating-devices echo 0x1040 >delete_device [ 383.861649] i2c i2c-2: delete_device: Deleting device slave-24c02 at 0x40 but the unregister function doesn't get called? modprobe i2c-slave-eeprom echo slave-24c02 0x1040 >/sys/devices/platform/ocp/4819c000.i2c/i2c-2/new_device echo 0x1040 >/sys/devices/platform/ocp/4819c000.i2c/i2c-2/delete_device rmmod i2c-slave-eeprom [ 8190.552349] omap_i2c 4819c000.i2c: reg_slave [ 8190.567339] omap_i2c 4819c000.i2c: OA = 64, iestate = 621f [ 8190.573056] i2c i2c-2: new_device: Instantiated device slave-24c02 at 0x40 [ 8190.610851] i2c i2c-2: delete_device: Deleting device slave-24c02 at 0x40 [ 8190.635284] omap_i2c 4819c000.i2c: OA = 0, iestate = 601f Next: make the eeprom work. Look at the rcar events: I2C_SLAVE_READ_REQUESTED I2C_SLAVE_WRITE_REQUESTED I2C_SLAVE_STOP I2C_SLAVE_WRITE_RECEIVED I2C_SLAVE_READ_PROCESSED To implement IC_SLAVE_WRITE_REQUESTED, what does the omap have? Entry: I2C tips Date: Fri Jun 22 02:33:47 EDT 2018 http://processors.wiki.ti.com/index.php/I2C_Tips Entry: Driver fixes Date: Fri Jun 22 02:39:19 EDT 2018 Now using BF interrupt (STOP) to switch back to normal mode + also taking care no interrupts "leak" into the master mode handler. Entry: TRM 26.1.8.5.3 Booting Procedure Date: Sat Jun 23 19:28:52 EDT 2018 MMC/SD Cards or eMMC/ eSD devices may hold a FAT file system which ROM Code is able to read and process. The image used by the booting procedure is taken from a specific booting file named “MLO”. This file has to be located in the root directory on an active primary partition of type FAT12/16 or FAT32. I wonder. Does the bootloader work at all without the .dtb? Let's try. Entry: Forth Date: Thu Sep 6 17:45:18 EDT 2018 https://github.com/biocode3D/prufh Entry: PRU memories Date: Sat Sep 8 19:30:59 EDT 2018 I found some documentation where the shared ram is not mapped. I.e. 0x10000 says reserved. http://processors.wiki.ti.com/index.php/PRUSS_Memory_Map So it seems the other rams are accessible just as well. IRAM is only accessible when RUNSTATE=0 (CONTROL register). Entry: PRU dev Date: Sat Sep 15 12:41:11 EDT 2018 Having gone through it once, what would be a good way to get more direct access?