MIPS: JZ4770: Fixed address of DMA stride address register

The JZ4755 had the stride address registers in a different place,
my guess is that the formula was only half updated for the JZ4760.

None of the drivers that we're using accesses this register, so this
correction doesn't fix any bugs.
MIPS: JZ4770: Rename DMAC_DMACK to DMAC_DMACKE

This is the DMA clock enable register.

Note that the __dmac_channel_enable_clk macro already used DMAC_DMACKE
as the register name, which failed when the macro was applied.
MIPS: JZ4770: Removed __dmac_channel_enable_clk macro

The clock is already enabled in jz_request_dma(), there is no need to
do that again. Also, I have some doubt that writing the main register
directly (rather than using the set/reset registers) will work.
MIPS: JZ4770: platform: Eliminate use of JZ_MSC_ID_INVALID macro

It is more direct to check whether "id" is a valid index to the
jz_msc_devices array.

Also, the macro was incorrect: it would consider index 3 to be valid,
while it is not.
MIPS: JZ4770: pm: Don't preserve MSC LPM register on sleep

The MSC driver already re-inits the LPM register if needed.
MIPS: JZ4770: Stripped register definitions from jz4770msc.h

Only the MSC driver is supposed to touch the registers, so it makes
more sense to keep the definitions in a header that is private to the
driver.

What remains in the global header is the platform data.
mmc: JZ4770: Update driver after stripping register definitions from jz4770msc.h

The driver does need the register definitions, so added them to a
driver specific header.
MIPS: JZ4770: Round requested clock rates down

If an exact match is not possible, a lower clock rate is more likely to
be useful than a higher clock rate, so round the rate down.
mmc: JZ4770: Cleanup of headers

Declare structs instead of including header that defines it.
Moved macro that is only used in jz_mmc_msc.c into that source file.
mmc: JZ4770: Removed function pointers that pointed to a fixed function

Instead, just call the function directly. This makes it easier to
figure out the control flow. It also eliminates unnecessary init code.

The jz_mmc_controller.c source did very little except initializing
those function pointers. Therefore, I merged the remaining code into
jz_mmc_main.c and eliminated jz_mmc_controller.c.
MIPS: JZ4770: Removed driver_data field from MSC platform data

This used to contain a pointer to a struct of function pointers, but
those were recently removed from the driver.
mmc: JZ4770: Remove unnecessary BUG_ON check

It is not a problem if an SG entry doesn't have a virtual mapping,
since all we need from it is the DMA (physical) address. Removing the
check fixes the driver when the physical address is in highmem.
MIPS: bugfix of HIGHMEM cache aliasing

It fixes a missed cache flush in flush_kernel_dcache_page().

Change-Id: Ib08a07cef046a4ee48d98a949e7a0ccfd7571991
Author: Leonid Yegoshin <yegoshin@mips.com>
Signed-off-by: Leonid Yegoshin <yegoshin@mips.com>
Signed-off-by: Steven J. Hill <sjhill@mips.com>
(cherry picked from commit 8b6f0972012d02c68b9cafab354c763bc08fe5b9)
MIPS: Revert JZ4770 changes to cacheflush.h

This allows other patches to be applied cleanly.
MIPS 74K cache aliasing bug fix

Modified by Maarten ter Huurne <maarten@treewalker.org>:

The flush_kernel_* functions in asm/cacheflush.h already exist in our
tree, so I dropped their addition from this patch.

Also squashed a later optimization patch from the same author into
this one, since it touched some of the same lines. Original title:
I-cache optimisation fix for binary code read via non-DMA from a device.
MIPS: Implemented cache flushing for kernel pages

Taken from Ingenic Android kernel source tree, slightly cleaned up
by me.
mm: highmem: Avoid compiler warning

I can't find an official statement about the type of virt_to_page's
argument, but the asm-generic version typecasts the argument to
unsigned long, so I'm assuming that it's supposed to be a pointer.
MIPS: JZ4770: Mark system as supporting highmem
MIPS: JZ4770: GCW0: Update defconfig for highmem