mirror of
https://github.com/AetherDroid/android_kernel_samsung_on5xelte.git
synced 2025-09-08 17:18:05 -04:00
Fixed MTP to work with TWRP
This commit is contained in:
commit
f6dfaef42e
50820 changed files with 20846062 additions and 0 deletions
45
arch/arm/mach-sti/Kconfig
Normal file
45
arch/arm/mach-sti/Kconfig
Normal file
|
@ -0,0 +1,45 @@
|
|||
menuconfig ARCH_STI
|
||||
bool "STMicroelectronics Consumer Electronics SOCs" if ARCH_MULTI_V7
|
||||
select ARM_GIC
|
||||
select ARM_GLOBAL_TIMER
|
||||
select PINCTRL
|
||||
select PINCTRL_ST
|
||||
select MFD_SYSCON
|
||||
select ARCH_HAS_RESET_CONTROLLER
|
||||
select HAVE_ARM_SCU if SMP
|
||||
select ARCH_REQUIRE_GPIOLIB
|
||||
select ARM_ERRATA_754322
|
||||
select ARM_ERRATA_764369 if SMP
|
||||
select ARM_ERRATA_775420
|
||||
select PL310_ERRATA_753970 if CACHE_L2X0
|
||||
select PL310_ERRATA_769419 if CACHE_L2X0
|
||||
help
|
||||
Include support for STiH41x SOCs like STiH415/416 using the device tree
|
||||
for discovery
|
||||
More information at Documentation/arm/STiH41x and
|
||||
at Documentation/devicetree
|
||||
|
||||
|
||||
if ARCH_STI
|
||||
|
||||
config SOC_STIH415
|
||||
bool "STiH415 STMicroelectronics Consumer Electronics family"
|
||||
default y
|
||||
select STIH415_RESET
|
||||
help
|
||||
This enables support for STMicroelectronics Digital Consumer
|
||||
Electronics family StiH415 parts, primarily targeted at set-top-box
|
||||
and other digital audio/video applications using Flattned Device
|
||||
Trees.
|
||||
|
||||
config SOC_STIH416
|
||||
bool "STiH416 STMicroelectronics Consumer Electronics family"
|
||||
default y
|
||||
select STIH416_RESET
|
||||
help
|
||||
This enables support for STMicroelectronics Digital Consumer
|
||||
Electronics family StiH416 parts, primarily targeted at set-top-box
|
||||
and other digital audio/video applications using Flattened Device
|
||||
Trees.
|
||||
|
||||
endif
|
2
arch/arm/mach-sti/Makefile
Normal file
2
arch/arm/mach-sti/Makefile
Normal file
|
@ -0,0 +1,2 @@
|
|||
obj-$(CONFIG_SMP) += platsmp.o headsmp.o
|
||||
obj-$(CONFIG_ARCH_STI) += board-dt.o
|
32
arch/arm/mach-sti/board-dt.c
Normal file
32
arch/arm/mach-sti/board-dt.c
Normal file
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* Copyright (C) 2013 STMicroelectronics (R&D) Limited.
|
||||
* Author(s): Srinivas Kandagatla <srinivas.kandagatla@st.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <linux/irq.h>
|
||||
#include <linux/of_platform.h>
|
||||
#include <asm/hardware/cache-l2x0.h>
|
||||
#include <asm/mach/arch.h>
|
||||
|
||||
#include "smp.h"
|
||||
|
||||
static const char *stih41x_dt_match[] __initdata = {
|
||||
"st,stih415",
|
||||
"st,stih416",
|
||||
"st,stih407",
|
||||
NULL
|
||||
};
|
||||
|
||||
DT_MACHINE_START(STM, "STiH415/416 SoC with Flattened Device Tree")
|
||||
.dt_compat = stih41x_dt_match,
|
||||
.l2c_aux_val = L2C_AUX_CTRL_SHARED_OVERRIDE |
|
||||
L310_AUX_CTRL_DATA_PREFETCH |
|
||||
L310_AUX_CTRL_INSTR_PREFETCH |
|
||||
L2C_AUX_CTRL_WAY_SIZE(4),
|
||||
.l2c_aux_mask = 0xc0000fff,
|
||||
.smp = smp_ops(sti_smp_ops),
|
||||
MACHINE_END
|
42
arch/arm/mach-sti/headsmp.S
Normal file
42
arch/arm/mach-sti/headsmp.S
Normal file
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* arch/arm/mach-sti/headsmp.S
|
||||
*
|
||||
* Copyright (C) 2013 STMicroelectronics (R&D) Limited.
|
||||
* http://www.st.com
|
||||
*
|
||||
* Cloned from linux/arch/arm/mach-vexpress/headsmp.S
|
||||
*
|
||||
* Copyright (c) 2003 ARM Limited
|
||||
* All Rights Reserved
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#include <linux/linkage.h>
|
||||
#include <linux/init.h>
|
||||
|
||||
/*
|
||||
* ST specific entry point for secondary CPUs. This provides
|
||||
* a "holding pen" into which all secondary cores are held until we're
|
||||
* ready for them to initialise.
|
||||
*/
|
||||
ENTRY(sti_secondary_startup)
|
||||
mrc p15, 0, r0, c0, c0, 5
|
||||
and r0, r0, #15
|
||||
adr r4, 1f
|
||||
ldmia r4, {r5, r6}
|
||||
sub r4, r4, r5
|
||||
add r6, r6, r4
|
||||
pen: ldr r7, [r6]
|
||||
cmp r7, r0
|
||||
bne pen
|
||||
|
||||
/*
|
||||
* we've been released from the holding pen: secondary_stack
|
||||
* should now contain the SVC stack for this core
|
||||
*/
|
||||
b secondary_startup
|
||||
|
||||
1: .long .
|
||||
.long pen_release
|
116
arch/arm/mach-sti/platsmp.c
Normal file
116
arch/arm/mach-sti/platsmp.c
Normal file
|
@ -0,0 +1,116 @@
|
|||
/*
|
||||
* arch/arm/mach-sti/platsmp.c
|
||||
*
|
||||
* Copyright (C) 2013 STMicroelectronics (R&D) Limited.
|
||||
* http://www.st.com
|
||||
*
|
||||
* Cloned from linux/arch/arm/mach-vexpress/platsmp.c
|
||||
*
|
||||
* Copyright (C) 2002 ARM Ltd.
|
||||
* All Rights Reserved
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#include <linux/init.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_address.h>
|
||||
|
||||
#include <asm/cacheflush.h>
|
||||
#include <asm/smp_plat.h>
|
||||
#include <asm/smp_scu.h>
|
||||
|
||||
#include "smp.h"
|
||||
|
||||
static void write_pen_release(int val)
|
||||
{
|
||||
pen_release = val;
|
||||
smp_wmb();
|
||||
sync_cache_w(&pen_release);
|
||||
}
|
||||
|
||||
static DEFINE_SPINLOCK(boot_lock);
|
||||
|
||||
static void sti_secondary_init(unsigned int cpu)
|
||||
{
|
||||
trace_hardirqs_off();
|
||||
|
||||
/*
|
||||
* let the primary processor know we're out of the
|
||||
* pen, then head off into the C entry point
|
||||
*/
|
||||
write_pen_release(-1);
|
||||
|
||||
/*
|
||||
* Synchronise with the boot thread.
|
||||
*/
|
||||
spin_lock(&boot_lock);
|
||||
spin_unlock(&boot_lock);
|
||||
}
|
||||
|
||||
static int sti_boot_secondary(unsigned int cpu, struct task_struct *idle)
|
||||
{
|
||||
unsigned long timeout;
|
||||
|
||||
/*
|
||||
* set synchronisation state between this boot processor
|
||||
* and the secondary one
|
||||
*/
|
||||
spin_lock(&boot_lock);
|
||||
|
||||
/*
|
||||
* The secondary processor is waiting to be released from
|
||||
* the holding pen - release it, then wait for it to flag
|
||||
* that it has been released by resetting pen_release.
|
||||
*
|
||||
* Note that "pen_release" is the hardware CPU ID, whereas
|
||||
* "cpu" is Linux's internal ID.
|
||||
*/
|
||||
write_pen_release(cpu_logical_map(cpu));
|
||||
|
||||
/*
|
||||
* Send the secondary CPU a soft interrupt, thereby causing
|
||||
* it to jump to the secondary entrypoint.
|
||||
*/
|
||||
arch_send_wakeup_ipi_mask(cpumask_of(cpu));
|
||||
|
||||
timeout = jiffies + (1 * HZ);
|
||||
while (time_before(jiffies, timeout)) {
|
||||
smp_rmb();
|
||||
if (pen_release == -1)
|
||||
break;
|
||||
|
||||
udelay(10);
|
||||
}
|
||||
|
||||
/*
|
||||
* now the secondary core is starting up let it run its
|
||||
* calibrations, then wait for it to finish
|
||||
*/
|
||||
spin_unlock(&boot_lock);
|
||||
|
||||
return pen_release != -1 ? -ENOSYS : 0;
|
||||
}
|
||||
|
||||
static void __init sti_smp_prepare_cpus(unsigned int max_cpus)
|
||||
{
|
||||
void __iomem *scu_base = NULL;
|
||||
struct device_node *np = of_find_compatible_node(
|
||||
NULL, NULL, "arm,cortex-a9-scu");
|
||||
if (np) {
|
||||
scu_base = of_iomap(np, 0);
|
||||
scu_enable(scu_base);
|
||||
of_node_put(np);
|
||||
}
|
||||
}
|
||||
|
||||
struct smp_operations __initdata sti_smp_ops = {
|
||||
.smp_prepare_cpus = sti_smp_prepare_cpus,
|
||||
.smp_secondary_init = sti_secondary_init,
|
||||
.smp_boot_secondary = sti_boot_secondary,
|
||||
};
|
17
arch/arm/mach-sti/smp.h
Normal file
17
arch/arm/mach-sti/smp.h
Normal file
|
@ -0,0 +1,17 @@
|
|||
/*
|
||||
* arch/arm/mach-sti/smp.h
|
||||
*
|
||||
* Copyright (C) 2013 STMicroelectronics (R&D) Limited.
|
||||
* http://www.st.com
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef __MACH_STI_SMP_H
|
||||
#define __MACH_STI_SMP_H
|
||||
|
||||
extern struct smp_operations sti_smp_ops;
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue