sun4i_defconfig: build disp, hdmi and lcd into the kernel

- The majority of end-users wants to use the framebuffer, and all other options are aimed at that (e.g. G2D, Cedar,
  framebuffer memory reservation are all enabled by default)
- Previous problems that required building these options as modules instead of into the kernel no longer exist
  (since this commit: https://github.com/linux-sunxi/linux-sunxi/commit/199825c44a742fa0abd274948c5f66535b614fb7 )
sunxi-disp: Fix page alignment issues with UMP buffers

UMP buffers must be page aligned, otherwise we get a problem:

[   80.520000] UMP: ERR: drivers/gpu/mali/ump/common/ump_kernel_ref_drv.c
[   80.530000]            ump_dd_handle_create_from_phys_blocks()  50
[   80.530000] Trying to create UMP memory with unaligned size. Size: 5760000
[   80.540000]
[   80.540000] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[   80.550000] pgd = ee09c000
[   80.560000] [00000000] *pgd=00000000
[   80.560000] Internal error: Oops: 5 [#1] PREEMPT ARM
[   80.560000] Modules linked in: disp_ump mali_drm drm mali ump 8192cu hdmi lcd disp cfbcopyarea cfbimgblt cfbfillrect
[   80.560000] CPU: 0    Not tainted  (3.4.24+ #30)
[   80.560000] PC is at ump_dd_secure_id_get+0xc/0x14 [ump]
[   80.560000] LR is at _disp_get_ump_secure_id+0x5c/0xec [disp_ump]
[   80.560000] pc : [<bf116c4c>]    lr : [<bf19905c>]    psr: 600f0013
[   80.560000] sp : ee4efd78  ip : ee4efd88  fp : ee4efd84
[   80.560000] r10: be8f9c4c  r9 : 00000000  r8 : bf03a4c4
[   80.560000] r7 : 00000001  r6 : bf03a4c4  r5 : 5a001000  r4 : eeb81000
[   80.560000] r3 : 00000000  r2 : 200f0093  r1 : 00000001  r0 : 00000000
[   80.560000] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[   80.560000] Control: 10c5387d  Table: 6e09c019  DAC: 00000015

The code, which tries to split the framebuffer into two parts of equal
sizes for GET_UMP_SECURE_ID_BUF1 and GET_UMP_SECURE_ID_BUF2, may break
this assumption for certain screen resolutions (800x600 is particularly
poorly divisible by 4096). The user visible symptoms look like the X
server gets stuck and fails to start.

This patch addresses the problem in the following way:
1. Make sure that fix.smem_len is page aligned (like many of the
   other framebuffer drivers do).
2. If the splitting of framebuffer into two parts would result in
   unaligned second part, just disable double buffering.
3. Avoid wrapping the physical memory beyond the framebuffer
   for GET_UMP_SECURE_ID_BUF2 in the case if double buffering
   is not used by setting the size of UMP buffer to 0.

The problem has been reported at:
  https://groups.google.com/d/msg/linux-sunxi/kZNl9bFdE-g/4k8z2_i4nJgJ

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Added support for Olinuxino A13_Micro

The Olinuxino A13_Micro needs a special config with a bunch of options
which cause memory to be reserved disabled, because it only has 256M

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi: move clocksource code to plat-sunxi

It is identical for sun4i and sun5i, so no merging was needed.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sun4i: Tweak cpufreq limits

cpu-freq has 2 sets of limits, 1 called cpuinfo which indicates what the
minimum / maximum is the cpu can be configured to run at, and the 2nd set
indicated between which limits the governor should automatically scale.

This patch uses this by:
1) Setting the cpuinfo max to 1.5 GHz, allowing overclocking without needing
to recompile the kernel
2) Setting the governer max to 1GHz, so no overclock is done unless the
user changes the governer max through sysfs
3) Raising the governer min from 60 MHz, which is unworkably slow, to
400 MHz, which is the last speed at which the cpu runs at its lowest
voltage of 1.0 volt.

3) Not only makes the interactive feel of the device a lot better, it
likely also *saves* power since it will cause the cpu to reach an idle
state quicker, which will allow it to power down entire blocks, thus stopping
the constant (non speed dependent) leakage current of those blocks sooner,
while using aprox. the same amount of power to do the work (it uses more
power due to the higher clock, but does the work proportionally faster,
resulting in aprox. the same power use). This is the so called race to idle
trick.

While at it also fix the formatting of sun4i_cpufreq_init().

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi-hdmi: Refactor EDID parsing

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi-hdmi: Add pixelclock override table to edid code

Unfortunately some monitors need pixelclocks which we cannot generate,
often we can workaround this by selecting a pixelclock which is near the
requested pixelclock. This patch adds a table with modes + overriding /
corrected pixelclock, and adds a first entry for the 1680x1050 mode of
Samsung 225bw monitors.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi: Merge/move core.c code from mach to plat

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi: Add sunxi_*_mem_reserve kernel cmdline options

This patch adds the following kernel commandline options:
sunxi_g2d_mem_reserve
sunxi_ve_mem_reserve
sunxi_fb_mem_reserve

These can be set to configure the amount of RAM to reserve for the named
sunxi drivers. This is useful for kernels for ready-to-use disk images, so
that an user can choose to use various binary only drivers to use the
hardware blocks in question, while not making the memory unavailable for
general use for users who choose not to use these drivers, without requiring
a kernel recompile.

IE I'm currently using the following since I don't use any binary drivers:
sunxi_g2d_mem_reserve=0 sunxi_ve_mem_reserve=0 sunxi_fb_mem_reserve=16777216

Giving me an additional 112 MB of extra memory.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>