Quick jump:  What's new

 
Go to:
 
Weblog: recent changes   
in Dobrica Pavlinušić's random unstructured stuff
Lenovo Thinkpad Tablet

Product Numbers: 1838, 1839

Tegra 2 tablet, possible kernel name (from schematics, not used as-is): PHJ00

Board markings: LA-746

PHJ00LA-7561P
Rev:1.0
2011-06-03

schematics: compal_la-7461p_r0.3_schematics.pdf



links

Review:

dock connector

https://web.archive.org/web/20150108184014/http://rootzwiki.com:80/topic/8523-reverse-engineering-the-dock-charger/

Posted 31 October 2011 - 03:09 AM #1
I got my desktop charger today and unpacked it only to rip it aparts to check whats inside.
By first view theese are the highlights:

The dock connector is 40 pins
Dock connector is on a separate small pcb with a 40 pin board to board connector to a larger board.
On this small pcb is a 12 pin MLF package marked:
AAU
NAD

Probably has a ground pad underneath.

The main pcb has a few more circuits and connectors on it.
There is a micro usb, a full size master usb, audio out and microphone jacks. A bit more exiting there is room for a HDMI connector as well there with unpopulated spaces for line filters and a hdmi circuit. By first look it seems to be a displayport or MHL to HDMI bridge chip of some kind. I is TQFP-48 package.
edit:
It seems to be a PI3VDP411LS from pericom
http://www.pericom.c...PI3VDP411LS.pdf

It is a displayport levelshifter / bridge to HDMI. It is the only 48 pin package I have found to match the input with the differential pairs.

The power supply is 20 VDC 65 Watts. It does not seem like the center connector is connected. The connector is the standard "IBM" charger, outer case ground, inner case + 20 vdc, center pin power diag.

There is a fet transistor between the dock connector and the psu marked FA1K18 and it is controlled by some regulator marked 920A4 in a SOT-223 package. The 20 VDC goes in on pin 2 and the tab on it.

the HDMI chip has differential pair inputs on pin 47,48 - 44,45 - 41,41 - 38,39

I will do my best reversing the whole schematic for this unit and split it into parts so we can make other chargers and hopefully add HDMI to the dock.

Pinout Docking Connector Thinkpad Tablet

1 charge 2 gnd
3 charge 4 hdmi pin 44 In D3-
5 Charger control (to pq2) 6 hdmi pin 45 In D3+
7 hdmi VDD 3.3V 8 gnd
9 gnd 10 hdmi pin 47 In D4-
11 USB Micro D- 12 hdmi pin 48 In D4 +
13 USB micro D+ 14 gnd
15 USB Master D- 16 nc
17 USB MAster D+ 18 nc
19 gnd 20 hdmi pin 29 SDA
21 gnd 22 hdmi pin 28 SCL
23 hdmi pin 41 IN D2- 24 hdmi pin 7 HPD_Source
25 hdmi pin 42 In D2+ 26 gnd
27 gnd 28 audio out L
29 hdmi pin 38 IN D1- 30 audio out R
31 hdmi pin 39 IN D1+ 32 headset inserted switch
33 gnd 34 mic inserted switch feed
35 USB micro + 36 mic inserted switch
37 gnd 38 mic tip
39 + 5V to usb master 40 mic ring

Pinout AAU chipAAU chip is audio amp.
audio out
pin 10 ring
pin 11 tip
pin 2, 7 gnd

Charger stuff :
The supplied DC apater is 20Volt 3.25Amps
In the dock there is a voltage regulator PV1. It is a 3.3 V LDO Tab has 20 volts in and pin 3 gives 3.30 Volts out.
There is also a FET in SSO8 (?) package. It is controlled by 2 transistors and works only as a switch.
On the base of PQ2 (pin 1, I guess it is the base) there is a float of 3.30 volts when there is nothing in the dock. The FET is OPEN and no voltage to the charger pins.
When grounding PQ2 pin1 (dock pin 5) the FET CLOSES and the charger outputs 20,5volts which basically is the same as dc power into the dock.

Now I am just waiting for the TPT to get fully charged so I can measure if there is any difference when fully charged.

Note:
By charging at 20 volts instead of 5 volts I understand why the charger only uses 2 pins into the TPT.
At 20 volts you can transfer 4 times the energy instead of just charging at 5 volts from USB powers. There is no need for step ups to charge the LI-Po battery as it would need more than 5 volts.

This is the schematics of the charger part:

www.r-888.com/tpt/schema.pdf

I am not sure of the 2 transitors if they are pnp or npn yet but the rest is how it is.
The original mosfet is a P-channel AON7403.
The regulator is just any 3,3 volt LDO.

The TPT charger control pin 5 gets a 3,3 volt float via the resistor to the left in the schematic. When it is connected the TPT grounds the pin and the FET lets current through.

Edited by ZebCrs, 05 November 2011 - 12:56 PM.

adb

[Tue Oct  9 14:12:34 2018] usb 2-4: new high-speed USB device number 9 using xhci_hcd
[Tue Oct  9 14:12:34 2018] usb 2-4: New USB device found, idVendor=17ef, idProduct=7494, bcdDevice=99.99
[Tue Oct  9 14:12:34 2018] usb 2-4: New USB device strings: Mfr=2, Product=3, SerialNumber=4
[Tue Oct  9 14:12:34 2018] usb 2-4: Product: ThinkPadTablet
[Tue Oct  9 14:12:34 2018] usb 2-4: Manufacturer: LENOVO
[Tue Oct  9 14:12:34 2018] usb 2-4: SerialNumber: MP1YCPF

dpavlin@klin:~$ adb devices
List of devices attached
MP1YCPF device

dpavlin@klin:~$ adb shell
shell@android:/ $ df
Filesystem             Size   Used   Free   Blksize
/dev                   357M    32K   357M   4096
/mnt/asec              357M     0K   357M   4096
/mnt/obb               357M     0K   357M   4096
/sqlite_stmt_journals     4M     0K     4M   4096
/system                755M   310M   445M   4096
/data                   56G     1G    54G   4096
/cache                 885M    81M   804M   4096
/mnt/pia               492M   233M   258M   4096
/mnt/persdata           19M     8M    11M   4096
/storage/sdcard0        56G     1G    54G   4096


shell@android:/ # uname -a
Linux localhost 2.6.39.4-g40c7636-dirty #1 SMP PREEMPT Thu Feb 7 20:07:37 CET 2013 armv7l GNU/Linux


1|shell@android:/ # cat /proc/cpuinfo                                          
Processor       : ARMv7 Processor rev 0 (v7l)
processor       : 0
BogoMIPS        : 996.14

processor       : 1
BogoMIPS        : 996.14

Features        : swp half thumb fastmult vfp edsp vfpv3 vfpv3d16 
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x1
CPU part        : 0xc09
CPU revision    : 0

Hardware        : ventana
Revision        : 0000
Serial          : 0000000000000000


shell@android:/ # free
             total         used         free       shared      buffers
Mem:        731896       720924        10972            0        18392
-/+ buffers:             702532        29364
Swap:            0            0            0


shell@android:/ # cat /proc/partitions                                         
major minor  #blocks  name

 179        0   62520320 mmcblk0
 179        1       6144 mmcblk0p1
 179        2       8192 mmcblk0p2
 179        3     786432 mmcblk0p3
 179        4     921600 mmcblk0p4
 179        5       2048 mmcblk0p5
 179        6     524288 mmcblk0p6
 179        7      20480 mmcblk0p7
 259        0     143360 mmcblk0p8
 259        1      20480 mmcblk0p9
 259        2   60071936 mmcblk0p10



APX mode

  • turn off tablet
  • press rotation button and hold it
  • press power button for 2 seconds
 [Tue Oct  9 14:30:41 2018] usb 2-4: new high-speed USB device number 16 using xhci_hcd
[Tue Oct  9 14:30:42 2018] usb 2-4: New USB device found, idVendor=0955, idProduct=7820, bcdDevice= 1.04
[Tue Oct  9 14:30:42 2018] usb 2-4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[Tue Oct  9 14:30:42 2018] usb 2-4: Product: APX
[Tue Oct  9 14:30:42 2018] usb 2-4: Manufacturer: NVIDIA Corp.



nvflash

https://forum.xda-developers.com/showthread.php?t=1745450

dpavlin@klin:/virtual/android/tegra/linux4tegra/nvflash$ LD_LIBRARY_PATH=. ./nvflash --bl ../prebuilt/fastboot.stock.bin --getpartitiontable /klin/Tegra/tpt1.nvflash.getpartitiontable
Nvflash started
rcm version 0X20001
System Information:
   chip name: t20
   chip id: 0x20 major: 1 minor: 4
   chip sku: 0x8
   chip uid: 0x0a8051c743dfd457
   macrovision: disabled
   hdcp: enabled
   sbk burned: false
   dk burned: false
   boot device: emmc
   operating mode: 3
   device config strap: 0
   device config fuse: 0
   sdram config strap: 0

downloading bootloader -- load address: 0x108000 entry point: 0x108000
sending file: ../prebuilt/fastboot.stock.bin
| 936016/936016 bytes sent
../prebuilt/fastboot.stock.bin sent successfully
waiting for bootloader to initialize
bootloader downloaded successfully
failed executing command 19 NvError 0x120000
command failure: get partition table failed 

partition table

dpavlin@nuc:/nuc/Tegra/nvflash$ LD_LIBRARY_PATH=. ./nvflash --bl ../04.EBT.img --getpartitiontable partitiontable.txt --go
Nvflash started
rcm version 0X20001
System Information:
   chip name: t20
   chip id: 0x20 major: 1 minor: 4
   chip sku: 0x8
   chip uid: 0x043c71c3433f8497
   macrovision: disabled
   hdcp: enabled
   sbk burned: false
   dk burned: false
   boot device: emmc
   operating mode: 3
   device config strap: 0
   device config fuse: 0
   sdram config strap: 2

downloading bootloader -- load address: 0x108000 entry point: 0x108000
sending file: ../04.EBT.img
/ 6291456/6291456 bytes sent
../04.EBT.img sent successfully
waiting for bootloader to initialize
bootloader downloaded successfully
Succesfully updated partition table information to partitiontable.txt



backup

dpavlin@nuc:/nuc/Tegra/nvflash$ grep PartitionId partitiontable.txt  | cut -d= -f2 | tr -d '\r' | xargs -i ./nvflash -r --read {} {}

# even better version which removes biggest partition (15)

dpavlin@klin:/klin/Tegra/nvflash$ grep PartitionId partitiontable.txt  | cut -d= -f2 | tr -d '\r' | grep -v 15 | xargs -i ../nvflash/nvflash -r --read {} {}



BCT - Boot Configuration Table

https://http.download.nvidia.com/tegra-public-appnotes/bct-overview.html

compiler: https://github.com/NVIDIA/cbootimage

dpavlin@klin:/klin/Tegra/tegrarcm$ ./src/tegrarcm readbct --bct tpt.bct

[Wed Oct 10 14:31:05 2018] usb 3-1.1: new high-speed USB device number 23 using ehci-pci
[Wed Oct 10 14:31:05 2018] usb 3-1.1: New USB device found, idVendor=0955, idProduct=7820, bcdDevice= 1.04
[Wed Oct 10 14:31:05 2018] usb 3-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[Wed Oct 10 14:31:05 2018] usb 3-1.1: Product: APX
[Wed Oct 10 14:31:05 2018] usb 3-1.1: Manufacturer: NVIDIA Corp.

bct file: tpt.bct
device id: 0x7820
uid:  0x0a805185415fc1d7
RCM version: 2.1
downloading miniloader to target at address 0x40008000 (132976 bytes)...
miniloader downloaded successfully
reading BCT from system, writing to tpt.bct...done!



serial

From android:

shell@android:/ # cat /proc/cmdline                                            
tegraid=20.1.4.0.0 mem=1022M@0M android.commchip=2685344 vmalloc=256M androidboot.serialno=0a805185415fc1d7 video=tegrafb no_console_suspend=1 console=none debug_uartport=lsport,-3 usbcore.old_scheme_first=1 lp0_vec=8192@0x1d826000 tegra_fbmem=8197120@0x1d82a000 tegraboot=sdmmc charging=0 isBatteryFail=0 gpt gpt_sector=125040639 


shell@android:/ # lsof | grep tty                                              
rild        103      radio   13       ???                ???       ???        ??? /dev/ttyACM1
brcm_patc   330  bluetooth    3       ???                ???       ???        ??? /dev/ttyHS2
sh         1789      shell   24       ???                ???       ???        ??? /dev/tty
sh         1795       root   24       ???                ???       ???        ??? /dev/tty

shell@android:/ # dmesg | grep tty                                             
<6>[    6.290150] serial8250.0: ttyS0 at MMIO 0x70006300 (irq = 122) is a Tegra
<6>[    6.290475] tegra_uart.1: ttyHS1 at I/O 0x0 (irq = 69) is a unknown
<6>[    6.290727] Registered UART port ttyHS1
<6>[    6.290873] tegra_uart.2: ttyHS2 at I/O 0x0 (irq = 78) is a unknown
<6>[    6.291115] Registered UART port ttyHS2
<6>[    7.056012] cdc_acm 1-1:1.1: ttyACM0: USB ACM device
<6>[    7.067323] cdc_acm 1-1:1.3: ttyACM1: USB ACM device
<6>[    7.137758] cdc_acm 1-1:1.9: ttyACM2: USB ACM device
<4>[   15.154176] ttyACM1: Entering acm_tty_open.



serial port

Schematic has 4 pin debug connector with serial on it.

There are three 4-pin connectors on this side of board, and from pictures other side doesn't seem to have connectors.

Skip JLTE1 and JLTE2 connector (under ribbon to front-facing camera), they are wrong connectors, and pop rf shield off Tegra
compartment and locate JP4:

IMG_20181024_165607-800px.jpg

solder pin 1 and 2 and ground

IMG_20181024_172303-800px.jpg

JP4 pinout from schematics:

  • 1 - UART4_RXD
  • 2 - UART4_TXD
  • 3
  • 4 - GND

Pins 1 and 2 are 1.8V when device is turned on. so far, so good.

u-boot

dpavlin@klin:/klin/Tegra/u-boot-tegra$ export CROSS_COMPILE="arm-none-eabi-" ARCH=arm
dpavlin@klin:/klin/Tegra/u-boot-tegra$ make ventana_defconfig

press left-most button and power (top-right of tablet)

[Sun Oct 21 16:29:05 2018] usb 1-3.4.1: pl2303 converter now attached to ttyUSB3
[Sun Oct 21 16:29:22 2018] usb 1-3.4.4: new high-speed USB device number 105 using xhci_hcd
[Sun Oct 21 16:29:22 2018] usb 1-3.4.4: New USB device found, idVendor=0955, idProduct=7820, bcdDevice= 1.04
[Sun Oct 21 16:29:22 2018] usb 1-3.4.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[Sun Oct 21 16:29:22 2018] usb 1-3.4.4: Product: APX
[Sun Oct 21 16:29:22 2018] usb 1-3.4.4: Manufacturer: NVIDIA Corp.

# backup bct

dpavlin@nuc:/nuc/Tegra/tpt-brokenscreen$ ../tegrarcm/src/tegrarcm --bct broken.bct readbct
bct file: broken.bct
device id: 0x7820
uid:  0x0a805185415fc1d7
RCM version: 2.1
downloading miniloader to target at address 0x40008000 (132976 bytes)...
miniloader downloaded successfully
reading BCT from system, writing to broken.bct...done!

# try u-boot

dpavlin@nuc:/nuc/Tegra/tpt-brokenscreen$ ../tegrarcm/src/tegrarcm --bct broken.bct --bootloader /mnt/klin/klin/Tegra/u-boot-tegra/u-boot-tegra.bin --loadaddr 0x108000

bct file: broken.bct
bootloader file: /mnt/klin/klin/Tegra/u-boot-tegra/u-boot-tegra.bin
load addr 0x108000
entry addr 0x108000
device id: 0x7820
uid:  0x0a805185415fc1d7
RCM version: 2.1
downloading miniloader to target at address 0x40008000 (132976 bytes)...
miniloader downloaded successfully
Chip UID:                0x00000000000000000a805185415fc1d7
Chip ID:                 0x20
Chip ID Major Version:   0x1
Chip ID Minor Version:   0x4
Chip SKU:                0x8 (t20)
Boot ROM Version:        0x1
Boot Device:             0x2 (EMMC)
Operating Mode:          0x3 (developer mode)
Device Config Strap:     0x0
Device Config Fuse:      0x0
SDRAM Config Strap:      0x1
sending file: broken.bct
- 4080/4080 bytes sent
broken.bct sent successfully
sending file: /mnt/klin/klin/Tegra/u-boot-tegra/u-boot-tegra.bin
/ 496836/496836 bytes sent
/mnt/klin/klin/Tegra/u-boot-tegra/u-boot-tegra.bin sent successfully
dpavlin@nuc:/nuc/Tegra/tpt-brokenscreen$ 
[Sun Oct 21 16:39:58 2018] usb 1-3.4.4: USB disconnect, device number 108



and screen seems to work with changes ported from 2.6!

                                display-timings {
                                        timing@0 {
                                                /* XXX tegra_dc_mode ventana_panel_modes */
                                                clock-frequency = <72072000>;
                                                hactive = <1280>;
                                                vactive = <800>;
                                                hback-porch = <72>;
                                                hfront-porch = <48>;
                                                hsync-len = <32>;
                                                vback-porch = <22>;
                                                vfront-porch = <3>;
                                                vsync-len = <7>;
                                                hsync-active = <1>;
                                        };
                                };



wifi

dpavlin@tegra20:~$ dmesg | grep brcm
[   13.971076] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4329-sdio for chip BCM4329/3

apt-get install firmware-brcm80211

# it seems to need some non-free parts

root@tegra20:/home/dpavlin# cd /lib/firmware/brcm/
wget https://raw.githubusercontent.com/armbian/firmware/master/brcm/brcmfmac4329-sdio.txt


battery

without any config with ventana dts battery isn't charging which is annoying for development because you need to charge tablet often.

according to schematics charger is: ISL9519HRTZ-T_TQFN28_4X4

https://www.intersil.com/content/dam/intersil/documents/isl9/isl9519.pdf (too short, not useful)

There seems to be patch to add isl9519q to kernel back from 2011: https://lkml.org/lkml/2011/8/29/312
which judging from one datasheet that google can find ISL9519C-Intersil.pdf is roughly correct.

i2c

mainline 4.19

root@tegra20:~# i2cdetect -l     
i2c-3   i2c             7000d000.i2c                            I2C adapter
i2c-1   i2c             7000c400.i2c                            I2C adapter
i2c-4   i2c             i2c-1-mux (chan_id 0)                   I2C adapter
i2c-2   i2c             7000c500.i2c                            I2C adapter
i2c-0   i2c             7000c000.i2c                            I2C adapter
i2c-5   i2c             i2c-1-mux (chan_id 1)                   I2C adapter

root@tegra20:~# i2cdetect -y -r 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- UU -- 1c -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         

root@tegra20:~# i2cdetect -y -r 1 # very slow
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         

root@tegra20:~# i2cdetect -y -r 2
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         

root@tegra20:~# i2cdetect -y -r 3
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- 0c -- -- 0f 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- UU -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         

