Annotation of wikisrc/ports/evbarm/odroid-c1.mdwn, revision 1.7

1.1       wiki        1: [[!meta title="NetBSD/evbarm on Hardkernel ODROID-C1"]]
                      2: 
                      3: [[!toc levels=2]]
                      4: 
1.2       wiki        5: # Supported hardware
1.6       wiki        6:  - CPU: Cortex-A5: Amlogic S805 (4-core) at 1.5GHz
1.2       wiki        7:    - CPU frequency scaling is supported with machdep.cpu sysctl tree
                      8:    - SMP supported
                      9:    - PL310 L2 cache controller
                     10:  - GIC
                     11:  - A5 watchdog timer
                     12:  - A5 global timer
                     13:  - SD/MMC controller (DMA)
                     14:  - Serial console
1.7     ! wiki       15:  - Framebuffer console
1.2       wiki       16:  - USB host (OTG)
                     17:  - Gigabit Ethernet (GMAC)
                     18:    - RTL8211F PHY
                     19:  - Hardware random number generator
                     20: 
                     21: # TODO
                     22:  - USB device mode
                     23:  - Simultaneous SD card and eMMC usage
                     24:  - SD/MMC UHS-I support (needs sdmmc(4) changes)
                     25:  - IR receiver
                     26:  - GPIO
                     27:  - I2C
1.7     ! wiki       28:  - Audio
1.2       wiki       29: 
                     30: # Installation
                     31: 
                     32: * Start with an ARMv7 image from *evbarm-earmv7hf/binary/gzimg/* such as *beagleboard.img*
                     33: * Build U-Boot for ODROID-C1 <https://github.com/hardkernel/u-boot/tree/odroidc-v2011.03>
1.3       wiki       34:   * Pre-built binaries here: <http://ftp.netbsd.org/pub/NetBSD/misc/jmcneill/odroidc1/u-boot-odroidc-v2011.03-20150308.tar.gz>
1.4       wiki       35: * Note the location and size of the FFS partition in the *beagleboard.img* disklabel:
                     36: [[!template  id=programlisting text="""
                     37: # $TOOLDIR/bin/nbdisklabel -M evbarm -B le beagleboard.img
                     38: ...
                     39: 8 partitions:
                     40: #        size    offset     fstype [fsize bsize cpg/sgs]
                     41:  a:   1359312    385024     4.2BSD      0     0     0  # (Cyl.    188 -    851*)
                     42:  b:    262144    122880       swap                     # (Cyl.     60 -    187)
                     43:  c:   1744336         0     unused      0     0        # (Cyl.      0 -    851*)
                     44:  d:   1744336         0     unused      0     0        # (Cyl.      0 -    851*)
                     45:  e:    114688      8192      MSDOS                     # (Cyl.      4 -     59)
                     46: """]]
1.2       wiki       47: * Write the bootloader to the empty space at the start of the base image:
                     48: [[!template  id=programlisting text="""
                     49: # dd if=bl1.bin.hardkernel of=beagleboard.img bs=1 count=442 conv=notrunc
                     50: # dd if=bl1.bin.hardkernel of=beagleboard.img bs=512 skip=1 seek=1 conv=notrunc
                     51: # dd if=u-boot.bin of=beagleboard.img bs=512 seek=64 conv=notrunc
                     52: """]]
1.4       wiki       53: * Since the bootloader has overwritten the disklabel, we need to re-add partition "a" from the disklabel to the MBR partition table:
                     54: [[!template  id=programlisting text="""
                     55: # $TOOLDIR/bin/armv7--netbsdelf-eabihf-fdisk -u beagleboard.img
                     56: ...
                     57: Which partition do you want to change?: [none] 1
                     58: The data for partition 1 is:
                     59: <UNUSED>
                     60: sysid: [0..255 default: 169] 
                     61: start: [0..109cyl default: 63, 0cyl, 0MB] 385024
                     62: size: [0..85cyl default: 1359312, 85cyl, 664MB] 1359312
                     63: ...
                     64: Which partition do you want to change?: [none] 
                     65: ...
                     66: Should we write new partition table? [n] y
                     67: """]]
1.2       wiki       68: * Write the image to an SD card.
                     69: * Copy the kernel (netbsd.ub) for your board to the root of the MS-DOS partition on the SD card.
                     70: * Create or edit boot.ini on the MS-DOS partition:
                     71: [[!template  id=programlisting text="""
                     72: ODROIDC-UBOOT-CONFIG
                     73: 
                     74: setenv m "1080p"
                     75: setenv vout_mode "hdmi"
                     76: setenv m_bpp "32"
                     77: setenv disableuhs "disableuhs"
1.4       wiki       78: setenv bootargs "root=ld0f awge0.mac-address=${ethaddr}"
1.2       wiki       79: setenv bootcmd "fatload mmc 0:1 0x21000000 netbsd.ub; bootm 0x21000000"
                     80: run bootcmd
                     81: """]]
1.5       wiki       82: * On first boot, it will stop because of the wrong device in /etc/fstab. Take this opportunity to grow the root file-system:
1.4       wiki       83: [[!template  id=programlisting text="""
                     84: # fdisk -u ld0
                     85: ...
                     86: Which partition do you want to change?: [none] 1
                     87: The data for partition 1 is:
                     88: NetBSD (sysid 169)
                     89:     start 385024, size 1359312 (664 MB, Cyls 23/246/32-108/147/55)
                     90:         PBR is not bootable: All bytes are identical (0x00)
                     91: sysid: [0..255 default: 169]
                     92: start: [0..966cyl default: 385024, 24cyl, 188MB]
                     93: size: [0..942cyl default: 1359312, 85cyl, 664MB] $
                     94: ...
                     95: Which partition do you want to change?: [none]
                     96: ...
                     97: Should we write new partition table? [n] y
                     98: # resize_ffs -y /dev/rld0f
                     99: # reboot
                    100: """]]
                    101: * Next boot, create a new /etc/fstab:
                    102: [[!template  id=programlisting text="""
                    103: # mount -u -o rw /dev/ld0f /
                    104: # cat > /etc/fstab << EOF
                    105: /dev/ld0f       /               ffs     rw      1 1
                    106: /dev/ld0e       /boot           msdos   rw      1 1
                    107: kernfs          /kern           kernfs  rw
                    108: ptyfs           /dev/pts        ptyfs   rw
                    109: procfs          /proc           procfs  rw
                    110: tmpfs           /var/shm        tmpfs   rw,-m1777,-sram%25
                    111: EOF
                    112: # reboot
                    113: """]]
1.2       wiki      114: 
1.1       wiki      115: # ODROID-C1 UART pins
                    116: 
                    117: From [ODROID Forum](http://forum.odroid.com/viewtopic.php?f=115&t=7684):
                    118: 
                    119: [[!template  id=programlisting text="""
                    120:  ___UART____
                    121: |Pin 4 - GND|
                    122: |Pin 3 - RXD|
                    123: |Pin 2 - TXD|
                    124: |Pin 1 - VCC|
                    125: \___________|
                    126: 
                    127: 3.3V LVTTL
                    128: """]]

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb