Skip to content

Commit

Permalink
Merge branch '3.10-fixes' into mips-for-linux-next
Browse files Browse the repository at this point in the history
This that should have been fixed but weren't, way to much, intrusive
and late.
  • Loading branch information
ralfbaechle committed Jul 12, 2013
2 parents 704e646 + 3f90b82 commit 6ac5310
Show file tree
Hide file tree
Showing 45 changed files with 507 additions and 364 deletions.
1 change: 0 additions & 1 deletion arch/mips/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,6 @@ config POWERTV
select CSRC_POWERTV
select DMA_NONCOHERENT
select HW_HAS_PCI
select SYS_HAS_EARLY_PRINTK
select SYS_HAS_CPU_MIPS32_R2
select SYS_SUPPORTS_32BIT_KERNEL
select SYS_SUPPORTS_BIG_ENDIAN
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/ath79/mach-ap136.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ static void __init ap136_pci_init(u8 *eeprom)
ath79_register_pci();
}
#else
static inline void ap136_pci_init(void) {}
static inline void ap136_pci_init(u8 *eeprom) {}
#endif /* CONFIG_PCI */

static void __init ap136_setup(void)
Expand Down
5 changes: 0 additions & 5 deletions arch/mips/bcm63xx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,9 @@ config BCM63XX_CPU_6328
config BCM63XX_CPU_6338
bool "support 6338 CPU"
select HW_HAS_PCI
select USB_ARCH_HAS_OHCI
select USB_OHCI_BIG_ENDIAN_DESC
select USB_OHCI_BIG_ENDIAN_MMIO

config BCM63XX_CPU_6345
bool "support 6345 CPU"
select USB_OHCI_BIG_ENDIAN_DESC
select USB_OHCI_BIG_ENDIAN_MMIO

config BCM63XX_CPU_6348
bool "support 6348 CPU"
Expand Down
3 changes: 2 additions & 1 deletion arch/mips/cavium-octeon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ CFLAGS_octeon-platform.o = -I$(src)/../../../scripts/dtc/libfdt
CFLAGS_setup.o = -I$(src)/../../../scripts/dtc/libfdt

obj-y := cpu.o setup.o octeon-platform.o octeon-irq.o csrc-octeon.o
obj-y += dma-octeon.o flash_setup.o
obj-y += dma-octeon.o
obj-y += octeon-memcpy.o
obj-y += executive/

obj-$(CONFIG_MTD) += flash_setup.o
obj-$(CONFIG_SMP) += smp.o
obj-$(CONFIG_OCTEON_ILM) += oct_ilm.o

Expand Down
5 changes: 3 additions & 2 deletions arch/mips/cavium-octeon/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Copyright (C) 2008, 2009 Wind River Systems
* written by Ralf Baechle <[email protected]>
*/
#include <linux/compiler.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/console.h>
Expand Down Expand Up @@ -694,7 +695,7 @@ void __init prom_init(void)
if (cvmx_read_csr(CVMX_L2D_FUS3) & (3ull << 34)) {
pr_info("Skipping L2 locking due to reduced L2 cache size\n");
} else {
uint32_t ebase = read_c0_ebase() & 0x3ffff000;
uint32_t __maybe_unused ebase = read_c0_ebase() & 0x3ffff000;
#ifdef CONFIG_CAVIUM_OCTEON_LOCK_L2_TLB
/* TLB refill */
cvmx_l2c_lock_mem_region(ebase, 0x100);
Expand Down Expand Up @@ -978,7 +979,7 @@ void __init plat_mem_setup(void)
cvmx_bootmem_unlock();
/* Add the memory region for the kernel. */
kernel_start = (unsigned long) _text;
kernel_size = ALIGN(_end - _text, 0x100000);
kernel_size = _end - _text;

/* Adjust for physical offset. */
kernel_start &= ~0xffffffff80000000ULL;
Expand Down
4 changes: 2 additions & 2 deletions arch/mips/fw/cfe/cfe_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,12 +406,12 @@ int cfe_setenv(char *name, char *val)
return xiocb.xiocb_status;
}

int cfe_write(int handle, unsigned char *buffer, int length)
int cfe_write(int handle, const char *buffer, int length)
{
return cfe_writeblk(handle, 0, buffer, length);
}

int cfe_writeblk(int handle, s64 offset, unsigned char *buffer, int length)
int cfe_writeblk(int handle, s64 offset, const char *buffer, int length)
{
struct cfe_xiocb xiocb;

Expand Down
4 changes: 2 additions & 2 deletions arch/mips/include/asm/fw/cfe/cfe_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ int cfe_read(int handle, unsigned char *buffer, int length);
int cfe_readblk(int handle, int64_t offset, unsigned char *buffer,
int length);
int cfe_setenv(char *name, char *val);
int cfe_write(int handle, unsigned char *buffer, int length);
int cfe_writeblk(int handle, int64_t offset, unsigned char *buffer,
int cfe_write(int handle, const char *buffer, int length);
int cfe_writeblk(int handle, int64_t offset, const char *buffer,
int length);

#endif /* CFE_API_H */
7 changes: 7 additions & 0 deletions arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#ifndef __ASM_MACH_CAVIUM_OCTEON_DMA_COHERENCE_H
#define __ASM_MACH_CAVIUM_OCTEON_DMA_COHERENCE_H

#include <linux/bug.h>

struct device;

extern void octeon_pci_dma_init(void);
Expand All @@ -21,18 +23,21 @@ static inline dma_addr_t plat_map_dma_mem(struct device *dev, void *addr,
size_t size)
{
BUG();
return 0;
}

static inline dma_addr_t plat_map_dma_mem_page(struct device *dev,
struct page *page)
{
BUG();
return 0;
}

static inline unsigned long plat_dma_addr_to_phys(struct device *dev,
dma_addr_t dma_addr)
{
BUG();
return 0;
}

static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr,
Expand All @@ -44,6 +49,7 @@ static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr,
static inline int plat_dma_supported(struct device *dev, u64 mask)
{
BUG();
return 0;
}

static inline void plat_extra_sync_for_device(struct device *dev)
Expand All @@ -60,6 +66,7 @@ static inline int plat_dma_mapping_error(struct device *dev,
dma_addr_t dma_addr)
{
BUG();
return 0;
}

dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr);
Expand Down
24 changes: 24 additions & 0 deletions arch/mips/include/asm/mach-cavium-octeon/spaces.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 2012 Cavium, Inc.
*/
#ifndef _ASM_MACH_CAVIUM_OCTEON_SPACES_H
#define _ASM_MACH_CAVIUM_OCTEON_SPACES_H

#include <linux/const.h>

#ifdef CONFIG_64BIT
/* They are all the same and some OCTEON II cores cannot handle 0xa8.. */
#define CAC_BASE _AC(0x8000000000000000, UL)
#define UNCAC_BASE _AC(0x8000000000000000, UL)
#define IO_BASE _AC(0x8000000000000000, UL)


#endif /* CONFIG_64BIT */

#include <asm/mach-generic/spaces.h>

#endif /* _ASM_MACH_CAVIUM_OCTEON_SPACES_H */
47 changes: 47 additions & 0 deletions arch/mips/include/asm/mach-ip27/kernel-entry-init.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,53 @@
dsrl \res, NSRI_NODEID_SHFT
.endm

/*
* TLB bits
*/
#define PAGE_GLOBAL (1 << 6)
#define PAGE_VALID (1 << 7)
#define PAGE_DIRTY (1 << 8)
#define CACHE_CACHABLE_COW (5 << 9)

/*
* inputs are the text nasid in t1, data nasid in t2.
*/
.macro MAPPED_KERNEL_SETUP_TLB
#ifdef CONFIG_MAPPED_KERNEL
/*
* This needs to read the nasid - assume 0 for now.
* Drop in 0xffffffffc0000000 in tlbhi, 0+VG in tlblo_0,
* 0+DVG in tlblo_1.
*/
dli t0, 0xffffffffc0000000
dmtc0 t0, CP0_ENTRYHI
li t0, 0x1c000 # Offset of text into node memory
dsll t1, NASID_SHFT # Shift text nasid into place
dsll t2, NASID_SHFT # Same for data nasid
or t1, t1, t0 # Physical load address of kernel text
or t2, t2, t0 # Physical load address of kernel data
dsrl t1, 12 # 4K pfn
dsrl t2, 12 # 4K pfn
dsll t1, 6 # Get pfn into place
dsll t2, 6 # Get pfn into place
li t0, ((PAGE_GLOBAL | PAGE_VALID | CACHE_CACHABLE_COW) >> 6)
or t0, t0, t1
mtc0 t0, CP0_ENTRYLO0 # physaddr, VG, cach exlwr
li t0, ((PAGE_GLOBAL | PAGE_VALID | PAGE_DIRTY | CACHE_CACHABLE_COW) >> 6)
or t0, t0, t2
mtc0 t0, CP0_ENTRYLO1 # physaddr, DVG, cach exlwr
li t0, 0x1ffe000 # MAPPED_KERN_TLBMASK, TLBPGMASK_16M
mtc0 t0, CP0_PAGEMASK
li t0, 0 # KMAP_INX
mtc0 t0, CP0_INDEX
li t0, 1
mtc0 t0, CP0_WIRED
tlbwi
#else
mtc0 zero, CP0_WIRED
#endif
.endm

/*
* Intentionally empty macro, used in head.S. Override in
* arch/mips/mach-xxx/kernel-entry-init.h when necessary.
Expand Down
6 changes: 0 additions & 6 deletions arch/mips/include/asm/mips-boards/generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@
#define ASCII_DISPLAY_WORD_BASE 0x1f000410
#define ASCII_DISPLAY_POS_BASE 0x1f000418

/*
* Reset register.
*/
#define SOFTRES_REG 0x1f000500
#define GORESET 0x42

/*
* Revision register.
*/
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/include/asm/mmu_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ get_new_mmu_context(struct mm_struct *mm, unsigned long cpu)
if (! ((asid += ASID_INC) & ASID_MASK) ) {
if (cpu_has_vtag_icache)
flush_icache_all();
#ifdef CONFIG_VIRTUALIZATION
#ifdef CONFIG_KVM
kvm_local_flush_tlb_all(); /* start new asid cycle */
#else
local_flush_tlb_all(); /* start new asid cycle */
Expand Down
9 changes: 9 additions & 0 deletions arch/mips/include/asm/xtalk/xtalk.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ typedef struct xtalk_piomap_s *xtalk_piomap_t;
#define XIO_PORT(x) ((xwidgetnum_t)(((x)&XIO_PORT_BITS) >> XIO_PORT_SHIFT))
#define XIO_PACK(p, o) ((((uint64_t)(p))<<XIO_PORT_SHIFT) | ((o)&XIO_ADDR_BITS))

#ifdef CONFIG_PCI
extern int bridge_probe(nasid_t nasid, int widget, int masterwid);
#else
static inline int bridge_probe(nasid_t nasid, int widget, int masterwid)
{
return 0;
}
#endif

#endif /* !__ASSEMBLY__ */

#endif /* _ASM_XTALK_XTALK_H */
6 changes: 4 additions & 2 deletions arch/mips/include/uapi/asm/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#ifndef _UAPI_ASM_FCNTL_H
#define _UAPI_ASM_FCNTL_H

#include <asm/sgidefs.h>

#define O_APPEND 0x0008
#define O_DSYNC 0x0010 /* used to be O_SYNC, see below */
Expand Down Expand Up @@ -55,7 +56,8 @@
* contain all the same fields as struct flock.
*/

#ifdef CONFIG_32BIT
#if _MIPS_SIM != _MIPS_SIM_ABI64

#include <linux/types.h>

struct flock {
Expand All @@ -70,7 +72,7 @@ struct flock {

#define HAVE_ARCH_STRUCT_FLOCK

#endif /* CONFIG_32BIT */
#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */

#include <asm-generic/fcntl.h>

Expand Down
9 changes: 5 additions & 4 deletions arch/mips/include/uapi/asm/inst.h
Original file line number Diff line number Diff line change
Expand Up @@ -409,10 +409,11 @@ enum mm_32f_73_minor_op {
enum mm_16c_minor_op {
mm_lwm16_op = 0x04,
mm_swm16_op = 0x05,
mm_jr16_op = 0x18,
mm_jrc_op = 0x1a,
mm_jalr16_op = 0x1c,
mm_jalrs16_op = 0x1e,
mm_jr16_op = 0x0c,
mm_jrc_op = 0x0d,
mm_jalr16_op = 0x0e,
mm_jalrs16_op = 0x0f,
mm_jraddiusp_op = 0x18,
};

/*
Expand Down
12 changes: 6 additions & 6 deletions arch/mips/include/uapi/asm/msgbuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@

struct msqid64_ds {
struct ipc64_perm msg_perm;
#if defined(CONFIG_32BIT) && !defined(CONFIG_CPU_LITTLE_ENDIAN)
#if !defined(__mips64) && defined(__MIPSEB__)
unsigned long __unused1;
#endif
__kernel_time_t msg_stime; /* last msgsnd time */
#if defined(CONFIG_32BIT) && defined(CONFIG_CPU_LITTLE_ENDIAN)
#if !defined(__mips64) && defined(__MIPSEL__)
unsigned long __unused1;
#endif
#if defined(CONFIG_32BIT) && !defined(CONFIG_CPU_LITTLE_ENDIAN)
#if !defined(__mips64) && defined(__MIPSEB__)
unsigned long __unused2;
#endif
__kernel_time_t msg_rtime; /* last msgrcv time */
#if defined(CONFIG_32BIT) && defined(CONFIG_CPU_LITTLE_ENDIAN)
#if !defined(__mips64) && defined(__MIPSEL__)
unsigned long __unused2;
#endif
#if defined(CONFIG_32BIT) && !defined(CONFIG_CPU_LITTLE_ENDIAN)
#if !defined(__mips64) && defined(__MIPSEB__)
unsigned long __unused3;
#endif
__kernel_time_t msg_ctime; /* last change time */
#if defined(CONFIG_32BIT) && defined(CONFIG_CPU_LITTLE_ENDIAN)
#if !defined(__mips64) && defined(__MIPSEL__)
unsigned long __unused3;
#endif
unsigned long msg_cbytes; /* current number of bytes on queue */
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/include/uapi/asm/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* but we keep the old value on MIPS32,
* for compatibility:
*/
#ifdef CONFIG_32BIT
#ifndef __mips64
# define RLIM_INFINITY 0x7fffffffUL
#endif

Expand Down
4 changes: 2 additions & 2 deletions arch/mips/include/uapi/asm/siginfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ struct siginfo;
/*
* Careful to keep union _sifields from shifting ...
*/
#ifdef CONFIG_32BIT
#if __SIZEOF_LONG__ == 4
#define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int))
#endif
#ifdef CONFIG_64BIT
#if __SIZEOF_LONG__ == 8
#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
#endif

Expand Down
12 changes: 6 additions & 6 deletions arch/mips/include/uapi/asm/swab.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#define __SWAB_64_THRU_32__

#ifdef CONFIG_CPU_MIPSR2
#if defined(__mips_isa_rev) && (__mips_isa_rev >= 2)

static inline __attribute_const__ __u16 __arch_swab16(__u16 x)
{
Expand All @@ -39,10 +39,10 @@ static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
#define __arch_swab32 __arch_swab32

/*
* Having already checked for CONFIG_CPU_MIPSR2, enable the
* optimized version for 64-bit kernel on r2 CPUs.
* Having already checked for MIPS R2, enable the optimized version for
* 64-bit kernel on r2 CPUs.
*/
#ifdef CONFIG_64BIT
#ifdef __mips64
static inline __attribute_const__ __u64 __arch_swab64(__u64 x)
{
__asm__(
Expand All @@ -54,6 +54,6 @@ static inline __attribute_const__ __u64 __arch_swab64(__u64 x)
return x;
}
#define __arch_swab64 __arch_swab64
#endif /* CONFIG_64BIT */
#endif /* CONFIG_CPU_MIPSR2 */
#endif /* __mips64 */
#endif /* MIPS R2 or newer */
#endif /* _ASM_SWAB_H */
Loading

0 comments on commit 6ac5310

Please sign in to comment.