[Solved] Asus TB S

This is for any ARMv7 device that we do not officially support.

Re: Asus TB S

Postby TheSaint » Fri Aug 17, 2018 8:58 pm

Have you noted that the kernel has started?
I only face a problem, that it stops at this point
Code: Select all
[    4.025585] hid-generic 0003:0BDA:481A.0001: input,hiddev0,hidraw0: USB HID v1.11 Device [Generic USB Audio] on usb-ff500000.usb-1/input255

Maybe it's going further, but it might switch to another UART, as you mentioned.

EDIT
I started to build the new image. No success.

At the first step I've tried to prepare the whole image in a RAM block disk. But I failed to set the first partition offset, which was supposed to be 4M from the start. I've made the partition with fdisk, but I didn't realized to format it and mount it properly.

Given up that, I wrote into the SD card, which has the partition at 8192 blocks (4Mb) from the start. Copied the boot.scr & boot.txt, then modified the getty service.
The service is already present, but it point to tty1. I just thought that the kernel options should comply with this. So the statement console=tty0, might be console=tty1. But, OK, we test with the referred UART,

Then I took the tinker configuration, that you wrote with little changes:
Code: Select all
CONFIG_CREATE_ARCH_SYMLINK=y
CONFIG_ARM=y
CONFIG_SYS_ARCH="arm"
CONFIG_SYS_CPU="armv7"
CONFIG_SYS_SOC="rockchip"
CONFIG_SYS_VENDOR="rockchip"
CONFIG_SYS_BOARD="tinker_rk3288"
CONFIG_SYS_CONFIG_NAME="tinker_rk3288"
CONFIG_HAS_VBAR=y
CONFIG_HAS_THUMB2=y
CONFIG_ARM_ASM_UNIFIED=y
CONFIG_SYS_ARM_CACHE_CP15=y
CONFIG_SYS_ARM_MMU=y
CONFIG_CPU_V7A=y
CONFIG_SYS_ARM_ARCH=7
CONFIG_SYS_CACHE_SHIFT_6=y
CONFIG_SYS_CACHELINE_SIZE=64
CONFIG_SYS_THUMB_BUILD=y
CONFIG_SPL_SYS_THUMB_BUILD=y
CONFIG_ENABLE_ARM_SOC_BOOT0_HOOK=y
CONFIG_USE_ARCH_MEMCPY=y
CONFIG_SPL_USE_ARCH_MEMCPY=y
CONFIG_USE_ARCH_MEMSET=y
CONFIG_SPL_USE_ARCH_MEMSET=y
CONFIG_SPL_LDSCRIPT="arch/$(ARCH)/cpu/u-boot-spl.lds"
CONFIG_ARCH_ROCKCHIP=y
CONFIG_SYS_TEXT_BASE=0x00000000
CONFIG_SPL_LIBCOMMON_SUPPORT=y
CONFIG_SPL_LIBGENERIC_SUPPORT=y
CONFIG_SYS_MALLOC_F_LEN=0x2000
CONFIG_ROCKCHIP_RK3288=y
CONFIG_TPL_LDSCRIPT="arch/arm/mach-rockchip/rk3288/u-boot-tpl.lds"
CONFIG_TPL_TEXT_BASE=0xff704000
CONFIG_SPL_ROCKCHIP_BACK_TO_BROM=y
CONFIG_ROCKCHIP_BOOT_MODE_REG=0xff730094
CONFIG_ROCKCHIP_SPL_RESERVE_IRAM=0
CONFIG_ROCKCHIP_BROM_HELPER=y
CONFIG_SPL_MMC_SUPPORT=y
CONFIG_SPL_SERIAL_SUPPORT=y
CONFIG_BOARD_SPECIFIC_OPTIONS=y
CONFIG_TARGET_TINKER_RK3288=y
CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
CONFIG_ENV_SIZE=0x8000
CONFIG_ENV_OFFSET=0x3f8000
CONFIG_SPL_SYS_MALLOC_F_LEN=0x2000
CONFIG_SPL=y
CONFIG_DEBUG_UART_BASE=0xff690000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_IDENT_STRING=""
CONFIG_SPL_STACK_R_ADDR=0x80000
CONFIG_SPL_LIBDISK_SUPPORT=y
CONFIG_DEFAULT_DEVICE_TREE="rk3288-tinker"
CONFIG_SMBIOS_PRODUCT_NAME="tinker_rk3288"
CONFIG_DEBUG_UART=y
CONFIG_LOCALVERSION=""
CONFIG_LOCALVERSION_AUTO=y
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_DISTRO_DEFAULTS=y
CONFIG_ENV_VARS_UBOOT_CONFIG=y
CONFIG_SYS_MALLOC_F=y
CONFIG_TPL_SYS_MALLOC_F_LEN=0x2000
CONFIG_EXPERT=y
CONFIG_SYS_MALLOC_CLEAR_ON_INIT=y
CONFIG_IMAGE_FORMAT_LEGACY=y
CONFIG_SYS_EXTRA_OPTIONS=""
CONFIG_ARCH_FIXUP_FDT_MEMORY=y
CONFIG_BOOTSTAGE_RECORD_COUNT=30
CONFIG_SPL_BOOTSTAGE_RECORD_COUNT=5
CONFIG_BOOTSTAGE_STASH_ADDR=0
CONFIG_BOOTSTAGE_STASH_SIZE=0x1000
CONFIG_SD_BOOT=y
CONFIG_BOOTDELAY=10
CONFIG_USE_BOOTCOMMAND=y
CONFIG_BOOTCOMMAND="run distro_bootcmd"
CONFIG_MENU=y
CONFIG_LOGLEVEL=4
CONFIG_SPL_LOGLEVEL=4
CONFIG_SILENT_CONSOLE=y
CONFIG_SILENT_CONSOLE_UPDATE_ON_SET=y
CONFIG_CONSOLE_MUX=y
CONFIG_SYS_CONSOLE_IS_IN_ENV=y
CONFIG_SUPPORT_RAW_INITRD=y
CONFIG_DEFAULT_FDT_FILE=""
CONFIG_BOARD_LATE_INIT=y
CONFIG_DISPLAY_BOARDINFO=y
CONFIG_DISPLAY_BOARDINFO_LATE=y
CONFIG_HASH=y
CONFIG_SUPPORT_SPL=y
CONFIG_SPL_FRAMEWORK=y
CONFIG_SPL_BOARD_INIT=y
CONFIG_SPL_RAW_IMAGE_SUPPORT=y
CONFIG_SPL_LEGACY_IMAGE_SUPPORT=y
CONFIG_SPL_SYS_MALLOC_SIMPLE=y
CONFIG_SPL_STACK_R=y
CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x4000
CONFIG_SPL_EXT_SUPPORT=y
CONFIG_SPL_I2C_SUPPORT=y
CONFIG_SPL_MMC_WRITE=y
CONFIG_SPL_PAYLOAD="u-boot.bin"
CONFIG_CMDLINE=y
CONFIG_HUSH_PARSER=y
CONFIG_CMDLINE_EDITING=y
CONFIG_AUTO_COMPLETE=y
CONFIG_SYS_LONGHELP=y
CONFIG_SYS_PROMPT="=> "
CONFIG_AUTOBOOT=y
CONFIG_CMD_BDI=y
CONFIG_CMD_CONSOLE=y
CONFIG_CMD_BOOTD=y
CONFIG_CMD_BOOTM=y
CONFIG_CMD_BOOTZ=y
CONFIG_CMD_BOOTEFI=y
CONFIG_CMD_BOOTEFI_HELLO_COMPILE=y
CONFIG_CMD_BOOTMENU=y
CONFIG_CMD_ELF=y
CONFIG_CMD_FDT=y
CONFIG_CMD_GO=y
CONFIG_CMD_RUN=y
CONFIG_CMD_IMI=y
CONFIG_CMD_XIMG=y
CONFIG_CMD_EXPORTENV=y
CONFIG_CMD_IMPORTENV=y
CONFIG_CMD_EDITENV=y
CONFIG_CMD_SAVEENV=y
CONFIG_CMD_ENV_EXISTS=y
CONFIG_CMD_CRC32=y
CONFIG_CMD_MEMORY=y
CONFIG_CMD_DM=y
CONFIG_CMD_FASTBOOT=y
CONFIG_CMD_FLASH=y
CONFIG_CMD_GPIO=y
CONFIG_CMD_GPT=y
CONFIG_RANDOM_UUID=y
CONFIG_CMD_I2C=y
CONFIG_CMD_LOADB=y
CONFIG_CMD_LOADS=y
CONFIG_CMD_MMC=y
CONFIG_CMD_PART=y
CONFIG_CMD_SF=y
CONFIG_CMD_SPI=y
CONFIG_CMD_USB=y
CONFIG_CMD_ROCKUSB=y
CONFIG_CMD_ECHO=y
CONFIG_CMD_ITEST=y
CONFIG_CMD_SOURCE=y
CONFIG_CMD_NET=y
CONFIG_CMD_BOOTP=y
CONFIG_CMD_DHCP=y
CONFIG_BOOTP_BOOTPATH=y
CONFIG_BOOTP_DNS=y
CONFIG_BOOTP_GATEWAY=y
CONFIG_BOOTP_HOSTNAME=y
CONFIG_BOOTP_SUBNETMASK=y
CONFIG_BOOTP_PXE=y
CONFIG_BOOTP_PXE_CLIENTARCH=0x15
CONFIG_BOOTP_VCI_STRING="U-Boot.armv7"
CONFIG_CMD_TFTPBOOT=y
CONFIG_NET_TFTP_VARS=y
CONFIG_CMD_NFS=y
CONFIG_CMD_MII=y
CONFIG_CMD_PING=y
CONFIG_CMD_PXE=y
CONFIG_CMD_BLOCK_CACHE=y
CONFIG_CMD_CACHE=y
CONFIG_CMD_TIME=y
CONFIG_CMD_MISC=y
CONFIG_CMD_PMIC=y
CONFIG_CMD_REGULATOR=y
CONFIG_CMD_EXT2=y
CONFIG_CMD_EXT4=y
CONFIG_CMD_FAT=y
CONFIG_CMD_FS_GENERIC=y
CONFIG_MTDIDS_DEFAULT=""
CONFIG_MTDPARTS_DEFAULT=""
CONFIG_PARTITIONS=y
CONFIG_DOS_PARTITION=y
CONFIG_ISO_PARTITION=y
CONFIG_EFI_PARTITION=y
CONFIG_EFI_PARTITION_ENTRIES_NUMBERS=128
CONFIG_EFI_PARTITION_ENTRIES_OFF=0
CONFIG_PARTITION_UUIDS=y
CONFIG_SPL_PARTITION_UUIDS=y
CONFIG_SUPPORT_OF_CONTROL=y
CONFIG_DTC=y
CONFIG_OF_CONTROL=y
CONFIG_SPL_OF_CONTROL=y
CONFIG_OF_SEPARATE=y
CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
CONFIG_MKIMAGE_DTC_PATH="dtc"
CONFIG_ENV_IS_IN_MMC=y
CONFIG_NET=y
CONFIG_DM=y
CONFIG_SPL_DM=y
CONFIG_DM_WARN=y
CONFIG_DM_DEVICE_REMOVE=y
CONFIG_DM_STDIO=y
CONFIG_DM_SEQ_ALIAS=y
CONFIG_REGMAP=y
CONFIG_SPL_REGMAP=y
CONFIG_SYSCON=y
CONFIG_SPL_SYSCON=y
CONFIG_SIMPLE_BUS=y
CONFIG_OF_TRANSLATE=y
CONFIG_DM_DEV_READ_INLINE=y
CONFIG_ADC=y
CONFIG_SARADC_ROCKCHIP=y
CONFIG_BLK=y
CONFIG_HAVE_BLOCK_DEVICE=y
CONFIG_SPL_BLK=y
CONFIG_BLOCK_CACHE=y
CONFIG_CLK=y
CONFIG_SPL_CLK=y
CONFIG_FASTBOOT=y
CONFIG_USB_FUNCTION_FASTBOOT=y
CONFIG_FASTBOOT_BUF_ADDR=0x800800
CONFIG_FASTBOOT_BUF_SIZE=0x8000000
CONFIG_FASTBOOT_USB_DEV=0
CONFIG_FASTBOOT_FLASH=y
CONFIG_FASTBOOT_FLASH_MMC=y
CONFIG_FASTBOOT_FLASH_MMC_DEV=0
CONFIG_FASTBOOT_GPT_NAME="gpt"
CONFIG_FASTBOOT_MBR_NAME="mbr"
CONFIG_FASTBOOT_CMD_OEM_FORMAT=y
CONFIG_DM_GPIO=y
CONFIG_ROCKCHIP_GPIO=y
CONFIG_DM_I2C=y
CONFIG_SYS_I2C_ROCKCHIP=y
CONFIG_MISC=y
CONFIG_I2C_EEPROM=y
CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET=0x0
CONFIG_SYS_I2C_EEPROM_ADDR=0
CONFIG_SYS_I2C_EEPROM_BUS=0
CONFIG_SYS_EEPROM_SIZE=256
CONFIG_SYS_EEPROM_PAGE_WRITE_BITS=0
CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS=0
CONFIG_SYS_I2C_EEPROM_ADDR_LEN=1
CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW=0
CONFIG_MMC=y
CONFIG_MMC_WRITE=y
CONFIG_DM_MMC=y
CONFIG_SPL_DM_MMC=y
CONFIG_MMC_QUIRKS=y
CONFIG_MMC_HW_PARTITIONING=y
CONFIG_MMC_VERBOSE=y
CONFIG_MMC_DW=y
CONFIG_MMC_DW_ROCKCHIP=y
CONFIG_DM_SPI_FLASH=y
CONFIG_PHYLIB=y
CONFIG_DM_ETH=y
CONFIG_NETDEVICES=y
CONFIG_ETH_DESIGNWARE=y
CONFIG_GMAC_ROCKCHIP=y
CONFIG_PINCTRL=y
CONFIG_PINCTRL_FULL=y
CONFIG_PINCTRL_GENERIC=y
CONFIG_PINMUX=y
CONFIG_SPL_PINCTRL=y
CONFIG_PINCTRL_ROCKCHIP_RK3288=y
CONFIG_DM_PMIC=y
CONFIG_PMIC_CHILDREN=y
CONFIG_SPL_PMIC_CHILDREN=y
CONFIG_PMIC_RK8XX=y
CONFIG_DM_REGULATOR=y
CONFIG_DM_REGULATOR_FIXED=y
CONFIG_REGULATOR_RK8XX=y
CONFIG_DM_PWM=y
CONFIG_PWM_ROCKCHIP=y
CONFIG_RAM=y
CONFIG_SPL_RAM=y
CONFIG_BAUDRATE=115200
CONFIG_REQUIRE_SERIAL_CONSOLE=y
CONFIG_SERIAL_PRESENT=y
CONFIG_SPL_SERIAL_PRESENT=y
CONFIG_DM_SERIAL=y
CONFIG_SPL_DM_SERIAL=y
CONFIG_DEBUG_UART_NS16550=y
CONFIG_DEBUG_UART_SHIFT=2
CONFIG_SYS_NS16550=y
CONFIG_SPI=y
CONFIG_DM_SPI=y
CONFIG_SYSRESET=y
CONFIG_USB=y
CONFIG_DM_USB=y
CONFIG_USB_HOST=y
CONFIG_USB_DWC2=y
CONFIG_USB_DWC2_BUFFER_SIZE=64
CONFIG_ROCKCHIP_USB2_PHY=y
CONFIG_USB_STORAGE=y
CONFIG_USB_GADGET=y
CONFIG_USB_GADGET_MANUFACTURER="Rockchip"
CONFIG_USB_GADGET_VENDOR_NUM=0x2207
CONFIG_USB_GADGET_PRODUCT_NUM=0x320a
CONFIG_USB_GADGET_DWC2_OTG=y
CONFIG_USB_GADGET_VBUS_DRAW=2
CONFIG_USB_GADGET_DUALSPEED=y
CONFIG_USB_GADGET_DOWNLOAD=y
CONFIG_USB_FUNCTION_MASS_STORAGE=y
CONFIG_USB_FUNCTION_ROCKUSB=y
CONFIG_USB_HOST_ETHER=y
CONFIG_USB_ETHER_ASIX=y
CONFIG_USB_ETHER_SMSC95XX=y
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_FS_EXT4=y
CONFIG_FS_FAT=y
CONFIG_FAT_WRITE=y
CONFIG_FS_FAT_MAX_CLUSTSIZE=65536
CONFIG_HAVE_PRIVATE_LIBGCC=y
CONFIG_LIB_UUID=y
CONFIG_PRINTF=y
CONFIG_SPL_PRINTF=y
CONFIG_SPRINTF=y
CONFIG_SPL_SPRINTF=y
CONFIG_STRTO=y
CONFIG_SPL_STRTO=y
CONFIG_IMAGE_SPARSE=y
CONFIG_IMAGE_SPARSE_FILLBUF_SIZE=0x80000
CONFIG_USE_PRIVATE_LIBGCC=y
CONFIG_SYS_HZ=1000
CONFIG_USE_TINY_PRINTF=y
CONFIG_REGEX=y
CONFIG_LIB_RAND=y
CONFIG_CMD_DHRYSTONE=y
CONFIG_ERRNO_STR=y
CONFIG_OF_LIBFDT=y
CONFIG_SPL_OF_LIBFDT=y
CONFIG_GENERATE_SMBIOS_TABLE=y
CONFIG_SMBIOS_MANUFACTURER="rockchip"
CONFIG_EFI_LOADER=y
CONFIG_OPTEE_LOAD_ADDR=0x00000000

