README.hardware 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455
  1. Poky Hardware README
  2. ====================
  3. This file gives details about using Poky with different hardware reference
  4. boards and consumer devices. A full list of target machines can be found by
  5. looking in the meta/conf/machine/ directory. If in doubt about using Poky with
  6. your hardware, consult the documentation for your board/device.
  7. Support for additional devices is normally added by creating BSP layers - for
  8. more information please see the Yocto Board Support Package (BSP) Developer's
  9. Guide - documentation source is in documentation/bspguide or download the PDF
  10. from:
  11. http://yoctoproject.org/community/documentation
  12. Support for machines other than QEMU may be moved out to separate BSP layers in
  13. future versions.
  14. QEMU Emulation Targets
  15. ======================
  16. To simplify development Poky supports building images to work with the QEMU
  17. emulator in system emulation mode. Several architectures are currently
  18. supported:
  19. * ARM (qemuarm)
  20. * x86 (qemux86)
  21. * x86-64 (qemux86-64)
  22. * PowerPC (qemuppc)
  23. * MIPS (qemumips)
  24. Use of the QEMU images is covered in the Poky Reference Manual. The Poky
  25. MACHINE setting corresponding to the target is given in brackets.
  26. Hardware Reference Boards
  27. =========================
  28. The following boards are supported by Poky's core layer:
  29. * Texas Instruments Beagleboard (beagleboard)
  30. * Freescale MPC8315E-RDB (mpc8315e-rdb)
  31. * Ubiquiti Networks RouterStation Pro (routerstationpro)
  32. For more information see the board's section below. The Poky MACHINE setting
  33. corresponding to the board is given in brackets.
  34. Consumer Devices
  35. ================
  36. The following consumer devices are supported by Poky's core layer:
  37. * Intel Atom based PCs and devices (atom-pc)
  38. For more information see the device's section below. The Poky MACHINE setting
  39. corresponding to the device is given in brackets.
  40. Specific Hardware Documentation
  41. ===============================
  42. Intel Atom based PCs and devices (atom-pc)
  43. ==========================================
  44. The atom-pc MACHINE is tested on the following platforms:
  45. o Asus eee901
  46. o Acer Aspire One
  47. o Toshiba NB305
  48. o Intel Embedded Development Board 1-N450 (Black Sand)
  49. and is likely to work on many unlisted atom based devices. The MACHINE type
  50. supports ethernet, wifi, sound, and i915 graphics by default in addition to
  51. common PC input devices, busses, and so on.
  52. Depending on the device, it can boot from a traditional hard-disk, a USB device,
  53. or over the network. Writing poky generated images to physical media is
  54. straightforward with a caveat for USB devices. The following examples assume the
  55. target boot device is /dev/sdb, be sure to verify this and use the correct
  56. device as the following commands are run as root and are not reversable.
  57. Hard Disk:
  58. 1. Build a directdisk image format. This will generate proper partition tables
  59. that will in turn be written to the physical media. For example:
  60. $ bitbake core-image-minimal-directdisk
  61. 2. Use the "dd" utility to write the image to the raw block device. For example:
  62. # dd if=core-image-minimal-directdisk-atom-pc.hdddirect of=/dev/sdb
  63. USB Device:
  64. 1. Build an hddimg image format. This is a simple filesystem without partition
  65. tables and is suitable for USB keys. For example:
  66. $ bitbake core-image-minimal-live
  67. 2. Use the "dd" utility to write the image to the raw block device. For
  68. example:
  69. # dd if=core-image-minimal-live-atom-pc.hddimg of=/dev/sdb
  70. If the device fails to boot with "Boot error" displayed, it is likely the BIOS
  71. cannot understand the physical layout of the disk (or rather it expects a
  72. particular layout and cannot handle anything else). There are two possible
  73. solutions to this problem:
  74. 1. Change the BIOS USB Device setting to HDD mode. The label will vary by
  75. device, but the idea is to force BIOS to read the Cylinder/Head/Sector
  76. geometry from the device.
  77. 2. Without such an option, the BIOS generally boots the device in USB-ZIP
  78. mode.
  79. a. Configure the USB device for USB-ZIP mode:
  80. # mkdiskimage -4 /dev/sdb 0 63 62
  81. Where 63 and 62 are the head and sector count as reported by fdisk.
  82. Remove and reinsert the device to allow the kernel to detect the new
  83. partition layout.
  84. b. Copy the contents of the poky image to the USB-ZIP mode device:
  85. # mount -o loop core-image-minimal-live-atom-pc.hddimg /tmp/image
  86. # mount /dev/sdb4 /tmp/usbkey
  87. # cp -rf /tmp/image/* /tmp/usbkey
  88. c. Install the syslinux boot loader:
  89. # syslinux /dev/sdb4
  90. Install the boot device in the target board and configure the BIOS to boot
  91. from it.
  92. For more details on the USB-ZIP scenario, see the syslinux documentation:
  93. http://git.kernel.org/?p=boot/syslinux/syslinux.git;a=blob_plain;f=doc/usbkey.txt;hb=HEAD
  94. Texas Instruments Beagleboard (beagleboard)
  95. ===========================================
  96. The Beagleboard is an ARM Cortex-A8 development board with USB, DVI-D, S-Video,
  97. 2D/3D accelerated graphics, audio, serial, JTAG, and SD/MMC. The xM adds a
  98. faster CPU, more RAM, an ethernet port, more USB ports, microSD, and removes
  99. the NAND flash. The beagleboard MACHINE is tested on the following platforms:
  100. o Beagleboard C4
  101. o Beagleboard xM Rev A
  102. The Beagleboard C4 has NAND, while the xM does not. For the sake of simplicity,
  103. these instructions assume you have erased the NAND on the C4 so its boot
  104. behavior matches that of the xM. To do this, issue the following commands from
  105. the u-boot prompt (note that the unlock may be unecessary depending on the
  106. version of u-boot installed on your board and only one of the erase commands
  107. will succeed):
  108. # nand unlock
  109. # nand erase
  110. # nand erase.chip
  111. To further tailor these instructions for your board, please refer to the
  112. documentation at http://www.beagleboard.org.
  113. From a Linux system with access to the image files perform the following steps
  114. as root, replacing mmcblk0* with the SD card device on your machine (such as sdc
  115. if used via a usb card reader):
  116. 1. Partition and format an SD card:
  117. # fdisk -lu /dev/mmcblk0
  118. Disk /dev/mmcblk0: 3951 MB, 3951034368 bytes
  119. 255 heads, 63 sectors/track, 480 cylinders, total 7716864 sectors
  120. Units = sectors of 1 * 512 = 512 bytes
  121. Device Boot Start End Blocks Id System
  122. /dev/mmcblk0p1 * 63 144584 72261 c Win95 FAT32 (LBA)
  123. /dev/mmcblk0p2 144585 465884 160650 83 Linux
  124. # mkfs.vfat -F 16 -n "boot" /dev/mmcblk0p1
  125. # mke2fs -j -L "root" /dev/mmcblk0p2
  126. The following assumes the SD card partition 1 and 2 are mounted at
  127. /media/boot and /media/root respectively. Removing the card and reinserting
  128. it will do just that on most modern Linux desktop environments.
  129. The files referenced below are made available after the build in
  130. build/tmp/deploy/images.
  131. 2. Install the boot loaders
  132. # cp MLO-beagleboard /media/boot/MLO
  133. # cp u-boot-beagleboard.bin /media/boot/u-boot.bin
  134. 3. Install the root filesystem
  135. # tar x -C /media/root -f core-image-$IMAGE_TYPE-beagleboard.tar.bz2
  136. # tar x -C /media/root -f modules-$KERNEL_VERSION-beagleboard.tgz
  137. 4. Install the kernel uImage
  138. # cp uImage-beagleboard.bin /media/boot/uImage
  139. 5. Prepare a u-boot script to simplify the boot process
  140. The Beagleboard can be made to boot at this point from the u-boot command
  141. shell. To automate this process, generate a user.scr script as follows.
  142. Install uboot-mkimage (from uboot-mkimage on Ubuntu or uboot-tools on Fedora).
  143. Prepare a script config:
  144. # (cat << EOF
  145. setenv bootcmd 'mmc init; fatload mmc 0:1 0x80300000 uImage; bootm 0x80300000'
  146. setenv bootargs 'console=tty0 console=ttyO2,115200n8 root=/dev/mmcblk0p2 rootwait rootfstype=ext3 ro'
  147. boot
  148. EOF
  149. ) > serial-boot.cmd
  150. # mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "Core Minimal" -d ./serial-boot.cmd ./boot.scr
  151. # cp boot.scr /media/boot
  152. 6. Unmount the SD partitions, insert the SD card into the Beagleboard, and
  153. boot the Beagleboard
  154. Note: As of the 2.6.37 linux-yocto kernel recipe, the Beagleboard uses the
  155. OMAP_SERIAL device (ttyO2). If you are using an older kernel, such as the
  156. 2.6.34 linux-yocto-stable, be sure to replace ttyO2 with ttyS2 above. You
  157. should also override the machine SERIAL_CONSOLE in your local.conf in
  158. order to setup the getty on the serial line:
  159. SERIAL_CONSOLE_beagleboard = "115200 ttyS2"
  160. Freescale MPC8315E-RDB (mpc8315e-rdb)
  161. =====================================
  162. The MPC8315 PowerPC reference platform (MPC8315E-RDB) is aimed at hardware and
  163. software development of network attached storage (NAS) and digital media server
  164. applications. The MPC8315E-RDB features the PowerQUICC II Pro processor, which
  165. includes a built-in security accelerator.
  166. (Note: you may find it easier to order MPC8315E-RDBA; this appears to be the
  167. same board in an enclosure with accessories. In any case it is fully
  168. compatible with the instructions given here.)
  169. Setup instructions
  170. ------------------
  171. You will need the following:
  172. * NFS root setup on your workstation
  173. * TFTP server installed on your workstation
  174. * Null modem cable connected from your workstation to the first serial port
  175. on the board
  176. * Ethernet connected to the first ethernet port on the board
  177. --- Preparation ---
  178. Note: if you have altered your board's ethernet MAC address(es) from the
  179. defaults, or you need to do so because you want multiple boards on the same
  180. network, then you will need to change the values in the dts file (patch
  181. linux/arch/powerpc/boot/dts/mpc8315erdb.dts within the kernel source). If
  182. you have left them at the factory default then you shouldn't need to do
  183. anything here.
  184. --- Booting from NFS root ---
  185. Load the kernel and dtb (device tree blob), and boot the system as follows:
  186. 1. Get the kernel (uImage-mpc8315e-rdb.bin) and dtb (uImage-mpc8315e-rdb.dtb)
  187. files from the Poky build tmp/deploy directory, and make them available on
  188. your TFTP server.
  189. 2. Connect the board's first serial port to your workstation and then start up
  190. your favourite serial terminal so that you will be able to interact with
  191. the serial console. If you don't have a favourite, picocom is suggested:
  192. $ picocom /dev/ttyUSB0 -b 115200
  193. 3. Power up or reset the board and press a key on the terminal when prompted
  194. to get to the U-Boot command line
  195. 4. Set up the environment in U-Boot:
  196. => setenv ipaddr <board ip>
  197. => setenv serverip <tftp server ip>
  198. => setenv bootargs root=/dev/nfs rw nfsroot=<nfsroot ip>:<rootfs path> ip=<board ip>:<server ip>:<gateway ip>:255.255.255.0:mpc8315e:eth0:off console=ttyS0,115200
  199. 5. Download the kernel and dtb, and boot:
  200. => tftp 800000 uImage-mpc8315e-rdb.bin
  201. => tftp 780000 uImage-mpc8315e-rdb.dtb
  202. => bootm 800000 - 780000
  203. Ubiquiti Networks RouterStation Pro (routerstationpro)
  204. ======================================================
  205. The RouterStation Pro is an Atheros AR7161 MIPS-based board. Geared towards
  206. networking applications, it has all of the usual features as well as three
  207. type IIIA mini-PCI slots and an on-board 3-port 10/100/1000 Ethernet switch,
  208. in addition to the 10/100/1000 Ethernet WAN port which supports
  209. Power-over-Ethernet.
  210. Setup instructions
  211. ------------------
  212. You will need the following:
  213. * A serial cable - female to female (or female to male + gender changer)
  214. NOTE: cable must be straight through, *not* a null modem cable.
  215. * USB flash drive or hard disk that is able to be powered from the
  216. board's USB port.
  217. * tftp server installed on your workstation
  218. NOTE: in the following instructions it is assumed that /dev/sdb corresponds
  219. to the USB disk when it is plugged into your workstation. If this is not the
  220. case in your setup then please be careful to substitute the correct device
  221. name in all commands where appropriate.
  222. --- Preparation ---
  223. 1) Build an image (e.g. core-image-minimal) using "routerstationpro" as the
  224. MACHINE
  225. 2) Partition the USB drive so that primary partition 1 is type Linux (83).
  226. Minimum size depends on your root image size - core-image-minimal probably
  227. only needs 8-16MB, other images will need more.
  228. # fdisk /dev/sdb
  229. Command (m for help): p
  230. Disk /dev/sdb: 4011 MB, 4011491328 bytes
  231. 124 heads, 62 sectors/track, 1019 cylinders, total 7834944 sectors
  232. Units = sectors of 1 * 512 = 512 bytes
  233. Sector size (logical/physical): 512 bytes / 512 bytes
  234. I/O size (minimum/optimal): 512 bytes / 512 bytes
  235. Disk identifier: 0x0009e87d
  236. Device Boot Start End Blocks Id System
  237. /dev/sdb1 62 1952751 976345 83 Linux
  238. 3) Format partition 1 on the USB as ext3
  239. # mke2fs -j /dev/sdb1
  240. 4) Mount partition 1 and then extract the contents of
  241. tmp/deploy/images/core-image-XXXX.tar.bz2 into it (preserving permissions).
  242. # mount /dev/sdb1 /media/sdb1
  243. # cd /media/sdb1
  244. # tar -xvjpf tmp/deploy/images/core-image-XXXX.tar.bz2
  245. 5) Unmount the USB drive and then plug it into the board's USB port
  246. 6) Connect the board's serial port to your workstation and then start up
  247. your favourite serial terminal so that you will be able to interact with
  248. the serial console. If you don't have a favourite, picocom is suggested:
  249. $ picocom /dev/ttyUSB0 -b 115200
  250. 7) Connect the network into eth0 (the one that is NOT the 3 port switch). If
  251. you are using power-over-ethernet then the board will power up at this point.
  252. 8) Start up the board, watch the serial console. Hit Ctrl+C to abort the
  253. autostart if the board is configured that way (it is by default). The
  254. bootloader's fconfig command can be used to disable autostart and configure
  255. the IP settings if you need to change them (default IP is 192.168.1.20).
  256. 9) Make the kernel (tmp/deploy/images/vmlinux-routerstationpro.bin) available
  257. on the tftp server.
  258. 10) If you are going to write the kernel to flash (optional - see "Booting a
  259. kernel directly" below for the alternative), remove the current kernel and
  260. rootfs flash partitions. You can list the partitions using the following
  261. bootloader command:
  262. RedBoot> fis list
  263. You can delete the existing kernel and rootfs with these commands:
  264. RedBoot> fis delete kernel
  265. RedBoot> fis delete rootfs
  266. --- Booting a kernel directly ---
  267. 1) Load the kernel using the following bootloader command:
  268. RedBoot> load -m tftp -h <ip of tftp server> vmlinux-routerstationpro.bin
  269. You should see a message on it being successfully loaded.
  270. 2) Execute the kernel:
  271. RedBoot> exec -c "console=ttyS0,115200 root=/dev/sda1 rw rootdelay=2 board=UBNT-RSPRO"
  272. Note that specifying the command line with -c is important as linux-yocto does
  273. not provide a default command line.
  274. --- Writing a kernel to flash ---
  275. 1) Go to your tftp server and gzip the kernel you want in flash. It should
  276. halve the size.
  277. 2) Load the kernel using the following bootloader command:
  278. RedBoot> load -r -b 0x80600000 -m tftp -h <ip of tftp server> vmlinux-routerstationpro.bin.gz
  279. This should output something similar to the following:
  280. Raw file loaded 0x80600000-0x8087c537, assumed entry at 0x80600000
  281. Calculate the length by subtracting the first number from the second number
  282. and then rounding the result up to the nearest 0x1000.
  283. 3) Using the length calculated above, create a flash partition for the kernel:
  284. RedBoot> fis create -b 0x80600000 -l 0x240000 kernel
  285. (change 0x240000 to your rounded length -- change "kernel" to whatever
  286. you want to name your kernel)
  287. --- Booting a kernel from flash ---
  288. To boot the flashed kernel perform the following steps.
  289. 1) At the bootloader prompt, load the kernel:
  290. RedBoot> fis load -d -e kernel
  291. (Change the name "kernel" above if you chose something different earlier)
  292. (-e means 'elf', -d 'decompress')
  293. 2) Execute the kernel using the exec command as above.
  294. --- Automating the boot process ---
  295. After writing the kernel to flash and testing the load and exec commands
  296. manually, you can automate the boot process with a boot script.
  297. 1) RedBoot> fconfig
  298. (Answer the questions not specified here as they pertain to your environment)
  299. 2) Run script at boot: true
  300. Boot script:
  301. .. fis load -d -e kernel
  302. .. exec
  303. Enter script, terminate with empty line
  304. >> fis load -d -e kernel
  305. >> exec -c "console=ttyS0,115200 root=/dev/sda1 rw rootdelay=2 board=UBNT-RSPRO"
  306. >>
  307. 3) Answer the remaining questions and write the changes to flash:
  308. Update RedBoot non-volatile configuration - continue (y/n)? y
  309. ... Erase from 0xbfff0000-0xc0000000: .
  310. ... Program from 0x87ff0000-0x88000000 at 0xbfff0000: .
  311. 4) Power cycle the board.