Skip to content

Commit

Permalink
Merge tag 'arc-4.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/…
Browse files Browse the repository at this point in the history
…git/vgupta/arc

Pull ARC updates from Vineet Gupta:

 - Support for new MM features in ARCv2 cores (THP, PAE40) Some generic
   THP bits are touched - all ACKed by Kirill

 - Platform framework updates to prepare for EZChip arrival (still in works)

 - ARC Public Mailing list setup finally ([email protected])

* tag 'arc-4.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc: (42 commits)
  ARC: mm: PAE40 support
  ARC: mm: PAE40: tlbex.S: Explicitify the size of pte_t
  ARC: mm: PAE40: switch to using phys_addr_t for physical addresses
  ARC: mm: HIGHMEM: populate high memory from DT
  ARC: mm: HIGHMEM: kmap API implementation
  ARC: mm: preps ahead of HIGHMEM support #2
  ARC: mm: preps ahead of HIGHMEM support
  ARC: mm: use generic macros _BITUL()/_AC()
  ARC: mm: Improve Duplicate PD Fault handler
  MAINTAINERS: Add public mailing list for ARC
  ARC: Ensure DT mem base is same as what kernel is built with
  ARC: boot: Non Master cpus only need to call EARLY_CPU_SETUP once
  ARCv2: smp: [plat-*]: No need to explicitly call mcip_init_smp()
  ARC: smp: Introduce smp hook @init_irq_cpu called for all cores
  ARC: smp: Rename platform hook @init_smp -> @init_cpu_smp
  ARCv2: smp: [plat-*]: No need to explicitly call mcip_init_early_smp()
  ARC: smp: Introduce smp hook @init_early_smp for Master core
  ARC: remove @init_time, @init_irq platform callbacks
  ARC: smp: irqchip: handle IPI as percpu irq like timer
  ARC: boot: Support Halt-on-reset and Run-on-reset SMP booting modes
  ...
  • Loading branch information
torvalds committed Nov 3, 2015
2 parents 0921f1e + 5a364c2 commit 2c2b828
Show file tree
Hide file tree
Showing 53 changed files with 1,075 additions and 479 deletions.
2 changes: 1 addition & 1 deletion Documentation/features/vm/THP/arch-support.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
| arch |status|
-----------------------
| alpha: | TODO |
| arc: | .. |
| arc: | ok |
| arm: | ok |
| arm64: | ok |
| avr32: | .. |
Expand Down
2 changes: 1 addition & 1 deletion Documentation/features/vm/pte_special/arch-support.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
| arch |status|
-----------------------
| alpha: | TODO |
| arc: | TODO |
| arc: | ok |
| arm: | ok |
| arm64: | ok |
| avr32: | TODO |
Expand Down
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -10121,6 +10121,7 @@ F: include/net/switchdev.h

SYNOPSYS ARC ARCHITECTURE
M: Vineet Gupta <[email protected]>
L: [email protected]
S: Supported
F: arch/arc/
F: Documentation/devicetree/bindings/arc/*
Expand Down
40 changes: 40 additions & 0 deletions arch/arc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ config STACKTRACE_SUPPORT
config HAVE_LATENCYTOP_SUPPORT
def_bool y

config HAVE_ARCH_TRANSPARENT_HUGEPAGE
def_bool y
depends on ARC_MMU_V4

source "init/Kconfig"
source "kernel/Kconfig.freezer"

Expand Down Expand Up @@ -190,6 +194,16 @@ config NR_CPUS
range 2 4096
default "4"

config ARC_SMP_HALT_ON_RESET
bool "Enable Halt-on-reset boot mode"
default y if ARC_UBOOT_SUPPORT
help
In SMP configuration cores can be configured as Halt-on-reset
or they could all start at same time. For Halt-on-reset, non
masters are parked until Master kicks them so they can start of
at designated entry point. For other case, all jump to common
entry point and spin wait for Master's signal.

endif #SMP

menuconfig ARC_CACHE
Expand Down Expand Up @@ -278,6 +292,8 @@ choice
default ARC_MMU_V2 if ARC_CPU_750D
default ARC_MMU_V4 if ARC_CPU_HS

if ISA_ARCOMPACT

config ARC_MMU_V1
bool "MMU v1"
help
Expand All @@ -297,6 +313,8 @@ config ARC_MMU_V3
Variable Page size (1k-16k), var JTLB size 128 x (2 or 4)
Shared Address Spaces (SASID)

endif

config ARC_MMU_V4
bool "MMU v4"
depends on ISA_ARCV2
Expand Down Expand Up @@ -428,6 +446,28 @@ config LINUX_LINK_BASE
Linux needs to be scooted a bit.
If you don't know what the above means, leave this setting alone.

config HIGHMEM
bool "High Memory Support"
help
With ARC 2G:2G address split, only upper 2G is directly addressable by
kernel. Enable this to potentially allow access to rest of 2G and PAE
in future

config ARC_HAS_PAE40
bool "Support for the 40-bit Physical Address Extension"
default n
depends on ISA_ARCV2
select HIGHMEM
help
Enable access to physical memory beyond 4G, only supported on
ARC cores with 40 bit Physical Addressing support

config ARCH_PHYS_ADDR_T_64BIT
def_bool ARC_HAS_PAE40

config ARCH_DMA_ADDR_T_64BIT
bool

config ARC_CURR_IN_REG
bool "Dedicate Register r25 for current_task pointer"
default y
Expand Down
2 changes: 1 addition & 1 deletion arch/arc/boot/dts/axc001.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,6 @@
#size-cells = <1>;
ranges = <0x00000000 0x80000000 0x40000000>;
device_type = "memory";
reg = <0x00000000 0x20000000>; /* 512MiB */
reg = <0x80000000 0x20000000>; /* 512MiB */
};
};
2 changes: 1 addition & 1 deletion arch/arc/boot/dts/axc003.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,6 @@
#size-cells = <1>;
ranges = <0x00000000 0x80000000 0x40000000>;
device_type = "memory";
reg = <0x00000000 0x20000000>; /* 512MiB */
reg = <0x80000000 0x20000000>; /* 512MiB */
};
};
2 changes: 1 addition & 1 deletion arch/arc/boot/dts/axc003_idu.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,6 @@
#size-cells = <1>;
ranges = <0x00000000 0x80000000 0x40000000>;
device_type = "memory";
reg = <0x00000000 0x20000000>; /* 512MiB */
reg = <0x80000000 0x20000000>; /* 512MiB */
};
};
12 changes: 10 additions & 2 deletions arch/arc/boot/dts/nsim_hs.dts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,16 @@

/ {
compatible = "snps,nsim_hs";
#address-cells = <2>;
#size-cells = <2>;
interrupt-parent = <&core_intc>;

memory {
device_type = "memory";
reg = <0x0 0x80000000 0x0 0x40000000 /* 1 GB low mem */
0x1 0x00000000 0x0 0x40000000>; /* 1 GB highmem */
};

chosen {
bootargs = "earlycon=arc_uart,mmio32,0xc0fc1000,115200n8 console=ttyARC0,115200n8";
};
Expand All @@ -26,8 +34,8 @@
#address-cells = <1>;
#size-cells = <1>;

/* child and parent address space 1:1 mapped */
ranges;
/* only perip space at end of low mem accessible */
ranges = <0x80000000 0x0 0x80000000 0x80000000>;

core_intc: core-interrupt-controller {
compatible = "snps,archs-intc";
Expand Down
2 changes: 1 addition & 1 deletion arch/arc/boot/dts/skeleton.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@

memory {
device_type = "memory";
reg = <0x00000000 0x10000000>; /* 256M */
reg = <0x80000000 0x10000000>; /* 256M */
};
};
2 changes: 1 addition & 1 deletion arch/arc/boot/dts/vdk_axc003.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@
#size-cells = <1>;
ranges = <0x00000000 0x80000000 0x40000000>;
device_type = "memory";
reg = <0x00000000 0x20000000>; /* 512MiB */
reg = <0x80000000 0x20000000>; /* 512MiB */
};
};
2 changes: 1 addition & 1 deletion arch/arc/boot/dts/vdk_axc003_idu.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@
#size-cells = <1>;
ranges = <0x00000000 0x80000000 0x40000000>;
device_type = "memory";
reg = <0x00000000 0x20000000>; /* 512MiB */
reg = <0x80000000 0x20000000>; /* 512MiB */
};
};
6 changes: 3 additions & 3 deletions arch/arc/include/asm/arcregs.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@

/* gcc builtin sr needs reg param to be long immediate */
#define write_aux_reg(reg_immed, val) \
__builtin_arc_sr((unsigned int)val, reg_immed)
__builtin_arc_sr((unsigned int)(val), reg_immed)