Then whipped up a new u-boot.bin and wrote it
Code: Select all
$ dd if=u-boot.bin of=/dev/sdc seek=16384


Now the test fails
Code: Select all
U-Boot SPL 2018.07 (Aug 17 2018 - 18:19:27 +0000)
Returning to boot ROM...


U-Boot 2018.07 (Aug 17 2018 - 18:19:27 +0000)

Model: Tinker-RK3288
DRAM:  2 GiB
MMC:   dwmmc@ff0c0000: 1, dwmmc@ff0d0000: 2
Loading Environment from MMC... *** Warning - bad CRC, using default environment

Failed (-5)
In:    serial
Out:   serial
Err:   serial
Model: Tinker-RK3288
Net:   eth0: ethernet@ff290000
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:1...
Found U-Boot script /boot/boot.scr
invalid extent block
## Executing script at 00000000
Wrong image format for "source" command
SCRIPT FAILED: continuing...
starting USB...
USB0:   USB1:   scanning bus 0 for devices... 2 USB Device(s) found
scanning bus 1 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

Device 0: unknown device
ethernet@ff290000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
......MANY more trial on ethernet


So probably I've gone bad, so I think to user the last image (ArmArchVeryron2), and substitute the rootfs with modification. At the least should be easier to start, as long as the SD card header is good for booting.