root@tegra20:~# i2cdetect -y -r 4
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         

root@tegra20:~# i2cdetect -y -r 5
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         

root@tegra20:~# grep . /sys/bus/i2c/devices/*/name
/sys/bus/i2c/devices/0-001a/name:wm8903
/sys/bus/i2c/devices/0-0044/name:isl29018
/sys/bus/i2c/devices/3-0034/name:tps6586x
/sys/bus/i2c/devices/3-004c/name:nct1008
/sys/bus/i2c/devices/i2c-0/name:7000c000.i2c
/sys/bus/i2c/devices/i2c-1/name:7000c400.i2c
/sys/bus/i2c/devices/i2c-2/name:7000c500.i2c
/sys/bus/i2c/devices/i2c-3/name:7000d000.i2c
/sys/bus/i2c/devices/i2c-4/name:i2c-1-mux (chan_id 0)
/sys/bus/i2c/devices/i2c-5/name:i2c-1-mux (chan_id 1)



kernel 2.6 (android)

shell@android:/ # grep . /sys/bus/i2c/devices/*/name                           
/sys/bus/i2c/devices/0-001a/name:wm8903
/sys/bus/i2c/devices/0-001c/name:al3000a_ls
/sys/bus/i2c/devices/1-003a/name:nvhdcp1
/sys/bus/i2c/devices/1-0050/name:tegra_edid
/sys/bus/i2c/devices/2-0050/name:phj00_lcd
/sys/bus/i2c/devices/2-0058/name:EC_Battery
/sys/bus/i2c/devices/3-003c/name:mt9p111
/sys/bus/i2c/devices/3-003d/name:mt9d115
/sys/bus/i2c/devices/4-000c/name:akm8975
/sys/bus/i2c/devices/4-000f/name:kxtf9
/sys/bus/i2c/devices/4-0034/name:tps6586x
/sys/bus/i2c/devices/4-004c/name:nct1008
/sys/bus/i2c/devices/i2c-0/name:Tegra I2C adapter
/sys/bus/i2c/devices/i2c-1/name:Tegra I2C adapter
/sys/bus/i2c/devices/i2c-2/name:Tegra I2C adapter
/sys/bus/i2c/devices/i2c-3/name:Tegra I2C adapter
/sys/bus/i2c/devices/i2c-4/name:Tegra I2C adapter



addresses from schematics

PWR_I2C address
PMU 0b0110_100 0x34
E-Compass 0b0000_110 0x06
Temperature sensor 0b0100_110 0x26
GEN1_I2C
Audio Codec 0b0011_010 0x1a
Light sensor 0b0001_110 0x0e
EC_SMB
BATT 0b0001_001 0x09
IME_I2C
G-sensor 0b0001_1111 0x1f

does g-sensor have typo? 0b0001_111 is 0x0f and we see such device

permalink
Toshiba AC100
Compal_LA-6352P_PAZ00_AC100.pdf