#else

Expand Down Expand Up @@ -327,8 +327,8 @@ struct bcr_generic {
*/

struct cpuinfo_arc_mmu {
unsigned int ver:4, pg_sz_k:8, s_pg_sz_m:8, u_dtlb:6, u_itlb:6;
unsigned int num_tlb:16, sets:12, ways:4;
unsigned int ver:4, pg_sz_k:8, s_pg_sz_m:8, pad:10, sasid:1, pae:1;
unsigned int sets:12, ways:4, u_dtlb:8, u_itlb:8;
};

struct cpuinfo_arc_cache {
Expand Down
2 changes: 2 additions & 0 deletions arch/arc/include/asm/cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ extern int ioc_exists;
#if defined(CONFIG_ARC_MMU_V3) || defined(CONFIG_ARC_MMU_V4)
#define ARC_REG_IC_PTAG 0x1E
#endif
#define ARC_REG_IC_PTAG_HI 0x1F

/* Bit val in IC_CTRL */
#define IC_CTRL_CACHE_DISABLE 0x1
Expand All @@ -77,6 +78,7 @@ extern int ioc_exists;
#define ARC_REG_DC_FLSH 0x4B
#define ARC_REG_DC_FLDL 0x4C
#define ARC_REG_DC_PTAG 0x5C
#define ARC_REG_DC_PTAG_HI 0x5F

/* Bit val in DC_CTRL */
#define DC_CTRL_INV_MODE_FLUSH 0x40
Expand Down
8 changes: 4 additions & 4 deletions arch/arc/include/asm/cacheflush.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@

void flush_cache_all(void);

void flush_icache_range(unsigned long start, unsigned long end);
void __sync_icache_dcache(unsigned long paddr, unsigned long vaddr, int len);
void __inv_icache_page(unsigned long paddr, unsigned long vaddr);
void __flush_dcache_page(unsigned long paddr, unsigned long vaddr);
void flush_icache_range(unsigned long kstart, unsigned long kend);
void __sync_icache_dcache(phys_addr_t paddr, unsigned long vaddr, int len);
void __inv_icache_page(phys_addr_t paddr, unsigned long vaddr);
void __flush_dcache_page(phys_addr_t paddr, unsigned long vaddr);

#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1

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

.macro FAKE_RET_FROM_EXCPN

ld r9, [sp, PT_status32]
bic r9, r9, (STATUS_U_MASK|STATUS_DE_MASK)
bset r9, r9, STATUS_L_BIT
sr r9, [erstatus]
mov r9, 55f
sr r9, [eret]

lr r9, [status32]
bclr r9, r9, STATUS_AE_BIT
or r9, r9, (STATUS_E1_MASK|STATUS_E2_MASK)
sr r9, [erstatus]
mov r9, 55f
sr r9, [eret]
rtie
55:
.endm
Expand Down
61 changes: 61 additions & 0 deletions arch/arc/include/asm/highmem.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* Copyright (C) 2015 Synopsys, Inc. (www.synopsys.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 _ASM_HIGHMEM_H
#define _ASM_HIGHMEM_H

#ifdef CONFIG_HIGHMEM

#include <uapi/asm/page.h>
#include <asm/kmap_types.h>

/* start after vmalloc area */
#define FIXMAP_BASE (PAGE_OFFSET - FIXMAP_SIZE - PKMAP_SIZE)
#define FIXMAP_SIZE PGDIR_SIZE /* only 1 PGD worth */
#define KM_TYPE_NR ((FIXMAP_SIZE >> PAGE_SHIFT)/NR_CPUS)
#define FIXMAP_ADDR(nr) (FIXMAP_BASE + ((nr) << PAGE_SHIFT))

/* start after fixmap area */
#define PKMAP_BASE (FIXMAP_BASE + FIXMAP_SIZE)
#define PKMAP_SIZE PGDIR_SIZE
#define LAST_PKMAP (PKMAP_SIZE >> PAGE_SHIFT)
#define LAST_PKMAP_MASK (LAST_PKMAP - 1)
#define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT))
#define PKMAP_NR(virt) (((virt) - PKMAP_BASE) >> PAGE_SHIFT)

#define kmap_prot PAGE_KERNEL


#include <asm/cacheflush.h>

extern void *kmap(struct page *page);
extern void *kmap_high(struct page *page);
extern void *kmap_atomic(struct page *page);
extern void __kunmap_atomic(void *kvaddr);
extern void kunmap_high(struct page *page);

extern void kmap_init(void);

static inline void flush_cache_kmaps(void)
{
flush_cache_all();
}

static inline void kunmap(struct page *page)
{
BUG_ON(in_interrupt());
if (!PageHighMem(page))
return;
kunmap_high(page);
}


#endif

#endif
81 changes: 81 additions & 0 deletions arch/arc/include/asm/hugepage.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*
* Copyright (C) 2013-15 Synopsys, Inc. (www.synopsys.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 _ASM_ARC_HUGEPAGE_H
#define _ASM_ARC_HUGEPAGE_H

#include <linux/types.h>
#include <asm-generic/pgtable-nopmd.h>

static inline pte_t pmd_pte(pmd_t pmd)
{
return __pte(pmd_val(pmd));
}

static inline pmd_t pte_pmd(pte_t pte)
{
return __pmd(pte_val(pte));
}

#define pmd_wrprotect(pmd) pte_pmd(pte_wrprotect(pmd_pte(pmd)))
#define pmd_mkwrite(pmd) pte_pmd(pte_mkwrite(pmd_pte(pmd)))
#define pmd_mkdirty(pmd) pte_pmd(pte_mkdirty(pmd_pte(pmd)))
#define pmd_mkold(pmd) pte_pmd(pte_mkold(pmd_pte(pmd)))
#define pmd_mkyoung(pmd) pte_pmd(pte_mkyoung(pmd_pte(pmd)))
#define pmd_mkhuge(pmd) pte_pmd(pte_mkhuge(pmd_pte(pmd)))
#define pmd_mknotpresent(pmd) pte_pmd(pte_mknotpresent(pmd_pte(pmd)))
#define pmd_mksplitting(pmd) pte_pmd(pte_mkspecial(pmd_pte(pmd)))
#define pmd_mkclean(pmd) pte_pmd(pte_mkclean(pmd_pte(pmd)))

#define pmd_write(pmd) pte_write(pmd_pte(pmd))
#define pmd_young(pmd) pte_young(pmd_pte(pmd))
#define pmd_pfn(pmd) pte_pfn(pmd_pte(pmd))
#define pmd_dirty(pmd) pte_dirty(pmd_pte(pmd))
#define pmd_special(pmd) pte_special(pmd_pte(pmd))

#define mk_pmd(page, prot) pte_pmd(mk_pte(page, prot))

#define pmd_trans_huge(pmd) (pmd_val(pmd) & _PAGE_HW_SZ)
#define pmd_trans_splitting(pmd) (pmd_trans_huge(pmd) && pmd_special(pmd))

#define pfn_pmd(pfn, prot) (__pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot)))

static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot)
{
/*
* open-coded pte_modify() with additional retaining of HW_SZ bit
* so that pmd_trans_huge() remains true for this PMD
*/
return __pmd((pmd_val(pmd) & (_PAGE_CHG_MASK | _PAGE_HW_SZ)) | pgprot_val(newprot));
}

static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
pmd_t *pmdp, pmd_t pmd)
{
*pmdp = pmd;
}

extern void update_mmu_cache_pmd(struct vm_area_struct *vma, unsigned long addr,
pmd_t *pmd);

#define has_transparent_hugepage() 1

/* Generic variants assume pgtable_t is struct page *, hence need for these */
#define __HAVE_ARCH_PGTABLE_DEPOSIT
extern void pgtable_trans_huge_deposit(struct mm_struct *mm, pmd_t *pmdp,
pgtable_t pgtable);

#define __HAVE_ARCH_PGTABLE_WITHDRAW
extern pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp);

#define __HAVE_ARCH_FLUSH_PMD_TLB_RANGE
extern void flush_pmd_tlb_range(struct vm_area_struct *vma, unsigned long start,
unsigned long end);

#endif
1 change: 1 addition & 0 deletions arch/arc/include/asm/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#ifdef CONFIG_ISA_ARCOMPACT
#define TIMER0_IRQ 3
#define TIMER1_IRQ 4
#define IPI_IRQ (NR_CPU_IRQS-1) /* dummy to enable SMP build for up hardware */
#else
#define TIMER0_IRQ 16
#define TIMER1_IRQ 17
Expand Down
Loading

0 comments on commit 2c2b828

Please sign in to comment.