Now still pending to boot, so I'll try to input the script command manually and try what it will give.
TheSaint
 
Posts: 345
Joined: Mon Jul 23, 2018 7:57 am

Re: Asus TB S

Postby TheSaint » Sat Aug 18, 2018 6:01 am

Good news! :D :D :D
I found the issue and I got to the login console
Code: Select all
FIXED.
TB-SD-root:                                                                              Inode 11857 seems to contain garbage. 

TB-SD-root: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
        (i.e., without -a or -p options)
ERROR: Bailing out. Run 'fsck /dev/mmcblk0p1' manually
********** FILESYSTEM CHECK FAILED **********
*                                           *
*  Please run fsck manually. After leaving  *
*  this maintenance shell, the system will  *
*  reboot automatically.                    *
*                                           *
*********************************************
sh: can't access tty; job control turned off
[rootfs ]#

The problem in the script is the variable devnum, its result is 0, but when I putted 1 the rest of the script succeeded.

I'll try some adjustment...
TheSaint
 
Posts: 345
Joined: Mon Jul 23, 2018 7:57 am

Re: Asus TB S

Postby TheSaint » Sat Aug 18, 2018 6:58 am

Boys! I logged in :D :D: :D :D
Code: Select all
Arch Linux 4.17Arch Linux 4.17.11-1-ARCH (ttyS2)

Arch Linux 4.17.11-1-ARCH (ttyS2)

alarm login: alarm login: alarm
Password:
[alarm@alarm ~]$ find -name \*ff0d0000 /proc/device-tree

So I don't know what made to load the kernel and switch from initramfs. I was expecting some failure on finding the correct devnum, this time.

I must try at least three more times :P
TheSaint
 
Posts: 345
Joined: Mon Jul 23, 2018 7:57 am

Re: [Solved, first stage] Asus TB S

Postby summers » Sat Aug 18, 2018 10:42 am

Yes - you didn't need to write the u-boot.bin to sector 16384, I attached the u-boot.bin to the end of the sql, as documented at line 126 of the README.rockchip in the u-boot doc.

Problem with sector 16384 is its 8MB into the sd, and unless you do an unusual partition table, that usually well into a partition. So that could have been what gave your disk errors.

Checked my package, oops I misnamed the boot.scr - I called it boot.scp - so thats why that bit barfed. You can use the mkimage program in your u-boot/tools directory to correct, use:
Code: Select all
mkimage -A arm -O linux -T script -C none -n "U-Boot boot script" -d boot.txt boot.scr

Alternatively install "uboot-tools" - its a standard package.

Did the find command locate dwmmc@ff0d0000? So I can give you the commands that should enable the eMMC. OOps I got the find command wrong, can you try:
Code: Select all
find /proc/device-tree/ -name \*ff0d0000