Contents: [Dobrica Pavlinušić's random unstructured stuff]


Tegra 2 device

kernel

cpuinfo

$ cat /proc/cpuinfo
Processor       : ARMv7 Processor rev 0 (v7l)
processor       : 0
BogoMIPS        : 1998.84

Features        : swp half thumb fastmult vfp edsp vfpv3 vfpv3d16 
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x1
CPU part        : 0xc09
CPU revision    : 0

Hardware        : NVIDIA Harmony Development System
Revision        : 0000
Serial          : 0000000000000000

$ cat /proc/meminfo
MemTotal:         383348 kB
MemFree:          106528 kB
Buffers:           30116 kB
Cached:           123316 kB
SwapCached:            0 kB
Active:           164792 kB
Inactive:          85020 kB
Active(anon):      96692 kB
Inactive(anon):        0 kB
Active(file):      68100 kB
Inactive(file):    85020 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:             0 kB
SwapFree:              0 kB
Dirty:                 0 kB
Writeback:             0 kB
AnonPages:         96412 kB
Mapped:            44536 kB
Shmem:               312 kB
Slab:               8940 kB
SReclaimable:       4848 kB
SUnreclaim:         4092 kB
KernelStack:        2528 kB
PageTables:         8324 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:      191672 kB
Committed_AS:    6569284 kB
VmallocTotal:     614400 kB
VmallocUsed:       30656 kB
VmallocChunk:     520068 kB

Rooting

nvflash

Press CTRL + ESC + power button to get into APX mode

[Thu Oct 11 06:31:57 2018] usb 2-2.4: new high-speed USB device number 13 using xhci_hcd
[Thu Oct 11 06:31:57 2018] usb 2-2.4: New USB device found, idVendor=0955, idProduct=7820, bcdDevice= 1.02
[Thu Oct 11 06:31:57 2018] usb 2-2.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[Thu Oct 11 06:31:57 2018] usb 2-2.4: Product: APX
[Thu Oct 11 06:31:57 2018] usb 2-2.4: Manufacturer: NVIDIA Corp.

In theory. In practice driver package from

is everything you need. It's from http://developer.nvidia.com/content/linux-tegra-release-12-alpha-1-released

fastboot.stock.bin

t61p:/home/dpavlin/Downloads/ldk/bootloader/alt# wget https://github.com/muromec/putusb/raw/master/bin/fastboot.stock.bin
--2011-09-12 20:40:17--  https://github.com/muromec/putusb/raw/master/bin/fastboot.stock.bin
Resolving github.com (github.com)... 207.97.227.239
Connecting to github.com (github.com)|207.97.227.239|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://raw.github.com/muromec/putusb/master/bin/fastboot.stock.bin [following]
--2011-09-12 20:40:19--  https://raw.github.com/muromec/putusb/master/bin/fastboot.stock.bin
Resolving raw.github.com (raw.github.com)... 207.97.227.243
Connecting to raw.github.com (raw.github.com)|207.97.227.243|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 936016 (914K) [application/octet-stream]
Saving to: `fastboot.stock.bin'

100%[=====================================================>] 936,016      645K/s   in 1.4s    

2011-09-12 20:40:22 (645 KB/s) - `fastboot.stock.bin' saved [936016/936016]

t61p:/home/dpavlin/Downloads/ldk/bootloader/alt# md5sum fastboot.stock.bin 
9197365fb42c5801b4124e75ea00512c  fastboot.stock.bin

backup

Following instructions at http://gitorious.org/ac100/pages/Installation

t61p:/home/dpavlin/Downloads/ldk/bootloader# ./nvflash --bl fastboot.stock.bin --go
Nvflash started
rcm version 0X20001
System Information:
   chip name: t20
   chip id: 0x20 major: 1 minor: 2
   chip sku: 0x8
   chip uid: 0x1700618943a00317
   macrovision: disabled
   hdcp: enabled
   sbk burned: false
   dk burned: false
   boot device: emmc
   operating mode: 3
   device config strap: 0
   device config fuse: 0
   sdram config strap: 0

downloading bootloader -- load address: 0x108000 entry point: 0x108000
sending file: fastboot.stock.bin
| 936016/936016 bytes sent
fastboot.stock.bin sent successfully
waiting for bootloader to initialize
bootloader downloaded successfully


t61p:/home/dpavlin/Downloads/ldk/bootloader# ./nvflash -r --getpartitiontable partitiontable.txt
Nvflash started
[resume mode]
Succesfully updated partition table information to partitiontable.txt


t61p:/home/dpavlin/Downloads/ldk/bootloader# ./nvflash -r --read 2 part-2.img
Nvflash started
[resume mode]
receiving file: part-2.img, expected size: 3145728 bytes
/ 3145728/3145728 bytes received
file received successfully
t61p:/home/dpavlin/Downloads/ldk/bootloader# ./nvflash -r --read 3 part-3.img
Nvflash started
[resume mode]
receiving file: part-3.img, expected size: 524288 bytes
/ 524288/524288 bytes received
file received successfully
t61p:/home/dpavlin/Downloads/ldk/bootloader# /nvflash -r --read 4 part-4.img
bash: /nvflash: No such file or directory
t61p:/home/dpavlin/Downloads/ldk/bootloader# ./nvflash -r --read 4 part-4.img
Nvflash started
[resume mode]
receiving file: part-4.img, expected size: 2097152 bytes
/ 2097152/2097152 bytes received
file received successfully
t61p:/home/dpavlin/Downloads/ldk/bootloader# ./nvflash -r --read 5 part-5.img
Nvflash started
[resume mode]
receiving file: part-5.img, expected size: 5242880 bytes
/ 5242880/5242880 bytes received
file received successfully
t61p:/home/dpavlin/Downloads/ldk/bootloader# ./nvflash -r --read 6 part-6.img
Nvflash started
[resume mode]
receiving file: part-6.img, expected size: 8388608 bytes
/ 8388608/8388608 bytes received
file received successfully
t61p:/home/dpavlin/Downloads/ldk/bootloader# ./nvflash -r --read 7 part-7.img
Nvflash started
[resume mode]
receiving file: part-7.img, expected size: 1048576 bytes
/ 1048576/1048576 bytes received
file received successfully
t61p:/home/dpavlin/Downloads/ldk/bootloader# ./nvflash -r --read 8 part-8.img
Nvflash started
[resume mode]
receiving file: part-8.img, expected size: 314572800 bytes
/ 314572800/314572800 bytes received
file received successfully
t61p:/home/dpavlin/Downloads/ldk/bootloader# ./nvflash -r --read 9 part-9.img
Nvflash started
[resume mode]
receiving file: part-9.img, expected size: 419430400 bytes
/ 419430400/419430400 bytes received
file received successfully
t61p:/home/dpavlin/Downloads/ldk/bootloader# ./nvflash -r --read 10 part-10.img
Nvflash started
[resume mode]
receiving file: part-10.img, expected size: 2097152 bytes
/ 2097152/2097152 bytes received
file received successfully
t61p:/home/dpavlin/Downloads/ldk/bootloader# ./nvflash -r --read 11 part-11.img
Nvflash started
[resume mode]
receiving file: part-11.img, expected size: 524288 bytes
/ 524288/524288 bytes received
file received successfully
t61p:/home/dpavlin/Downloads/ldk/bootloader# ./nvflash -r --read 12 part-12.img
Nvflash started
[resume mode]
receiving file: part-12.img, expected size: 1294991360 bytes
/ 1294991360/1294991360 bytes received
file received successfully
t61p:/home/dpavlin/Downloads/ldk/bootloader# ./nvflash -r --read 13 part-13.img
Nvflash started
[resume mode]
receiving file: part-13.img, expected size: 524288 bytes
/ 524288/524288 bytes received
file received successfully
t61p:/home/dpavlin/Downloads/ldk/bootloader# ./nvflash -r --read 14 part-14.img
Nvflash started
[resume mode]
receiving file: part-14.img, expected size: 5891424256 bytes
/ 5891424256/5891424256 bytes received
file received successfully



Linux

fetchrss: http://feeds.delicious.com/v2/rss/dpavlin/ac100?count=15
  • There was an error: 500 Can't connect to feeds.delicious.com:80 (Bad hostname 'feeds.delicious.com')


phh 2.6.32 kernel with working suspend and audio

t61p:/home/dpavlin/ac100/linux4tegra_10.9.3# LD_LIBRARY_PATH=./nvflash/ ./nvflash/nvflash --bl ./prebuilt/fastboot.stock.bin --read 6 tegra_partition_6.bin --go
Nvflash started
rcm version 0X20001
System Information:
   chip name: t20
   chip id: 0x20 major: 1 minor: 2
   chip sku: 0x8
   chip uid: 0x1700618943a00317
   macrovision: disabled
   hdcp: enabled
   sbk burned: false
   dk burned: false
   boot device: emmc
   operating mode: 3
   device config strap: 0
   device config fuse: 0
   sdram config strap: 0

downloading bootloader -- load address: 0x108000 entry point: 0x108000
sending file: ./prebuilt/fastboot.stock.bin
| 936016/936016 bytes sent
./prebuilt/fastboot.stock.bin sent successfully
waiting for bootloader to initialize
bootloader downloaded successfully
receiving file: tegra_partition_6.bin, expected size: 8388608 bytes
/ 8388608/8388608 bytes received
file received successfully



t61p:/home/dpavlin/ac100/linux4tegra_10.9.3# LD_LIBRARY_PATH=./nvflash/ ./nvflash/nvflash --wait --bl ./prebuilt/fastboot.stock.bin --download 6 ../32.boot.menu.v1.img --go
Nvflash started
rcm version 0X20001
System Information:
   chip name: t20
   chip id: 0x20 major: 1 minor: 2
   chip sku: 0x8
   chip uid: 0x1700618943a00317
   macrovision: disabled
   hdcp: enabled
   sbk burned: false
   dk burned: false
   boot device: emmc
   operating mode: 3
   device config strap: 0
   device config fuse: 0
   sdram config strap: 0

downloading bootloader -- load address: 0x108000 entry point: 0x108000
sending file: ./prebuilt/fastboot.stock.bin
| 936016/936016 bytes sent
./prebuilt/fastboot.stock.bin sent successfully
waiting for bootloader to initialize
bootloader downloaded successfully
sending file: ../32.boot.menu.v1.img
/ 8388608/8388608 bytes sent
../32.boot.menu.v1.img sent successfully


mainline kernel

u-boot from APX

This should allow you to send u-boot, kernel and initramfs to any tegra2 board which can be in APX mode without
modifying internal storage.

build u-boot

dpavlin@klin:/klin/u-boot$ cat env.sh 
export CROSS_COMPILE="arm-none-eabi-" ARCH=arm
dpavlin@klin:/klin/u-boot$ . env.sh 

dpavlin@klin:/klin/u-boot$ make paz00_defconfig

make



build kernel

dpavlin@klin:/klin/Tegra/linux$ git remote -v
origin  https://github.com/grate-driver/linux (fetch)
origin  https://github.com/grate-driver/linux (push)
samsung-tab-10.1        https://github.com/Decatf/linux (fetch)
samsung-tab-10.1        https://github.com/Decatf/linux (push)

dpavlin@klin:/klin/Tegra/linux$ git branch -vv
* master 63a6317580f8 [origin/master] ARM: tegra: Clear EMC interrupts on resume from LP1 on Tegra30+

dpavlin@klin:/klin/Tegra/linux$ cat /klin/u-boot/env.sh 
export CROSS_COMPILE="arm-none-eabi-" ARCH=arm
dpavlin@klin:/klin/Tegra/linux$ . /klin/u-boot/env.sh

dpavlin@klin:/klin/Tegra/linux$ make tegra_defconfig

make



create initrd with new modules

dpavlin@klin:/klin/Tegra/linux$ cat tegra-ramdisk.sh 
#!/bin/sh -xe

test -d initrd && rm -Rf initrd

mkdir initrd
cd initrd

gzip -cd  /tmp/initrd.img | fakeroot -- cpio -i -d -H newc --no-absolute-filenames

rm -R lib/modules/*

cd ..
make modules_install INSTALL_MOD_PATH=initrd/ INSTALL_MOD_STRIP=1

cd initrd

find . | cpio -o -R 0:0 -H newc > ../initrd.new.cpio

cd ..

gzip -f -6 initrd.new.cpio

/klin/u-boot/tools/mkimage -A arm -O linux -T ramdisk -C gzip -n uInitrd -d initrd.new.cpio.gz uInitrd.new

run it to create initrd:

dpavlin@klin:/klin/Tegra/linux$ ./tegra-ramdisk.sh 

Image Name:   uInitrd
Created:      Fri Oct 12 11:20:42 2018
Image Type:   ARM Linux RAMDisk Image (gzip compressed)
Data Size:    4082917 Bytes = 3987.22 KiB = 3.89 MiB
Load Address: 00000000
Entry Point:  00000000


create bootloader file

latest version seems to be: https://gitlab.com/uboot-ac100/create_bootimage.git

dpavlin@nuc:/nuc/Tegra/ac100/create_bootimage/example$ ../create_image.pl /mnt/klin/klin/u-boot/u-boot-dtb-tegra.bin /m
nt/klin/klin/Tegra/linux/arch/arm/boot/zImage /tmp/postmarketOS-export/initrd.img /mnt/klin/klin/Tegra/linux/arch/arm/b
oot/dts/tegra20-paz00.dtb uboot.scr boot.img
Creating boot image for tegrarcm ...

./tmp_uboot.scr
image layout:
section  loadaddr       size
=================================
uboot   : 0x108000      505627
kernel  : 0x190000      6485800
initrd  : 0x7c0000      4082981
fdt     : 0xbb0000      29659
script  : 0xbc0000      226

image written to boot.img

Now press CTRL + ESC + power on to enter APX mode

dpavlin@nuc:/nuc/Tegra/ac100/create_bootimage/example$ sudo apt-get install libcrypto++6

dpavlin@nuc:/nuc/Tegra/ac100/create_bootimage/example$ /mnt/klin/klin/Tegra/tegrarcm/src/tegrarcm --bct paz00-micron-toshiba-8g.bct --bootloader boot.img --loadaddr 0x108000 
bct file: paz00-micron-toshiba-8g.bct
bootloader file: boot.img
load addr 0x108000
entry addr 0x108000
device id: 0x7820
uid:  0x1700618943a00317
RCM version: 2.1
downloading miniloader to target at address 0x40008000 (132976 bytes)...
miniloader downloaded successfully
Chip UID:                0x00000000000000001700618943a00317
Chip ID:                 0x20
Chip ID Major Version:   0x1
Chip ID Minor Version:   0x2
Chip SKU:                0x8 (t20)
Boot ROM Version:        0x1
Boot Device:             0x2 (EMMC)
Operating Mode:          0x3 (developer mode)
Device Config Strap:     0x0
Device Config Fuse:      0x0
SDRAM Config Strap:      0x0
sending file: paz00-micron-toshiba-8g.bct
- 4080/4080 bytes sent
paz00-micron-toshiba-8g.bct sent successfully
sending file: boot.img
- 11239650/11239650 bytes sent
boot.img sent successfully


u-boot loads detects initrd (it's small enough thanks to MODULES_STRIP to be detected without CRC errors) but no output from kernel.

https://archlinuxarm.org/forum/viewtopic.php?f=23&t=10044&p=51142&hilit=ac100#p51142

suggests CONFIG_TEGRA_DEBUG_UARTA instead of CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA but it doesn't work for me.

dpavlin@klin:/klin/Tegra/linux$ grep 'TEGRA.*UART' .config
# CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA is not set
CONFIG_TEGRA_DEBUG_UARTA=y
# CONFIG_TEGRA_DEBUG_UARTB is not set
# CONFIG_TEGRA_DEBUG_UARTC is not set
# CONFIG_TEGRA_DEBUG_UARTD is not set
# CONFIG_TEGRA_DEBUG_UARTE is not set
CONFIG_DEBUG_TEGRA_UART=y



serial port

https://ac100.grandou.net/serial_port_modification

IMG_20181014_181159-800px.jpg

The serial port is the JP1 connector, near the left speaker connector. Pinout, from right to left:

  • 1 - in - RX UART1
  • 2 - out - TX UART1
  • 3 - out - T20_WAKE#
  • 4 - out - +3V
  • 5 - out - +1.8V
  • 6
  • 7
  • 8 - in - SYSTEM_RESET#
  • 9 - in - EC_TX80_PDATA
  • 10 - in - GND

I decided to solder GND to outer pin of connector to the right of pin 1 as opposed to other side of connector.

After that, a peace of capton tape was put over solder connectors to somewhat re-enforce them and provide insulation
to keyboard cover.

Serial is 3.3V, 115200 8n1.

Output is:

dpavlin@nuc:/nuc/Tegra$ microcom -p /dev/ttyUSB2
connected to /dev/ttyUSB2
Escape character: Ctrl-\
Type the escape character to get to the prompt.

U-Boot SPL 2018.11-rc1-00130-g0a60a81ba3 (Oct 12 2018 - 11:18:01 +0200)
Trying to boot from RAM


U-Boot 2018.11-rc1-00130-g0a60a81ba3 (Oct 12 2018 - 11:18:01 +0200)

TEGRA20
Model: Toshiba AC100 / Dynabook AZ
Board: Compal Paz00
DRAM:  512 MiB
MMC:   sdhci@c8000000: 1, sdhci@c8000600: 0
Loading Environment from MMC... *** Warning - bad CRC, using default environment

In:    serial
Out:   vidconsole
Err:   vidconsole
Net:   No ethernet found.
Hit any key to stop autoboot:  0
## Executing script at 00b30000
## Loading init Ramdisk from Legacy Image at 00700000 ...
   Image Name:   uInitrd
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    4269789 Bytes = 4.1 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 00b20000
   Booting using the fdt blob at 0xb20000
   Using Device Tree in place at 00b20000, end 00b2a3da

Starting kernel ...


Error: invalid dtb and unrecognized/unsupported machine ID
  r1=0x00000c38, r2=0x00000000
Available machine support:

ID (hex)        NAME
ffffffff        Generic DT based system
ffffffff        NVIDIA Tegra SoC (Flattened Device Tree)

Please check your kernel config and/or bootloader.


According to http://billauer.co.il/blog/2014/02/uboot-linux-dtb-fdt-device-tree/ this means that kernel didn't found valid device tree and tries to detect board usin machine ID registrars.

Solution for this seems to use u-boot variables for loading kernel, ramfs and dtb as opposed to values which script creates,
so this works (loading from usb keychain):

fatload usb 0:1 ${kernel_addr_r} /boot/zImage
fatload usb 0:1 ${fdt_addr_r} /boot/tegra20-paz00.dtb
fatload usb 0:1 ${ramdisk_addr_r} /boot/uInitrd.new
bootz ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}

Here are also known working addresses which u-boot uses:

Tegra20 (Paz00) MOD # echo ${kernel_addr_r}
0x01000000
Tegra20 (Paz00) MOD # echo ${fdt_addr_r}
0x02000000
Tegra20 (Paz00) MOD # echo ${ramdisk_addr_r} 
0x02100000

so much higher in memory map than create_image script. However, u-boot seems to want to load at 0x108000 so it's inpractical
to generate huge image to load kernel, dtb and initramfs at correct addresses.

bootstrap debian

based on https://wiki.debian.org/InstallingDebianOn/Toshiba/AC100

dpavlin@nuc:/mnt$ sudo debootstrap --foreign --arch=armhf stretch sdd1 http://ftp.hr.debian.org/debian

dpavlin@nuc:/mnt$ df sdd1/
Filesystem     1K-blocks   Used Available Use% Mounted on
/dev/sdd1        1021948 169056    784596  18% /mnt/sdd1

dpavlin@nuc:/mnt$ sudo cp /usr/bin/qemu-arm-static sdd1/usr/bin

dpavlin@nuc:/mnt$ sudo chroot sdd1 /debootstrap/debootstrap --second-stage

dpavlin@nuc:/mnt$ cd sdd1/
dpavlin@nuc:/mnt/sdd1$ sudo mount --bind /sys sys
dpavlin@nuc:/mnt/sdd1$ sudo mount --bind /dev dev
dpavlin@nuc:/mnt/sdd1$ sudo mount --bind /proc proc
dpavlin@nuc:/mnt/sdd1$ sudo chroot .

root@nuc:/# apt-get install u-boot-tools

root@ac100:/boot# cat boot.cmd 
ext2load usb 0:1 ${kernel_addr_r} /boot/zImage
ext2load usb 0:1 ${fdt_addr_r} /boot/tegra20-paz00.dtb
ext2load usb 0:1 ${ramdisk_addr_r} /boot/uInitrd
setenv bootargs root=/dev/sda1 rootwait CMA=64M tegrapart=recovery:300:a00:800,boot:d00:1000:800,mbr:1d00:200:800
bootz ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}

# mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr






u-boot over pax, usb filesystem

dpavlin@nuc:/nuc/Tegra/ac100/create_bootimage/example$ /mnt/klin/klin/Tegra/tegrarcm/src/tegrarcm --bct paz00-micron-toshiba-8g.bct --bootloader /mnt/klin/klin/Tegra/u-boot-tegra/u-boot-dtb-tegra.bin --loadaddr 0x108000
bct file: paz00-micron-toshiba-8g.bct


Serial output:

U-Boot SPL 2018.09-rc2-38340-g3d186cf3f3 (Oct 20 2018 - 10:46:53 +0200)
Trying to boot from RAM


U-Boot 2018.09-rc2-38340-g3d186cf3f3 (Oct 20 2018 - 10:46:53 +0200)

TEGRA20
Model: Toshiba AC100 / Dynabook AZ
Board: Compal Paz00
DRAM:  512 MiB
MMC:   sdhci@c8000000: 1, sdhci@c8000600: 0
Loading Environment from MMC... OK
In:    serial
Out:   vidconsole
Err:   vidconsole
Net:   No ethernet found.
starting USB...
USB0:   USB EHCI 1.00
USB1:   No code to set up ULPI controller, please enableCONFIG_USB_ULPI and CONFIG_USB_ULPI_VIEWPORTprobe failed, error -38
USB2:   USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 2 for devices... 4 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
Hit any key to stop autoboot:  0
Tegra20 (Paz00) MOD # run usb_boot


wifi

root@ac100:/etc/network/interfaces.d# apt-get install firmware-ralink wpasupplicant

root@ac100:/etc/network/interfaces.d# cat wlx6c626d1788b3 
allow-hotplug wlx6c626d1788b3
iface wlx6c626d1788b3 inet dhcp
        wpa-ssid dreamhouse
        wpa-psk xxxxxxxx


disk speed

root@ac100:~# hdparm -tT /dev/sda /dev/mmcblk1

/dev/sda:
 Timing cached reads:   560 MB in  2.01 seconds = 279.14 MB/sec
 Timing buffered disk reads:  32 MB in  3.07 seconds =  10.43 MB/sec

/dev/mmcblk1:
 Timing cached reads:   598 MB in  2.00 seconds = 298.86 MB/sec
 Timing buffered disk reads: 108 MB in  3.01 seconds =  35.83 MB/sec

tuhing block size

root@ac100:/home/dpavlin/flashbench# ./flashbench -a /dev/mmcblk1 --blocksize=1024
align 2147483648        pre 727µs      on 1.07ms       post 784µs     diff 316µs
align 1073741824        pre 833µs      on 1.13ms       post 789µs     diff 320µs
align 536870912 pre 798µs      on 1.13ms       post 825µs     diff 317µs
align 268435456 pre 816µs      on 1.15ms       post 795µs     diff 342µs
align 134217728 pre 742µs      on 1.12ms       post 843µs     diff 327µs
align 67108864  pre 669µs      on 987µs       post 701µs     diff 303µs
align 33554432  pre 662µs      on 1.04ms       post 643µs     diff 385µs
align 16777216  pre 837µs      on 1.09ms       post 864µs     diff 242µs
align 8388608   pre 800µs      on 1.1ms        post 881µs     diff 262µs
align 4194304   pre 812µs      on 1.07ms       post 838µs     diff 246µs
align 2097152   pre 807µs      on 1.07ms       post 808µs     diff 258µs
align 1048576   pre 832µs      on 960µs       post 838µs     diff 125µs
align 524288    pre 833µs      on 959µs       post 838µs     diff 124µs
align 262144    pre 833µs      on 959µs       post 838µs     diff 124µs
align 131072    pre 833µs      on 962µs       post 840µs     diff 126µs
align 65536     pre 825µs      on 951µs       post 838µs     diff 120µs
align 32768     pre 826µs      on 956µs       post 825µs     diff 130µs
align 16384     pre 812µs      on 924µs       post 824µs     diff 106µs
align 8192      pre 809µs      on 841µs       post 808µs     diff 32.4µs
align 4096      pre 808µs      on 836µs       post 808µs     diff 27.7µs
align 2048      pre 808µs      on 836µs       post 809µs     diff 27.6µs

8192 seems good, re-test

root@ac100:/home/dpavlin/flashbench# ./flashbench -a /dev/mmcblk1 --blocksize=4096
align 2147483648        pre 696µs      on 1.04ms       post 725µs     diff 331µs
align 1073741824        pre 917µs      on 1.18ms       post 870µs     diff 289µs
align 536870912 pre 880µs      on 1.18ms       post 907µs     diff 291µs
align 268435456 pre 899µs      on 1.2ms        post 877µs     diff 311µs
align 134217728 pre 825µs      on 1.18ms       post 927µs     diff 300µs
align 67108864  pre 864µs      on 1.11ms       post 842µs     diff 253µs
align 33554432  pre 914µs      on 1.12ms       post 897µs     diff 212µs
align 16777216  pre 921µs      on 1.14ms       post 948µs     diff 210µs
align 8388608   pre 884µs      on 1.15ms       post 965µs     diff 229µs
align 4194304   pre 895µs      on 1.12ms       post 922µs     diff 215µs
align 2097152   pre 890µs      on 1.12ms       post 890µs     diff 227µs
align 1048576   pre 916µs      on 1.01ms       post 922µs     diff 89.7µs
align 524288    pre 916µs      on 1.01ms       post 922µs     diff 90µs
align 262144    pre 916µs      on 1.01ms       post 923µs     diff 89.1µs
align 131072    pre 916µs      on 1.01ms       post 924µs     diff 91.1µs
align 65536     pre 908µs      on 1ms  post 921µs     diff 85.9µs
align 32768     pre 911µs      on 1.01ms       post 908µs     diff 96.2µs
align 16384     pre 895µs      on 973µs       post 908µs     diff 71.4µs
align 8192      pre 892µs      on 896µs       post 892µs     diff 4.57µs

create filesystem

root@ac100:/home/dpavlin/flashbench# mkfs -t ext4 -v -b 4096 -E stride=2,stripe-width=2 /dev/mmcblk1p6 

cp -ax ....

root@ac100:~# mount /dev/mmcblk1p1 /tmp/1/
root@ac100:~# cat /tmp/1/boot/boot.cmd 
ext2load mmc 0:6 ${kernel_addr_r} /boot/zImage
ext2load mmc 0:6 ${fdt_addr_r} /boot/tegra20-paz00.dtb
ext2load mmc 0:6 ${ramdisk_addr_r} /boot/uInitrd
setenv bootargs root=/dev/mmcblk1p6 rootwait CMA=64M tegrapart=recovery:300:a00:800,boot:d00:1000:800,mbr:1d00:200:800
bootz ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}

# mkimage -C none -A arm -T script -d boot.cmd boot.scr



flash u-boot to mmc

based on https://paz00.ru/index.php?title=Flashing_Uboot_to_MMC&setlang=en

tegrarcm to get bct

dpavlin@nuc:/nuc/Tegra$ git clone https://github.com/NVIDIA/tegrarcm

dpavlin@nuc:/nuc/Tegra$ cd tegrarcm/

dpavlin@nuc:/nuc/Tegra/tegrarcm$ sudo apt-get install libcrypto++-dev

dpavlin@nuc:/nuc/Tegra/tegrarcm$ ./autogen.sh

dpavlin@nuc:/nuc/Tegra/tegrarcm$ make

dpavlin@nuc:/nuc/Tegra/tegrarcm$ ./src/tegrarcm --version
tegrarcm 1.8

create boot image

dpavlin@nuc:/nuc/Tegra/cbootimage$ git remote -v
origin  https://github.com/NVIDIA/cbootimage (fetch)
origin  https://github.com/NVIDIA/cbootimage (push)

dpavlin@nuc:/nuc/Tegra/cbootimage$ ./autogen.sh
dpavlin@nuc:/nuc/Tegra/cbootimage$ make


dpavlin@nuc:/nuc/Tegra/cbootimage$ cat > u-boot.cfg
Version       = 0x00020001;
Bctcopy       = 1;
Bctfile       = ac100.bct;
BootLoader    = u-boot.bin,0x00108000,0x00108000,Complete;


dpavlin@nuc:/nuc/Tegra/cbootimage$ cp ../ac100/create_bootimage/example/ac100-dpavlin.bct ac100.bct

dpavlin@nuc:/nuc/Tegra/cbootimage$ cp /mnt/klin/klin/Tegra/u-boot-tegra/u-boot-tegra.bin u-boot.bin

dpavlin@nuc:/nuc/Tegra/cbootimage$ ./src/cbootimage -d u-boot.cfg ac100.bct.new
bct size: 4080
**update_bl()
begin_update(): bct data: b=14 p=9
writing bootloader
  redundancy = 1
  BL[0]: 131073 0001 0000 518563 0x00108000 0x00108000
8e52c9639cb433e9e1e369cf718595c5
  BL[1]: 131073 0002 0000 302746 0x00108000 0x00108000
a9014f31e7ccafab319512de6bc48f81
**BL[2]: 0 0000 0000 0000 0x00000000 0x00000000
00000000000000000000000000000000
**BL[3]: 0 0000 0000 0000 0x00000000 0x00000000
00000000000000000000000000000000
Image file ac100.bct.new has been successfully generated!

dpavlin@nuc:/nuc/Tegra/cbootimage$ scp ac100.bct.new ac100:

dpavlin@nuc:/nuc/Tegra/cbootimage$ ssh root@ac100

# flash new boot image on ac100

root@ac100:~# echo 0 > /sys/block/mmcblk1boot0/force_ro
root@ac100:~# dd if=/home/dpavlin/ac100.bct.new of=/dev/mmcblk1boot0 
1045+0 records in
1045+0 records out
535040 bytes (535 kB, 522 KiB) copied, 0.135589 s, 3.9 MB/s
root@ac100:~# echo 1 > /sys/block/mmcblk1boot0/force_ro 




create bct backup

dpavlin@ac100:~$ sudo dd if=/dev/mmcblk1boot0 of=ac100-dpavlin-0.bct bs=4080 count=1
[sudo] password for dpavlin: 
1+0 records in
1+0 records out
4080 bytes (4.1 kB, 4.0 KiB) copied, 0.0018642 s, 2.2 MB/s
dpavlin@ac100:~$ sudo dd if=/dev/mmcblk1boot1 of=ac100-dpavlin-1.bct bs=4080 count=1
1+0 records in
1+0 records out
4080 bytes (4.1 kB, 4.0 KiB) copied, 0.0019622 s, 2.1 MB/s

in my case, first bct doesn't have OdmData, while 2nd does:

dpavlin@nuc:/nuc/Tegra$ grep Odm 0 1
0:OdmData       = 0x00000000;
1:OdmData       = 0x800c0075;



i2c

root@ac100:~# i2cdetect -y -r 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- UU -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 4f 
50: 50 51 52 53 54 55 56 57 -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         
root@ac100:~# i2cdetect -y -r 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         
root@ac100:~# i2cdetect -y -r 2
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- UU -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         
permalink
Tegra
Tegra2_TRM_DP04508001v01p.pdf

I will try to collect useful stuff about Tegra latest upstream source on this page.

Nvidia Tegra 2/3 APX/nv3p protocol implementation

qemu

https://github.com/digetx/tegra2_qemu

VDPAU

https://github.com/grate-driver/libvdpau-tegra

tegra2 support for mainline

https://github.com/grate-driver

https://github.com/grate-driver/grate/wiki/Grate-driver

i2cdetect

root@ac100:~# i2cdetect -l
i2c-1   i2c             7000c400.i2c                            I2C adapter
i2c-2   i2c             7000d000.i2c                            I2C adapter
i2c-0   i2c             7000c000.i2c                            I2C adapter
root@ac100:~# i2cdetect -y 0                                                                                                                                                 
Error: Can't use SMBus Quick Write command on this bus                                                                                                                       
root@ac100:~# i2cdetect -F 0                                                                                                                                                 
Functionalities implemented by /dev/i2c-0:                                                                                                                                   
I2C                              yes                                                                                                                                         
SMBus Quick Command              no                                                                                                                                          
SMBus Send Byte                  yes                                                                                                                                         
SMBus Receive Byte               yes                                                                                                                                         
SMBus Write Byte                 yes                                                                                                                                         
SMBus Read Byte                  yes                                                                                                                                         
SMBus Write Word                 yes                                                                                                                                         
SMBus Read Word                  yes                                                                                                                                         
SMBus Process Call               yes                                                                                                                                         
SMBus Block Write                yes                                                                                                                                         
SMBus Block Read                 no
SMBus Block Process Call         no
SMBus PEC                        yes
I2C Block Write                  yes
I2C Block Read                   yes
root@ac100:~# i2cdetect -y -r 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- UU -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 4f 
50: 50 51 52 53 54 55 56 57 -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         
permalink
ULX3S

open source toolchain

dpavlin@klin:/klin/FPGA$ git clone https://github.com/SymbiFlow/prjtrellis
dpavlin@klin:/klin/FPGA/prjtrellis$ ./download-latest-db.sh 

dpavlin@klin:/klin/FPGA/prjtrellis$ cd libtrellis/
dpavlin@klin:/klin/FPGA/prjtrellis/libtrellis$ sudo apt-get install libpython3-dev libboost-python-dev libboost-filesystem-dev libboost-thread-dev libboost-program-options-dev
dpavlin@klin:/klin/FPGA/prjtrellis/libtrellis$ cmake -DCMAKE_INSTALL_PREFIX=/usr/local .
dpavlin@klin:/klin/FPGA/prjtrellis/libtrellis$ make






permalink
Xilinx CoolRunner-II

open source support

dpavlin@klin:/klin/FPGA$ sudo apt-get install cargo

dpavlin@klin:/klin/FPGA$ git clone https://github.com/azonenberg/openfpga

dpavlin@klin:/klin/FPGA$ cd openfpga/src/xc2par/

dpavlin@klin:/klin/FPGA/openfpga/src/xc2par$ cargo build --release


dpavlin@klin:/klin/FPGA/openfpga/src/xc2par$ cargo install --root /usr/local
warning: Using `cargo install` to install the binaries for the project in current working directory is deprecated, use `cargo install --path .` instead. Use `cargo build` if you want to simply build the package.
  Installing xc2par v0.0.2 (/klin/FPGA/openfpga/src/xc2par)
    Finished release [optimized] target(s) in 0.07s                                            
  Installing /usr/local/bin/yosys-json-to-intermed-json
  Installing /usr/local/bin/inputgraph-json-par
  Installing /usr/local/bin/intermed-json-to-inputgraph-json
  Installing /usr/local/bin/demo-driver
  Installing /usr/local/bin/xc2par

dpavlin@klin:/klin/FPGA$ yosys -p "synth_coolrunner2 -json blinky.json" blinky.v
dpavlin@klin:/klin/FPGA$ xc2par -p xc2c32a-4-vq44 blinky.json
dpavlin@klin:/klin/FPGA$ ls -al blinky.jed 
-rw-r--r-- 1 dpavlin dpavlin 15870 Nov  5 14:33 blinky.jed


dpavlin@klin:/klin/FPGA$ git clone https://github.com/azonenberg/jtaghal-cmake
dpavlin@klin:/klin/FPGA$ cd jtaghal-cmake/
dpavlin@klin:/klin/FPGA/jtaghal-cmake$ git submodule init
dpavlin@klin:/klin/FPGA/jtaghal-cmake$ git submodule update
dpavlin@klin:/klin/FPGA/jtaghal-cmake$ mkdir build
dpavlin@klin:/klin/FPGA/jtaghal-cmake$ cd build/
dpavlin@klin:/klin/FPGA/jtaghal-cmake/build$ sudo apt-get install libprotobuf-dev protobuf-compiler libedit-dev
dpavlin@klin:/klin/FPGA/jtaghal-cmake/build$ cmake ..
dpavlin@klin:/klin/FPGA/jtaghal-cmake/build$ make




boards

I have two CoolRunner-II boards from Dangerous Prototypes:

XC2C32A Bus Blaster

XC95144XL breakout board

permalink
H801

ESP8266 based H801 LED Wifi Controller

dpavlin@nuc:/nuc/esptool$ wget https://github.com/arendst/Sonoff-Tasmota/releases/download/v6.2.1/sonoff-sensors.bin

pi@rpi2 /nuc/esptool $ ./esptool.py --port /dev/ttyUSB2 write_flash -fs 1MB -fm dout 0x0 ./sonoff-sensors.bin 
esptool.py v2.3-dev
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Compressed 506336 bytes to 345467...
Wrote 506336 bytes (345467 compressed) at 0x00000000 in 31.6 seconds (effective 128.3 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

Now turn off board, remove jumper and blindly type in terminal

module 20

This didn't work for me, so I opened new wifi network on Android phone and configured wifi there.

permalink
CH340G serial
ch340g-3v3.png

ch340g-5v.png

Some of those serial dongles (I have one which is intended for esp01) have been configured for 5V operation instead of 3.3V.

You can check that by measuring RX and TX while plugged in in USB and if they are more than 3.3V your dongle is not really
3.3V.

permalink
Rigol


LAN

dpavlin@x200:/rest/cvs$ git clone https://github.com/RoGeorge/DS1054Z_screen_capture
Cloning into 'DS1054Z_screen_capture'...
remote: Counting objects: 77, done.
remote: Total 77 (delta 0), reused 0 (delta 0), pack-reused 77
Unpacking objects: 100% (77/77), done.
Checking connectivity... done.
dpavlin@x200:/rest/cvs$ cd DS1054Z_screen_capture/
dpavlin@x200:/rest/cvs/DS1054Z_screen_capture$ 

dpavlin@x200:/rest/cvs/DS1054Z_screen_capture$ python OscScreenGrabLAN.py png 192.168.3.250
Instrument ID: RIGOL TECHNOLOGIES,DS1104Z,DS1ZA172114616,00.04.03.SP2

Receiving screen capture...
Saved file: DS1104Z_DS1ZA172114616_2015-12-31_14.11.17.png

dpavlin@x200:/rest/cvs$ git clone https://github.com/pklaus/ds1054z
Cloning into 'ds1054z'...
remote: Counting objects: 693, done.
remote: Total 693 (delta 0), reused 0 (delta 0), pack-reused 693
Receiving objects: 100% (693/693), 136.88 KiB | 0 bytes/s, done.
Resolving deltas: 100% (340/340), done.
Checking connectivity... done.
dpavlin@x200:/rest/cvs$ cd ds1054z/
dpavlin@x200:/rest/cvs/ds1054z$ sudo python setup.py install
dpavlin@x200:/rest/cvs/ds1054z$ sudo apt-get install python-zeroconf

dpavlin@x200:/rest/cvs/ds1054z$ ds1054z discover
192.168.3.250

dpavlin@x200:/rest/cvs/ds1054z$ ds1054z info

Vendor:   RIGOL TECHNOLOGIES
Product:  DS1104Z
Serial:   DS1ZA172114___
Firmware: 00.04.03.SP2

dpavlin@x200:/rest/cvs/ds1054z$ ds1054z save-screen
ds1054z-scope-display_2015-12-31_14-19-52.png

VISA

USB

firmware update

dpavlin@x200:/tmp$ unzip -t DS1000Z\(ARM\)Update_00.04.03.02.03.zip 
Archive:  DS1000Z(ARM)Update_00.04.03.02.03.zip
    testing: DS1000Z(ARM)Update_00.04.03.02.03/   OK
    testing: DS1000Z(ARM)Update_00.04.03.02.03/DS1000ZUpdate.GEL   OK
No errors detected in compressed data of DS1000Z(ARM)Update_00.04.03.02.03.zip.

hints

  • Menu, Menu, Force, Menu - access system info menu

plugins for firmware

https://www.eevblog.com/forum/testgear/rigol-ds1000z-firmware-patch-plugins/

permalink
miraclecast

Hostname is misleading, this is rpi3

root@rpi2:/nuc/miraclecast/res# tail -14 /proc/cpuinfo 

processor       : 3
model name      : ARMv7 Processor rev 4 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

Hardware        : BCM2835
Revision        : a02082
Serial          : 000000004d092298



root@rpi2:/nuc/miraclecast/res# ./test-hardware-capabilities.sh 
wlan0 supports P2P

root@rpi2:/nuc/miraclecast# git remote -v
origin  https://github.com/albfan/miraclecast (fetch)
origin  https://github.com/albfan/miraclecast (push)


pi@rpi2 /nuc/miraclecast $ sudo apt-get install libudev-dev libreadline-dev gstreamer1.0-tools

pi@rpi2 /nuc/miraclecast $ ./autogen.sh c

make
make install

root@rpi2:~# miracle-wifid --log-level trace &

root@rpi2:/home/pi/miraclecast# miracle-sinkctl 
[ADD] Link: 3
[miraclectl] # run 3
now running on link 3

try to connect from android phone and fail

[ADD] Peer: ce:fa:00:af:9a:5a@3
[PROV] Peer: ce:fa:00:af:9a:5a@3 Type: pbc PIN: 
[GO NEG] Peer: ce:fa:00:af:9a:5a@3 Type: pbc PIN: 
[GO NEG] Peer: ce:fa:00:af:9a:5a@3 Type: pbc PIN: 
[FAIL] Peer: ce:fa:00:af:9a:5a@3 Reason: group owner negotiation failed
[miraclectl] # 
permalink
Galaxy Nexus i9250

Schematics and service manual for i9250: Samsung_i9250_schem_sm.rar



127|root@maguro:/ # cat /proc/cpuinfo                                          
Processor       : ARMv7 Processor rev 10 (v7l)
processor       : 0
BogoMIPS        : 1194.24

processor       : 1
BogoMIPS        : 1194.24

Features        : swp half thumb fastmult vfp edsp thumbee neon vfpv3 
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x2
CPU part        : 0xc09
CPU revision    : 10

Hardware        : Tuna
Revision        : 0009
Serial          : 014994b30201c013

BLE

GSM modem over serial port

HID keyboard

Unlegacy Android

ASOP for OMAP4 devices:

https://forum.xda-developers.com/galaxy-nexus/development/rom-omap4-aosp-project-t3334574

https://github.com/Unlegacy-Android/

kernel

http://unlegacy-android.cf/

https://github.com/Unlegacy-Android/android_kernel_samsung_tuna

dpavlin@klin:/virtual/android/galaxy-nexus$ git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8/

dpavlin@klin:/virtual/android/galaxy-nexus/omap$ git checkout -b asop-7.1 unlegacy/aosp-7.1

dpavlin@klin:/virtual/android/galaxy-nexus/omap$ make tuna_defconfig ARCH=arm

dpavlin@klin:/virtual/android/galaxy-nexus/omap$ cp include/linux/compiler-gcc4.h include/linux/compiler-gcc5.h


dpavlin@klin:/virtual/android/galaxy-nexus/omap$ make -j9 ARCH=arm CROSS_COMPILE=arm-none-eabi-

OMAP4 USB boot

Somewhat interesting things that I can take a look at some time in the future:

To compile it needs following change:

dpavlin@nuc:/nuc/Galaxy-Nexus-i9250/usbboot-omap4$ git diff
diff --git a/Makefile b/Makefile
index 2d10c73..9ea9461 100644
--- a/Makefile
+++ b/Makefile
@@ -38,7 +38,7 @@ BINDIR ?= $(DESTDIR)/usr/bin
 DATADIR ?= $(DESTDIR)/usr/share/usbboot
 DOCDIR ?= $(DESTDIR)/usr/share/doc/usbboot
 
-BOARD ?= panda
+BOARD ?= tuna
 
 TARGET_CC := $(TOOLCHAIN)gcc
 TARGET_LD := $(TOOLCHAIN)ld
diff --git a/tools/usb-linux.c b/tools/usb-linux.c
index e3492a1..09c40de 100755
--- a/tools/usb-linux.c
+++ b/tools/usb-linux.c
@@ -10,7 +10,7 @@ int linux_usb_init(void)
        r = libusb_init(&ctx);
        if (r != 0)
                return r;
-       libusb_set_debug(ctx,0x1);
+       //libusb_set_debug(ctx,0x1);
     return 0;
 }

Odin

serial

Nexus-usb-debug.png

Device Codename Resistor (R3) Connected VCC
Google Galaxy Nexus (GSM) samsung-maguro 619K ohm No
Samsung Galaxy Mini 2 samsung-s6500d 530K ohm No
Samsung Galaxy S4 Mini LTE samsung-i9195 619K ohm No
Samsung Galaxy S5 samsung-klte 619K ohm No

It seems that other suggestion is 150k from https://redmine.replicant.us/projects/replicant/wiki/SamsungSerial - I will have to test which value works

UART modes

Resistance Jig Boot
150k Inactive Inactive
523k Active Inactive
619k Active Active

RID_USB_OTG_MODE,	/* 0 0 0 0 0 	GND 		USB OTG Mode              */
RID_AUD_SEND_END_BTN,	/* 0 0 0 0 1 	2K		Audio Send_End Button*/
RID_AUD_REMOTE_S1_BTN,	/* 0 0 0 1 0 	2.604K		Audio Remote S1 Button */
RID_AUD_REMOTE_S2_BTN,	/* 0 0 0 1 1 	3.208K		Audio Remote S2 Button                         */
RID_AUD_REMOTE_S3_BTN,	/* 0 0 1 0 0 	4.014K		Audio Remote S3 Button */
RID_AUD_REMOTE_S4_BTN,	/* 0 0 1 0 1 	4.82K		Audio Remote S4 Button */
RID_AUD_REMOTE_S5_BTN,	/* 0 0 1 1 0 	6.03K		Audio Remote S5 Button */
RID_AUD_REMOTE_S6_BTN,	/* 0 0 1 1 1 	8.03K		Audio Remote S6 Button */
RID_AUD_REMOTE_S7_BTN,	/* 0 1 0 0 0 	10.03K		Audio Remote S7 Button */
RID_AUD_REMOTE_S8_BTN,	/* 0 1 0 0 1 	12.03K		Audio Remote S8 Button */
RID_AUD_REMOTE_S9_BTN,	/* 0 1 0 1 0 	14.46K		Audio Remote S9 Button */
RID_AUD_REMOTE_S10_BTN,	/* 0 1 0 1 1 	17.26K		Audio Remote S10 Button */
RID_AUD_REMOTE_S11_BTN,	/* 0 1 1 0 0 	20.5K		Audio Remote S11 Button */
RID_AUD_REMOTE_S12_BTN,	/* 0 1 1 0 1 	24.07K		Audio Remote S12 Button */
RID_RESERVED_1,		/* 0 1 1 1 0 	28.7K		Reserved Accessory #1 */
RID_RESERVED_2,		/* 0 1 1 1 1 	34K 		Reserved Accessory #2 */
RID_RESERVED_3,		/* 1 0 0 0 0 	40.2K		Reserved Accessory #3 */
RID_RESERVED_4,		/* 1 0 0 0 1 	49.9K		Reserved Accessory #4 */
RID_RESERVED_5,		/* 1 0 0 1 0 	64.9K		Reserved Accessory #5 */
RID_AUD_DEV_TY_2,	/* 1 0 0 1 1 	80.07K		Audio Device Type 2 */
RID_PHONE_PWD_DEV,	/* 1 0 1 0 0 	102K		Phone Powered Device */
RID_TTY_CONVERTER,	/* 1 0 1 0 1 	121K		TTY Converter */
RID_UART_CABLE,		/* 1 0 1 1 0 	150K		UART Cable */
RID_CEA936A_TY_1,	/* 1 0 1 1 1 	200K		CEA936A Type-1 Charger(1) */
RID_FM_BOOT_OFF_USB,	/* 1 1 0 0 0 	255K		Factory Mode Boot OFF-USB */
RID_FM_BOOT_ON_USB,	/* 1 1 0 0 1 	301K		Factory Mode Boot ON-USB */
RID_AUD_VDO_CABLE,	/* 1 1 0 1 0 	365K		Audio/Video Cable */
RID_CEA936A_TY_2,	/* 1 1 0 1 1 	442K		CEA936A Type-2 Charger(1) */
RID_FM_BOOT_OFF_UART,	/* 1 1 1 0 0 	523K		Factory Mode Boot OFF-UART */
RID_FM_BOOT_ON_UART,	/* 1 1 1 0 1 	619K		Factory Mode Boot ON-UART */
RID_AUD_DEV_TY_1_REMOTE, /* 1 1 1 1 0 	1000.07K	Audio Device Type 1 with Remote(1) */
RID_AUD_DEV_TY_1_SEND = RID_AUD_DEV_TY_1_REMOTE , /* 1 1 1 1 0 	1002K		Audio Device Type 1 / Only Send-End(2) */
RID_USB_MODE,		/* 1 1 1 1 1 	Open		USB Mode, Dedicated Charger or Accessory Detach */

usbid_allresistorvalues.png

PostmarketOS

dpavlin@nuc:/nuc/pmbootstrap$ ./pmbootstrap.py install --no-fde
[17:54:17] *** (1/5) PREPARE NATIVE CHROOT ***
[17:54:18] *** (2/5) CREATE DEVICE ROOTFS ("samsung-maguro") ***
[17:54:23] (rootfs_samsung-maguro) install
[17:54:27] (rootfs_samsung-maguro) install
[17:54:30] (rootfs_samsung-maguro) write /etc/os-release
[17:54:30] (rootfs_samsung-maguro) mkinitfs samsung-maguro
[17:54:34]  *** SET LOGIN PASSWORD FOR: 'dpavlin' ***
New password:
Retype new password:
passwd: password updated successfully
[17:54:43] NOTE: No valid keymap specified for device
[17:54:46] *** (3/5) PREPARE INSTALL BLOCKDEVICE ***
[17:54:47] (native) create samsung-maguro.img (361M)
[17:54:47] (native) mount /dev/install (samsung-maguro.img)
[17:54:47] (native) partition /dev/install (boot: 31M, root: the rest)
[17:54:47] (native) format /dev/installp2
[17:54:48] (native) mount /dev/installp2 to /mnt/install
[Tue Sep 25 17:55:21 2018] EXT4-fs (loop0p2): mounted filesystem with ordered data mode. Opts: (null)
[17:54:48] (native) format /dev/installp1 (boot, ext2), mount to /mnt/install/boot
[Tue Sep 25 17:55:21 2018] EXT4-fs (loop0p1): mounting ext2 file system using the ext4 subsystem
[Tue Sep 25 17:55:21 2018] EXT4-fs (loop0p1): mounted filesystem without journal. Opts: (null)
[17:54:48] *** (4/5) FILL INSTALL BLOCKDEVICE ***
[17:54:48] (native) copy rootfs_samsung-maguro to /mnt/install/
[17:54:53] *** (5/5) FLASHING TO DEVICE ***
[17:54:53] Run the following to flash your installation to the target device:
[17:54:53] * pmbootstrap flasher flash_rootfs
[17:54:53]   Flashes the generated rootfs image to your device:
[17:54:53]   /nuc/pmbootstrap-work/chroot_native/home/pmos/rootfs/samsung-maguro.img
[17:54:53]   (NOTE: This file has a partition table, which contains /boot and / subpartitions. That way we don't need to change the partition layout on your device.)
[17:54:53] * pmbootstrap flasher flash_kernel
[17:54:53]   Flashes the kernel + initramfs to your device:
[17:54:53]   /nuc/pmbootstrap-work/chroot_rootfs_samsung-maguro/boot
[17:54:53]   (NOTE: fastboot also supports booting the kernel/initramfs directly without flashing. Use 'pmbootstrap flasher boot' to do that.)
[17:54:53] * If the above steps do not work, you can also create symlinks to the generated files with 'pmbootstrap export' and flash outside of pmbootstrap.
[17:54:53] NOTE: chroot is still active (use 'pmbootstrap shutdown' as necessary)
[17:54:53] Done

dpavlin@nuc:/nuc/pmbootstrap$ alias pmbootstrap=/nuc/pmbootstrap/pmbootstrap.py
dpavlin@nuc:/nuc/pmbootstrap$ pmbootstrap flasher flash_rootfs
[17:57:10] (native) flash rootfs image
< waiting for any device >
[Tue Sep 25 17:59:17 2018] usb 2-3.1: new high-speed USB device number 22 using xhci_hcd
[Tue Sep 25 17:59:17 2018] usb 2-3.1: New USB device found, idVendor=18d1, idProduct=4e30, bcdDevice= 1.00
[Tue Sep 25 17:59:17 2018] usb 2-3.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[Tue Sep 25 17:59:17 2018] usb 2-3.1: Product: Android 1.0
[Tue Sep 25 17:59:17 2018] usb 2-3.1: Manufacturer: Google, Inc
[Tue Sep 25 17:59:17 2018] usb 2-3.1: SerialNumber: 014994B00C01A013
target didn't report max-download-size
Erasing 'system'...
OKAY [  0.047s]
Sending 'system' (369664 KB)...
OKAY [ 50.498s]
Writing 'system'...
OKAY [ 26.436s]
Finished. Total time: 77.024s
[18:00:02] NOTE: chroot is still active (use 'pmbootstrap shutdown' as necessary)
[18:00:02] Done
dpavlin@nuc:/nuc/pmbootstrap$ [Tue Sep 25 19:24:27 2018] usb 2-3.1: USB disconnect, device number 22
[Tue Sep 25 19:24:27 2018] usb 2-3.1: new high-speed USB device number 23 using xhci_hcd
[Tue Sep 25 19:24:27 2018] usb 2-3.1: unable to get BOS descriptor
[Tue Sep 25 19:24:27 2018] usb 2-3.1: New USB device found, idVendor=0451, idProduct=d010, bcdDevice= 0.00
[Tue Sep 25 19:24:27 2018] usb 2-3.1: New USB device strings: Mfr=33, Product=37, SerialNumber=0
[Tue Sep 25 19:24:27 2018] usb 2-3.1: Product: OMAP4440
[Tue Sep 25 19:24:27 2018] usb 2-3.1: Manufacturer: Texas Instruments
[Tue Sep 25 19:24:30 2018] usb 2-3.1: USB disconnect, device number 23

u-boot

permalink
Weblog Navigation
Loading...
Weblog Archives
  • Loading...