1*4882a593SmuzhiyunSamsung XE303C12 aka Chromebook Snow 2*4882a593Smuzhiyun==================================== 3*4882a593Smuzhiyun 4*4882a593SmuzhiyunThis file describes booting the Chromebook from an SD card containing 5*4882a593SmuzhiyunBuildroot kernel and rootfs, using the original bootloader. This is 6*4882a593Smuzhiyunthe least invasive way to get Buildroot onto the devices and a good 7*4882a593Smuzhiyunstarting point. 8*4882a593Smuzhiyun 9*4882a593SmuzhiyunThe bootloader will only boot a kernel from a GPT partition marked 10*4882a593Smuzhiyunbootable with cgpt tool from vboot-utils package. 11*4882a593SmuzhiyunThe kernel image must be signed using futility from the same package. 12*4882a593SmuzhiyunThe signing part is done by sign.sh script in this directory. 13*4882a593Smuzhiyun 14*4882a593SmuzhiyunIt does not really matter where rootfs is as long as the kernel is able 15*4882a593Smuzhiyunto find it, but this particular configuration assumes the kernel is on 16*4882a593Smuzhiyunpartition 1 and rootfs is on partition 2 of the SD card. 17*4882a593SmuzhiyunMake sure to check kernel.args if you change this. 18*4882a593Smuzhiyun 19*4882a593SmuzhiyunMaking the boot media 20*4882a593Smuzhiyun--------------------- 21*4882a593SmuzhiyunStart by configuring and building the images. 22*4882a593Smuzhiyun 23*4882a593Smuzhiyun make chromebook_snow_defconfig 24*4882a593Smuzhiyun make menuconfig # if necessary 25*4882a593Smuzhiyun make 26*4882a593Smuzhiyun 27*4882a593SmuzhiyunThe important files are: 28*4882a593Smuzhiyun 29*4882a593Smuzhiyun uImage.kpart (kernel and device tree, signed) 30*4882a593Smuzhiyun rootfs.tar 31*4882a593Smuzhiyun bootsd.img (SD card image containing both kernel and rootfs) 32*4882a593Smuzhiyun 33*4882a593SmuzhiyunWrite the image directly to some SD card. 34*4882a593SmuzhiyunWARNING: make sure there is nothing important on that card, 35*4882a593Smuzhiyunand double-check the device name! 36*4882a593Smuzhiyun 37*4882a593Smuzhiyun SD=/dev/mmcblk1 # may be /dev/sdX on some hosts 38*4882a593Smuzhiyun dd if=output/images/bootsd.img of=$SD 39*4882a593Smuzhiyun 40*4882a593SmuzhiyunSwitching to developer mode and booting from SD 41*4882a593Smuzhiyun----------------------------------------------- 42*4882a593SmuzhiyunPower Chromebook down, then power it up while holding Esc+F3. 43*4882a593SmuzhiyunBEWARE: switching to developer mode deletes all user data. 44*4882a593SmuzhiyunCreate backups if you need them. 45*4882a593Smuzhiyun 46*4882a593SmuzhiyunWhile in developer mode, Chromebook will boot into a white screen saying 47*4882a593Smuzhiyun"OS verification is off". 48*4882a593Smuzhiyun 49*4882a593SmuzhiyunPress Ctrl-D at this screen to boot Chromium OS from eMMC. 50*4882a593SmuzhiyunPress Ctrl-U at this screen to boot from SD (or USB) 51*4882a593SmuzhiyunPress Power to power it off. 52*4882a593SmuzhiyunDo NOT press Space unless you mean it. 53*4882a593SmuzhiyunThis will switch it back to normal mode. 54*4882a593Smuzhiyun 55*4882a593SmuzhiyunThe is no way to get rid of the white screen without re-flashing the bootloader. 56*4882a593Smuzhiyun 57*4882a593SmuzhiyunTroubleshooting 58*4882a593Smuzhiyun--------------- 59*4882a593SmuzhiyunLoud *BEEP* after pressing Ctrl-U means there's no valid partition to boot from. 60*4882a593SmuzhiyunWhich in turn means either bad GPT or improperly signed kernel. 61*4882a593Smuzhiyun 62*4882a593SmuzhiyunReturn to the OS verification screen without any sounds means the code managed 63*4882a593Smuzhiyunto reboot the board. May indicate properly signed but invalid image. 64*4882a593Smuzhiyun 65*4882a593SmuzhiyunBlank screen means the image is valid and properly signed but cannot boot 66*4882a593Smuzhiyunfor some reason, like missing or incorrect DT. 67*4882a593Smuzhiyun 68*4882a593SmuzhiyunIn case the board becomes unresponsive: 69*4882a593Smuzhiyun 70*4882a593Smuzhiyun* Press Esc+F3+Power. The board should reboot instantly. 71*4882a593Smuzhiyun Remove SD card to prevent it from attempting a system recovery. 72*4882a593Smuzhiyun 73*4882a593Smuzhiyun* Hold Power button for around 10s. The board should shut down into 74*4882a593Smuzhiyun its soft-off mode. Press Power button again or open the lid to turn in on. 75*4882a593Smuzhiyun 76*4882a593Smuzhiyun* If that does not work, disconnect the charger and push a hidden 77*4882a593Smuzhiyun button on the underside with a pin of some sort. The board should shut 78*4882a593Smuzhiyun down completely. Opening the lid and pressing Power button will not work. 79*4882a593Smuzhiyun To turn it back on, connect the charger. 80*4882a593Smuzhiyun 81*4882a593SmuzhiyunPartitioning SD card manually 82*4882a593Smuzhiyun----------------------------- 83*4882a593SmuzhiyunCheck mksd.sh for partitioning commands. 84*4882a593Smuzhiyun 85*4882a593SmuzhiyunUse parted and cgpt on a real device, and calculate the partition 86*4882a593Smuzhiyunsizes properly. The kernel partition may be as small as 4MB, but 87*4882a593Smuzhiyunyou will probably want the rootfs to occupy the whole remaining space. 88*4882a593Smuzhiyun 89*4882a593Smuzhiyuncgpt may be used to check current layout: 90*4882a593Smuzhiyun 91*4882a593Smuzhiyun output/host/bin/cgpt show $SD 92*4882a593Smuzhiyun 93*4882a593SmuzhiyunAll sizes and all offsets are in 512-byte blocks. 94*4882a593Smuzhiyun 95*4882a593SmuzhiyunWriting kernel and rootfs to a partitioned SD card 96*4882a593Smuzhiyun-------------------------------------------------- 97*4882a593SmuzhiyunWrite .kpart directly to the bootable partition: 98*4882a593Smuzhiyun 99*4882a593Smuzhiyun dd if=output/images/uImage.kpart of=${SD}1 100*4882a593Smuzhiyun 101*4882a593SmuzhiyunMake a new filesystem on the rootfs partition, and unpack rootfs.tar there: 102*4882a593Smuzhiyun 103*4882a593Smuzhiyun mkfs.ext4 ${SD}2 104*4882a593Smuzhiyun mount ${SD2} /mnt/<ROOTFS-PARTITION> 105*4882a593Smuzhiyun tar -xvf output/images/rootfs.tar -C /mnt/<ROOTFS-PARTITION> 106*4882a593Smuzhiyun umount /mnt/<ROOTFS-PARTITION> 107*4882a593Smuzhiyun 108*4882a593SmuzhiyunThis will require root permissions even if you can write to $SD. 109*4882a593Smuzhiyun 110*4882a593SmuzhiyunKernel command line 111*4882a593Smuzhiyun------------------- 112*4882a593SmuzhiyunThe command line is taken from board/chromebook/snow/kernel.args and stored 113*4882a593Smuzhiyunin the vboot header (which also holds the signature). 114*4882a593Smuzhiyun 115*4882a593SmuzhiyunThe original bootloader prepends "cros_secure console= " to the supplied 116*4882a593Smuzhiyuncommand line. The only way to suppress this is to enable CMDLINE_FORCE 117*4882a593Smuzhiyunin the kernel config, disabling external command line completely. 118*4882a593Smuzhiyun 119*4882a593SmuzhiyunThat's not necessary however. The mainline kernel ignores cros_secure, 120*4882a593Smuzhiyunand supplying console=tty1 in kernel.args undoes the effect of console= 121*4882a593Smuzhiyun 122*4882a593SmuzhiyunBooting with console= suppresses all kernel output. 123*4882a593SmuzhiyunAs a side effect, it makes /dev/console unusable, which the init in use must 124*4882a593Smuzhiyunbe able to handle. 125*4882a593Smuzhiyun 126*4882a593SmuzhiyunWiFi card 127*4882a593Smuzhiyun--------- 128*4882a593SmuzhiyunRun modprobe mwifiex_sdio to load the driver. 129*4882a593SmuzhiyunThe name of the device should be mlan0. 130*4882a593Smuzhiyun 131*4882a593SmuzhiyunFurther reading 132*4882a593Smuzhiyun--------------- 133*4882a593Smuzhiyunhttps://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices/samsung-arm-chromebook 134*4882a593Smuzhiyunhttp://linux-exynos.org/wiki/Samsung_Chromebook_XE303C12/Installing_Linux 135*4882a593Smuzhiyunhttp://archlinuxarm.org/platforms/armv7/samsung/samsung-chromebook 136*4882a593Smuzhiyunhttp://www.de7ec7ed.com/2013/05/application-processor-ap-uart-samsung.html 137*4882a593Smuzhiyunhttp://www.de7ec7ed.com/2013/05/embedded-controller-ec-uart-samsung.html 138