Thought about the eMMC last night - I'm 90% certain its a device tree problem. That would explain why linux can't see it, and we solve that by updating the device tree. Now u-boot also uses a device tree, and it has the same fault. So last night bit of research into how best to cure - what makes most sensce is starting a tinkerS branch in both u-boot and the device tree.

I'll probably implement that today, its a few hours coding - and the easiest way of doing it. If that cures the problem, we can then mainline both uboot and the device-tree, so it will be maintained going forward.

Oh yes, getty is the standard login process in unix, so thats why its already started. You probably want the default set up running. so you can login when you plug in a keyboard. Problem is that linux doesn't known to start it on serial lines by default, so linking that file just tells it to start on that interface. Now as the uart is on ttyS2, thats why we say start the getty there ...
summers
 
Posts: 868
Joined: Sat Sep 06, 2014 12:56 pm

Re: [Solved, first stage] Asus TB S

Postby TheSaint » Sat Aug 18, 2018 12:33 pm

Well, we should have all ingredients and refine the result.
From within ALarm:
Code: Select all
$ find /proc/device-tree/ -name \*ff0d0000
/proc/device-tree/dwmmc@ff0d0000


I didn't know exactly where the rootfs should start. I took the linaro/TinkerOS example that shown to start a 4Mb. Even the first image of yours I downloaded I got to mount it with 4Mb offset. According Rockchip Wiki the rootfs may start at 0x4000., but for my understanding is a bit of trial.
Then I follow the instructions
Code: Select all
$ dd if=TBS/idbspl.img of=/dev/sdc bs=512 seek=64

## for the u-boot, which the config is at https://archlinuxarm.org/forum/posting.php?mode=reply&f=44&t=12952#pr59115
$ dd if=u-boot.bin of=/dev/sdc seek=16384
# mkdir /tmp/root
# mount /dev/sdc1 /tmp/root        ## it might be /mnt the same
# bsdtar -xpf ArchLinuxARM-armv7-latest.tar.gz -C /tmp/root/
# umount  /tmp/root
# fsck.ext4 -n /dev/sdc1     ## verification whether the copy is integer

Found the wrong suffix and remade the boot script
Code: Select all
[root@alarm alarm]# cat /boot/boot.txt
# After modifying, run ./mkscr

if test -n ${distro_bootpart}; then setenv bootpart ${distro_bootpart}; else setenv bootpart 1; fi
part uuid ${devtype} ${devnum}:${bootpart} uuid

setenv bootargs "console=ttyS2,115200n8 console=${console} root=PARTUUID=${uuid} rw rootwait"

if load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} /boot/zImage; then
  if load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} /boot/dtbs/${fdtfile}; then
    if load ${devtype} ${devnum}:${bootpart} ${ramdisk_addr_r} /boot/initramfs-linux.img; then
      bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r};
    else
      bootz ${kernel_addr_r} - ${fdt_addr_r};
    fi;
  fi;
