CHROMIUM: i2c: tegra: avoid readsl/writesl

These are unimplemented on arm64

Change-Id: I05e7ee863ec8ab3bb10eeafd248308eabf1748bd
Signed-off-by: Allen Martin <amartin@nvidia.com>
Signed-off-by: David Riley <davidriley@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/206732
Reviewed-by: Olof Johansson <olofj@chromium.org>
CHROMIUM: arm64: Add dts for Tegra132 and norrin board

Change-Id: I18a3c9d9ece3f06904511a6db29ed918a9eb6532
Signed-off-by: Allen Martin <amartin@nvidia.com>
Signed-off-by: David Riley <davidriley@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/206733
Reviewed-by: Olof Johansson <olofj@chromium.org>
CHROMIUM: mfd: tps65090: Fix compile error.

The following two commits are incompatible and a result of the
3.14 rebase.  The former constifies a structure modified in the
latter patch.  This is fixed upstream (as part of a larger set
of changes that rely on some other changes) and this driver probably
won't be enabled in a product shipping on 3.14, so just make things
compile without backporting all the other changes.

The incompatible changes:
    mfd: ti: Constify struct mfd_cell where possible
    mfd: tps65090: Allow charger module to be used when no irq

BUG=None
TEST=compiles

Change-Id: Ib48cab0ab7df73bc4fae8a3f1059fa2c12f0d149
Signed-off-by: David Riley <davidriley@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/206737
Reviewed-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
CHROMIUM: chromeos: adds arm64 arch to kernelconfig script

BUG=none
TEST=kernelconfig oldconfig

Change-Id: I8ed2027542eec2ba63545f1a40a4acc040725794
Signed-off-by: David Riley <davidriley@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/206739
Reviewed-by: Olof Johansson <olofj@chromium.org>
CHROMIUM: generate initial arm64 splitconfig

Note that this the following options have been removed from base.config
due to not being supported by arm64:
	CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE
	CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT
	CONFIG_CC_STACKPROTECTOR
	CONFIG_CC_STACKPROTECTOR_STRONG
	CONFIG_DYNAMIC_FTRACE
	CONFIG_FTRACE_MCOUNT_RECORD
	CONFIG_FUNCTION_TRACER
	CONFIG_HAS_IOPORT
	CONFIG_HAVE_CC_STACKPROTECTOR
	CONFIG_HAVE_KERNEL_GZIP
	CONFIG_HAVE_KERNEL_LZ4
	CONFIG_HAVE_KERNEL_LZMA
	CONFIG_HAVE_KERNEL_LZO
	CONFIG_HAVE_KERNEL_XZ
	CONFIG_HAVE_KPROBES
	CONFIG_HAVE_KRETPROBES
	CONFIG_HAVE_OPROFILE
	CONFIG_IRQ_FORCED_THREADING
	CONFIG_KERNEL_GZIP
	CONFIG_SECCOMP

BUG=none
TEST=none

Change-Id: I2bf7f5de9ad9563707108453a215904cbe22e80b
Signed-off-by: David Riley <davidriley@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/206738
Reviewed-by: Olof Johansson <olofj@chromium.org>
FROMLIST: lib/genalloc.c: Add power aligned algorithm

One of the more common algorithms used for allocation
is to align the start address of the allocation to
the order of size requested. Add this as an algorithm
option for genalloc.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
(am from https://patchwork.kernel.org/patch/4467501/)
Signed-off-by: David Riley <davidriley@chromium.org>

Change-Id: Ibfc42a8f81e9ae81cc3aa9ebc82ab6d15dd66a58
Reviewed-on: https://chromium-review.googlesource.com/206743
Tested-by: David Riley <davidriley@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Queue: David Riley <davidriley@chromium.org>
FROMLIST: lib/genalloc.c: Add genpool range check function

After allocating an address from a particular genpool,
there is no good way to verify if that address actually
belongs to a genpool. Introduce addr_in_gen_pool which
will return if an address plus size falls completely
within the genpool range.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
(am from https://patchwork.kernel.org/patch/4467541/)
Signed-off-by: David Riley <davidriley@chromium.org>

Change-Id: Ia1eb6a642930ce5da89105f1493c5fb5e6a0c8be
Reviewed-on: https://chromium-review.googlesource.com/206744
Tested-by: David Riley <davidriley@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
FROMLIST: common: dma-mapping: Introduce common remapping functions

For architectures without coherent DMA, memory for DMA may
need to be remapped with coherent attributes. Factor out
the the remapping code from arm and put it in a
common location to reduced code duplication.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
(am from https://patchwork.kernel.org/patch/4467531/)
Signed-off-by: David Riley <davidriley@chromium.org>

Change-Id: Iba9d338f16708142de28ff271356396c6a648c6a
Reviewed-on: https://chromium-review.googlesource.com/206745
Tested-by: David Riley <davidriley@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
FROMLIST: arm: use genalloc for the atomic pool

ARM currently uses a bitmap for tracking atomic allocations.
genalloc already handles this type of memory pool allocation
so switch to using that instead.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
(am from https://patchwork.kernel.org/patch/4467511/)
Signed-off-by: David Riley <davidriley@chromium.org>

Change-Id: I3dabf324df90dc3245251ad20400fef515e752b6
Reviewed-on: https://chromium-review.googlesource.com/206746
Tested-by: David Riley <davidriley@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
FROMLIST: arm64: Add atomic pool for non-coherent and CMA allocations.

Neither CMA nor noncoherent allocations support atomic allocations.
Add a dedicated atomic pool to support this.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
(am from https://patchwork.kernel.org/patch/4467521/)
Signed-off-by: David Riley <davidriley@chromium.org>

Change-Id: I1dc24b82ad0ae9c81b8f6eecbe7295977db13cd2
Reviewed-on: https://chromium-review.googlesource.com/206747
Tested-by: David Riley <davidriley@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
CHROMIUM: config: re-normalize split configs

Run 'kernelconfig oldconfig'

BUG=None
TEST=None

Change-Id: Id231a41ca9d97906b593ee351d17fac4f63d6174
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/207340
Reviewed-by: David Riley <davidriley@chromium.org>
CHROMIUM: mmc: tegra: add support for Tegra132

Add a new DT compatible value for Tegra132 which currently
does not support ADMA.

BUG=none
TEST=mount mmc partition and read files

Change-Id: Ic4241379b333526046c39b1e81f2cacd5d6ec478
Signed-off-by: David Riley <davidriley@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/207420
Reviewed-by: Olof Johansson <olofj@chromium.org>
CHROMIUM: i2c: tegra: Fix readsl/writesl removal

Change-Id: Ife596cfacb5908b09636523e45726e9e0c0f7adb
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/207425
Reviewed-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Rhyland Klein <rklein@nvidia.com>
Tested-by: Rhyland Klein <rklein@nvidia.com>
CHROMIUM: dark resume: fix memory leak

This fixes the sysfs files getting leaked for non-source dark resume devices

BUG=chrome-os-partner:28391
TEST=On squawks
Enable kernel configs:
CONFIG_HAVE_DEBUG_KMEMLEAK=y
CONFIG_DEBUG_KMEMLEAK=y
CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE=4000
Boot system
Plug and unplug usb drive several times
echo scan > /sys/kernel/debug/kmemleak
cat /sys/kernel/debug/kmemleak
See that there's nothing from the usb stack leaking

Change-Id: Id005084b1d4daa79541a12e650af52781b0dcaac
Signed-off-by: Derek Basehore <dbasehore@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/207202
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/207400
CHROMIUM: drivers: amba: tegra-ahb: load the Tegra AHB "gizmo" driver

EHCI works better with this enabled.

Change-Id: I7e54abd3d80f5de5ca29a4f369172d8bcd28028b
Signed-off-by: David Riley <davidriley@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/206856
Reviewed-by: Olof Johansson <olofj@chromium.org>
CHROMIUM: add AHB driver to arm64 config

BUG=none
TEST=kernelconfig oldconfig

Change-Id: I4a14533fc5b9b39be9cb7fa0706f8841798a8a1b
Signed-off-by: David Riley <davidriley@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/206857
Reviewed-by: Olof Johansson <olofj@chromium.org>
HACK: chromiumos-arm64: force enable USB sticks and networking

- force booting from USB stick (fastboot was hardcoded to a different
  partition and could not be overridden with command line options)
- enable USB ethernet drivers in kernel instead of modules

Change-Id: Ib46b95dd2066f30a615fd54ddff4d6f022060b72
Signed-off-by: David Riley <davidriley@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/206742
Reviewed-by: Olof Johansson <olofj@chromium.org>
HACK: remove calls to tegra_read_chipid()

Need to find a different way to flush APB bus or a new home for this
code.

Change-Id: I20979cb522e99dfa2ac4e9f66bfb9796c69efb85
Signed-off-by: Olof Johansson <olofj@chromium.org>
Signed-off-by: David Riley <davidriley@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/206748
HACK: reference pll_p so it doesn't get disabled

This is a hack to increase the reference count on pll_p so it won't
get disabled.  On T132 the CPU clock is derived from pll_p.

Change-Id: Ia52bf4dd7a34896598555af92f29a214e1664c56
Signed-off-by: Allen Martin <amartin@nvidia.com>
Signed-off-by: David Riley <davidriley@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/206750
Reviewed-by: Olof Johansson <olofj@chromium.org>
CHROMIUM: config: Change the kernel memory split to 3G/1G

BUG=chrome-os-partner:29134
TEST=System boots/HDMI works/LP0 works/WebGL aquarium works/
     Kernel va starts from 0xc0000000

Change-Id: I707290f3cb1e90af114bc9a080cece6ace6bd588
Signed-off-by: Mark Zhang <markz@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/205933
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Doug Anderson <dianders@chromium.org>
(cherry picked from commit d970882fde2029a3de3021d8581bac00eb7c2eec)
Reviewed-on: https://chromium-review.googlesource.com/207414
Reviewed-by: David Riley <davidriley@chromium.org>