#-----------------------------------------------------------------------------
#@TYPE: Machine
#@NAME: OM GTA01 (Neo1973)
#@DESCRIPTION: Machine configuration for the OM Neo1973 GSM phone
#-----------------------------------------------------------------------------

TARGET_ARCH = "arm"

PREFERRED_PROVIDER_virtual/kernel ?= "linux-openmoko-2.6.24"
PREFERRED_PROVIDER_virtual/xserver = "xserver-xorg"

# If you want to have KMS enabled in default kernel, uncomment linux-openmoko-shr-drm-devel
PREFERRED_PROVIDER_virtual/kernel_shr = "linux-openmoko-shr-devel"
#PREFERRED_PROVIDER_virtual/kernel_shr = "linux-openmoko-shr-drm-devel"
#PREFERRED_PROVIDER_virtual/kernel_shr = "linux-openmoko-2.6.31"
#PREFERRED_PROVIDER_virtual/kernel_shr = "linux-openmoko-2.6.32"

PREFERRED_PROVIDER_virtual/libgl_shr = "mesa-dri"

UBOOT_ENTRYPOINT = "30008000"

OLDEST_KERNEL_linux-gnueabi = "2.6.24"

MACHINE_FEATURES = "kernel26 apm alsa bluetooth gps usbgadget usbhost phone wifi vfat ext2"
MACHINE_DISPLAY_WIDTH_PIXELS = "480"
MACHINE_DISPLAY_HEIGHT_PIXELS = "640"
MACHINE_DISPLAY_ORIENTATION = "0"
MACHINE_DISPLAY_PPI = "285"
XSERVER ?= "xserver-xorg \
           xf86-input-tslib \
           xf86-input-evdev \
           xf86-video-fbdev \
           xf86-input-keyboard \
           xf86-input-mouse"

# fbreader specific
READER_RESOLUTION = "480x640"
READER_ARCH       = "desktop"
READER_UI         = "gtk"

# package machine specific modules
MACHINE_EXTRA_RRECOMMENDS = "\
  kernel-module-gta01-pm-bt  \
  kernel-module-gta01-pm-gps \
  kernel-module-gta01-pm-gsm \
  kernel-module-gta01kbd \
  kernel-module-s3cmci \
  kernel-module-snd-soc-neo1973-wm8753 \
  kernel-module-g-ether \
"

# do not outcomment, we bypass the sysvinit.bb logic here -- see FIC GTA01 inittab
#SERIAL_CONSOLE = "115200 ttySAC0"

# used by some images
ROOT_FLASH_SIZE = "60"

IMAGE_FSTYPES += "tar.gz jffs2 ubi"

# extra jffs2 tweaks
EXTRA_IMAGECMD_jffs2 = "--little-endian --eraseblock=0x4000 --pad -n"

# do ubiattach /dev/ubi_ctrl -m 4
# From dmesg:
# UBI: smallest flash I/O unit:    512
# UBI: logical eraseblock size:    15360 bytes
# from ubiattach stdout:
# UBI device number 0, total 3907  LEBs
MKUBIFS_ARGS = "-m 512 -e 15360 -c 2376"

# do ubiattach /dev/ubi_ctrl -m 4
# from dmesg:
# UBI: smallest flash I/O unit:    512
# UBI: physical eraseblock size:   16384 bytes (16 KiB)
# UBI: sub-page size:              512
UBINIZE_ARGS = "-m 512 -p 16KiB -s 512 -O 512"

# build / upload tools
EXTRA_IMAGEDEPENDS += "dfu-util-native"

module_autoload_snd-soc-neo1973-wm8753 = "snd-soc-neo1973-wm8753"

# tune for S3C24x0
include conf/machine/include/tune-arm920t.inc