fi[root@alarm alarm]# cat /boot/boot.txt
# After modifying, run ./mkscr

if test -n ${distro_bootpart}; then setenv bootpart ${distro_bootpart}; else setenv bootpart 1; fi
part uuid ${devtype} ${devnum}:${bootpart} uuid

setenv bootargs "console=ttyS2,115200n8 console=${console} root=PARTUUID=${uuid} rw rootwait"

if load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} /boot/zImage; then
  if load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} /boot/dtbs/${fdtfile}; then
    if load ${devtype} ${devnum}:${bootpart} ${ramdisk_addr_r} /boot/initramfs-linux.img; then
      bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r};
    else
      bootz ${kernel_addr_r} - ${fdt_addr_r};
    fi;
  fi;
fi

That's it.
Probably I'll change the kernel parameter ${bootparms} and adding quiet, because it's already pretty unnecessary, as long can be found the report into the journal.
So the memory media are
Code: Select all
# fdisk -l
Disk /dev/mmcblk0: 14.4 GiB, 15489564672 bytes, 30253056 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x44938476

Device         Boot Start     End Sectors  Size Id Type
/dev/mmcblk0p1       8192 8200191 8192000  3.9G 83 Linux


This what we got to make TB S running. There's an importat issue to tackle, which is the r8723bs module still not working. So for now I find hard to get an update ;)
TheSaint
 
Posts: 345
Joined: Mon Jul 23, 2018 7:57 am

Re: [Solved, first stage] Asus TB S

Postby summers » Sat Aug 18, 2018 1:20 pm

Yes u-boot will find the partition whatever its offset, so we are mainly constrained by what the boot set up needs.

So as long as we don't do u-boot env varaibles (we could disable them just to be sure), and we append the u-boot to the spl, then I think we can start the first partition anywhere after sector 1024 - at least thats what the maths gave last night, but given the other mistakes I made, they could be wrong.

Didn't we solve the wifi problem? Just a case of checking how its done in a modern kernel.

Am 60% of the way through doing tinkerS device trees for both u-boot and the kernel, so I'll see if I can do any wireless stuff there ...

Oh yes, can you do
Code: Select all
ls /proc/device-tree/dwmmc@ff0d0000
- I'll probably have a proper device tree done when you have the answer - but be good to know if we need to fiddle with it in u-boot.

Anyway off to cut my grass, I be back later ...
summers
 
Posts: 868
Joined: Sat Sep 06, 2014 12:56 pm

Re: [Solved, first stage] Asus TB S

Postby TheSaint » Sat Aug 18, 2018 1:59 pm

Hey, don't forget the grass :D But don't stress yourself :D
Well, just curious how to arrange idbslp.bin . I guess we can get it from Rockchip, or have made your own ?
So, I'll test booting from eMMC.
I think that the discovered media will take the same name and number, according the priority. It might be only the condition how the jumper on the board set that priority.
TheSaint
 
Posts: 345
Joined: Mon Jul 23, 2018 7:57 am

Re: [Solved, first stage] Asus TB S

Postby summers » Sun Aug 19, 2018 10:43 am

OK, I've done a u-boot and device tree that enables dwmmc@ff0d0000. This is enabled in the rk3288-miniarm.dtb, and so believed where the eMMC is. So new u-boot and device tree may be able to see the eMMC.

You can download at http://davidjohnsummers.uk/TBS2.tar.gz

I've updated the README so it should be clearer.

I corrected the problem in boot.scr - so worth trying that out, it means that you won't have to type commands into u-boot, it will run by default. If you make changes to the boot.txt, use the mkscr script to regenerate the boot.scr.

Let me know if this works, if so I'll do patches for u-boot and linux, to see if we can get the tinker board S device tree mainlined.

Oh yes, the device tree has nothing on the wireless, that connected via an SDIO port - I don't know which.

the spl/u-boot image is created using the instructions http://git.denx.de/?p=u-boot.git;a=blob;f=doc/README.rockchip;hb=HEAD#l126
summers
 
Posts: 868
Joined: Sat Sep 06, 2014 12:56 pm

Re: [Solved, first stage] Asus TB S

Postby TheSaint » Sun Aug 19, 2018 12:55 pm

I've spent all day to fix the problem with eMMC disappearance.
The issue is about writing to the wrong place, then the eMMC is no more accessible via USB, when TBS is plugged to the host computer.
In my experiences I faced to lost the partition table, several times with many medias, but was/is recoverable because the media is recognize. The TBS is a bit different, as you may note, in the u-boot config there're two lines which defining VendorID and ProductID, so they're important to save.
To be able to recover the situation I had to flash another image, which in the first 4 Mbytes there are the information regarding what to list when plugged to a host PC.
Usually, ALarm doesn't use to look at that, but can not be for this board.
Some time the kernel find the PID and VID, but doesn't act to recognize it as media. Some time there's nothing at all.

I've tried to clone the SD card, but there are problem with the size. It will result with invalid file system. Even written successfully, may happen to behave slightly different during the boot. I still experimenting......

So as you gave me that new setup, I still concern to find where I should find the bytes to save, in order to keep the eMMC visible as memory media.

EDIT

I've tried the last setup. I faced the problem again that the eMMC is disappeared. So it is supposed that even by u-boot it won't find the eMMC.
The cause could be that we overwrite the precious bit which define the memory media.
The u-boot starts with this message:
Code: Select all
MMC:   dwmmc@ff0c0000: 1
Loading Environment from MMC... Card did not respond to voltage select!
*** Warning - No block device, using default environment

Failed (-5)
In:    serial
Out:   serial
Err:   serial
Model: TinkerS-RK3288
Net:   eth0: ethernet@ff290000
Hit any key to stop autoboot:  0
starting USB...
USB0:   USB1:   scanning bus 0 for devices... 2 USB Device(s) found
scanning bus 1 for devices... 1 USB Device(s) found

I will try to clone the SD card.
TheSaint
 
Posts: 345
Joined: Mon Jul 23, 2018 7:57 am

Re: [Solved, first stage] Asus TB S

Postby summers » Sun Aug 19, 2018 5:35 pm

Strange, it scanned the USB before the MMC. It wasn't meant to do that.

At least it said the board was TinkerS-rk3288 so added the "S"

When you say access the eMMC via usb, do you mean you unplug it and use an adaptor like : https://www.hardkernel.com/main/products/prdt_info.php?g_code=G135415955758

Or that the TB S bings up an OTG USB connection that looks like a USB stick.

If the latter, I don't know what does that. u-boot compiled with some otg stuff, so maybe that. Or is it the RK3288 boot rom?

Could you interrupt u-boot and do those mmc commands? Hopefully if this work we can boot from either sd or eMMC and then write to the other ...
summers
 
Posts: 868
Joined: Sat Sep 06, 2014 12:56 pm

PreviousNext

Return to Community Supported

Who is online

Users browsing this forum: No registered users and 2 guests