File:  [NetBSD Developer Wiki] / wikisrc / ports / evbarm / odroid-c1.mdwn
Revision 1.9: download - view: text, annotated - select for diffs
Sun Mar 22 16:31:34 2015 UTC (6 years, 3 months ago) by wiki
Branches: MAIN
CVS tags: HEAD
web commit by jmcneill: Add video mode section

    1: [[!meta title="NetBSD/evbarm on Hardkernel ODROID-C1"]]
    2: 
    3: [[!toc levels=2]]
    4: 
    5: # Supported hardware
    6:  - CPU: Cortex-A5: Amlogic S805 (4-core) at 1.5GHz
    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
   15:  - Framebuffer console
   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
   28:  - Audio
   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>
   34:   * Pre-built binaries here: <http://ftp.netbsd.org/pub/NetBSD/misc/jmcneill/odroidc1/u-boot-odroidc-v2011.03-20150308.tar.gz>
   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: """]]
   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: """]]
   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: """]]
   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 bootargs "root=ld0f awge0.mac-address=${ethaddr}"
   75: setenv bootcmd "fatload mmc 0:1 0x21000000 netbsd.ub; bootm 0x21000000"
   76: run bootcmd
   77: """]]
   78: * On first boot, it will stop because of the wrong device in /etc/fstab. Take this opportunity to grow the root file-system:
   79: [[!template  id=programlisting text="""
   80: # fdisk -u ld0
   81: ...
   82: Which partition do you want to change?: [none] 1
   83: The data for partition 1 is:
   84: NetBSD (sysid 169)
   85:     start 385024, size 1359312 (664 MB, Cyls 23/246/32-108/147/55)
   86:         PBR is not bootable: All bytes are identical (0x00)
   87: sysid: [0..255 default: 169]
   88: start: [0..966cyl default: 385024, 24cyl, 188MB]
   89: size: [0..942cyl default: 1359312, 85cyl, 664MB] $
   90: ...
   91: Which partition do you want to change?: [none]
   92: ...
   93: Should we write new partition table? [n] y
   94: # resize_ffs -y /dev/rld0f
   95: # reboot
   96: """]]
   97: * Next boot, create a new /etc/fstab:
   98: [[!template  id=programlisting text="""
   99: # mount -u -o rw /dev/ld0f /
  100: # cat > /etc/fstab << EOF
  101: /dev/ld0f       /               ffs     rw      1 1
  102: /dev/ld0e       /boot           msdos   rw      1 1
  103: kernfs          /kern           kernfs  rw
  104: ptyfs           /dev/pts        ptyfs   rw
  105: procfs          /proc           procfs  rw
  106: tmpfs           /var/shm        tmpfs   rw,-m1777,-sram%25
  107: EOF
  108: # reboot
  109: """]]
  110: 
  111: # HDMI
  112: 
  113: ## Video mode
  114: 
  115: HDMI video mode can be selected in U-Boot with the *video* command, e.g.:
  116: 
  117: [[!template  id=programlisting text="""
  118: odroidc#video dev open 1080P
  119: """]]
  120: 
  121: To make this change permanent, add it to the *bootcmd* variable in *boot.ini*:
  122: 
  123: [[!template  id=programlisting text="""
  124: setenv bootcmd "video dev open 1080P; fatload mmc 0:1 0x21000000 netbsd.ub; bootm 0x21000000"
  125: """]]
  126: 
  127: ## Overscan compensation
  128: 
  129: If you have ODROID-C1 plugged into a TV, the edges of the screen may not be visible. You can scale down the framebuffer console with the **hw.genfb0.scale** sysctl, e.g.:
  130: 
  131: [[!template  id=programlisting text="""
  132: # sysctl -w hw.genfb0.scale=95
  133: """]]
  134: 
  135: Setting *scale* to 100 disables scaling, any other value enables the scaler. Values between 10 and 100 are allowed.
  136: 
  137: To set this value at boot, you can add **fb.scale=95** to the kernel cmdline options in *boot.ini*.
  138: 
  139: # ODROID-C1 UART pins
  140: 
  141: From [ODROID Forum](http://forum.odroid.com/viewtopic.php?f=115&t=7684):
  142: 
  143: [[!template  id=programlisting text="""
  144:  ___UART____
  145: |Pin 4 - GND|
  146: |Pin 3 - RXD|
  147: |Pin 2 - TXD|
  148: |Pin 1 - VCC|
  149: \___________|
  150: 
  151: 3.3V LVTTL
  152: """]]

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