mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
Merge aa5b537b0e ("Merge tag 'riscv-for-linus-5.18-mw0' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux") into android-mainline
Steps on the way to 5.18-rc1 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: Ib3706e8e395f2bcfa8c120f3491b2a3a34b3c70f
This commit is contained in:
@@ -61,3 +61,15 @@ Description:
|
||||
* "CchRHCnt" : Cache Read Hit Count
|
||||
* "CchWHCnt" : Cache Write Hit Count
|
||||
* "FastWCnt" : Fast Write Count
|
||||
|
||||
What: /sys/bus/nd/devices/nmemX/papr/health_bitmap_inject
|
||||
Date: Jan, 2022
|
||||
KernelVersion: v5.17
|
||||
Contact: linuxppc-dev <linuxppc-dev@lists.ozlabs.org>, nvdimm@lists.linux.dev,
|
||||
Description:
|
||||
(RO) Reports the health bitmap inject bitmap that is applied to
|
||||
bitmap received from PowerVM via the H_SCM_HEALTH. This is used
|
||||
to forcibly set specific bits returned from Hcall. These is then
|
||||
used to simulate various health or shutdown states for an nvdimm
|
||||
and are set by user-space tools like ndctl by issuing a PAPR DSM.
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
What: /sys/firmware/papr/energy_scale_info
|
||||
Date: February 2022
|
||||
Contact: Linux for PowerPC mailing list <linuxppc-dev@ozlabs.org>
|
||||
Description: Directory hosting a set of platform attributes like
|
||||
energy/frequency on Linux running as a PAPR guest.
|
||||
|
||||
Each file in a directory contains a platform
|
||||
attribute hierarchy pertaining to performance/
|
||||
energy-savings mode and processor frequency.
|
||||
|
||||
What: /sys/firmware/papr/energy_scale_info/<id>
|
||||
Date: February 2022
|
||||
Contact: Linux for PowerPC mailing list <linuxppc-dev@ozlabs.org>
|
||||
Description: Energy, frequency attributes directory for POWERVM servers
|
||||
|
||||
What: /sys/firmware/papr/energy_scale_info/<id>/desc
|
||||
Date: February 2022
|
||||
Contact: Linux for PowerPC mailing list <linuxppc-dev@ozlabs.org>
|
||||
Description: String description of the energy attribute of <id>
|
||||
|
||||
What: /sys/firmware/papr/energy_scale_info/<id>/value
|
||||
Date: February 2022
|
||||
Contact: Linux for PowerPC mailing list <linuxppc-dev@ozlabs.org>
|
||||
Description: Numeric value of the energy attribute of <id>
|
||||
|
||||
What: /sys/firmware/papr/energy_scale_info/<id>/value_desc
|
||||
Date: February 2022
|
||||
Contact: Linux for PowerPC mailing list <linuxppc-dev@ozlabs.org>
|
||||
Description: String value of the energy attribute of <id>
|
||||
58
Documentation/devicetree/bindings/clock/microchip,mpfs.yaml
Normal file
58
Documentation/devicetree/bindings/clock/microchip,mpfs.yaml
Normal file
@@ -0,0 +1,58 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/clock/microchip,mpfs.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Microchip PolarFire Clock Control Module Binding
|
||||
|
||||
maintainers:
|
||||
- Daire McNamara <daire.mcnamara@microchip.com>
|
||||
|
||||
description: |
|
||||
Microchip PolarFire clock control (CLKCFG) is an integrated clock controller,
|
||||
which gates and enables all peripheral clocks.
|
||||
|
||||
This device tree binding describes 33 gate clocks. Clocks are referenced by
|
||||
user nodes by the CLKCFG node phandle and the clock index in the group, from
|
||||
0 to 32.
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
const: microchip,mpfs-clkcfg
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
clocks:
|
||||
maxItems: 1
|
||||
|
||||
'#clock-cells':
|
||||
const: 1
|
||||
description: |
|
||||
The clock consumer should specify the desired clock by having the clock
|
||||
ID in its "clocks" phandle cell. See include/dt-bindings/clock/microchip,mpfs-clock.h
|
||||
for the full list of PolarFire clock IDs.
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
- clocks
|
||||
- '#clock-cells'
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
# Clock Config node:
|
||||
- |
|
||||
#include <dt-bindings/clock/microchip,mpfs-clock.h>
|
||||
soc {
|
||||
#address-cells = <2>;
|
||||
#size-cells = <2>;
|
||||
clkcfg: clock-controller@20002000 {
|
||||
compatible = "microchip,mpfs-clkcfg";
|
||||
reg = <0x0 0x20002000 0x0 0x1000>;
|
||||
clocks = <&ref>;
|
||||
#clock-cells = <1>;
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,79 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/gpio/microchip,mpfs-gpio.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Microchip MPFS GPIO Controller Device Tree Bindings
|
||||
|
||||
maintainers:
|
||||
- Conor Dooley <conor.dooley@microchip.com>
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
items:
|
||||
- enum:
|
||||
- microchip,mpfs-gpio
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
interrupts:
|
||||
description:
|
||||
Interrupt mapping, one per GPIO. Maximum 32 GPIOs.
|
||||
minItems: 1
|
||||
maxItems: 32
|
||||
|
||||
interrupt-controller: true
|
||||
|
||||
clocks:
|
||||
maxItems: 1
|
||||
|
||||
"#gpio-cells":
|
||||
const: 2
|
||||
|
||||
"#interrupt-cells":
|
||||
const: 1
|
||||
|
||||
ngpios:
|
||||
description:
|
||||
The number of GPIOs available.
|
||||
minimum: 1
|
||||
maximum: 32
|
||||
default: 32
|
||||
|
||||
gpio-controller: true
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
- interrupts
|
||||
- "#interrupt-cells"
|
||||
- interrupt-controller
|
||||
- "#gpio-cells"
|
||||
- gpio-controller
|
||||
- clocks
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
gpio@20122000 {
|
||||
compatible = "microchip,mpfs-gpio";
|
||||
reg = <0x20122000 0x1000>;
|
||||
clocks = <&clkcfg 25>;
|
||||
interrupt-parent = <&plic>;
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <1>;
|
||||
interrupts = <53>, <53>, <53>, <53>,
|
||||
<53>, <53>, <53>, <53>,
|
||||
<53>, <53>, <53>, <53>,
|
||||
<53>, <53>, <53>, <53>,
|
||||
<53>, <53>, <53>, <53>,
|
||||
<53>, <53>, <53>, <53>,
|
||||
<53>, <53>, <53>, <53>,
|
||||
<53>, <53>, <53>, <53>;
|
||||
};
|
||||
...
|
||||
@@ -44,6 +44,10 @@ properties:
|
||||
- renesas,ipmmu-r8a77990 # R-Car E3
|
||||
- renesas,ipmmu-r8a77995 # R-Car D3
|
||||
- renesas,ipmmu-r8a779a0 # R-Car V3U
|
||||
- items:
|
||||
- enum:
|
||||
- renesas,ipmmu-r8a779f0 # R-Car S4-8
|
||||
- const: renesas,rcar-gen4-ipmmu-vmsa # R-Car Gen4
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: "http://devicetree.org/schemas/mailbox/microchip,polarfire-soc-mailbox.yaml#"
|
||||
$id: "http://devicetree.org/schemas/mailbox/microchip,mpfs-mailbox.yaml#"
|
||||
$schema: "http://devicetree.org/meta-schemas/core.yaml#"
|
||||
|
||||
title: Microchip PolarFire SoC (MPFS) MSS (microprocessor subsystem) mailbox controller
|
||||
@@ -11,7 +11,7 @@ maintainers:
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
const: microchip,polarfire-soc-mailbox
|
||||
const: microchip,mpfs-mailbox
|
||||
|
||||
reg:
|
||||
items:
|
||||
@@ -38,7 +38,7 @@ examples:
|
||||
#address-cells = <2>;
|
||||
#size-cells = <2>;
|
||||
mbox: mailbox@37020000 {
|
||||
compatible = "microchip,polarfire-soc-mailbox";
|
||||
compatible = "microchip,mpfs-mailbox";
|
||||
reg = <0x0 0x37020000 0x0 0x1000>, <0x0 0x2000318c 0x0 0x40>;
|
||||
interrupt-parent = <&L1>;
|
||||
interrupts = <96>;
|
||||
81
Documentation/devicetree/bindings/pwm/microchip,corepwm.yaml
Normal file
81
Documentation/devicetree/bindings/pwm/microchip,corepwm.yaml
Normal file
@@ -0,0 +1,81 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/pwm/microchip,corepwm.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Microchip IP corePWM controller bindings
|
||||
|
||||
maintainers:
|
||||
- Conor Dooley <conor.dooley@microchip.com>
|
||||
|
||||
description: |
|
||||
corePWM is an 16 channel pulse width modulator FPGA IP
|
||||
|
||||
https://www.microsemi.com/existing-parts/parts/152118
|
||||
|
||||
allOf:
|
||||
- $ref: pwm.yaml#
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
items:
|
||||
- const: microchip,corepwm-rtl-v4
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
clocks:
|
||||
maxItems: 1
|
||||
|
||||
"#pwm-cells":
|
||||
const: 2
|
||||
|
||||
microchip,sync-update-mask:
|
||||
description: |
|
||||
Depending on how the IP is instantiated, there are two modes of operation.
|
||||
In synchronous mode, all channels are updated at the beginning of the PWM period,
|
||||
and in asynchronous mode updates happen as the control registers are written.
|
||||
A 16 bit wide "SHADOW_REG_EN" parameter of the IP core controls whether synchronous
|
||||
mode is possible for each channel, and is set by the bitstream programmed to the
|
||||
FPGA. If the IP core is instantiated with SHADOW_REG_ENx=1, both registers that
|
||||
control the duty cycle for channel x have a second "shadow"/buffer reg synthesised.
|
||||
At runtime a bit wide register exposed to APB can be used to toggle on/off
|
||||
synchronised mode for all channels it has been synthesised for.
|
||||
Each bit of "microchip,sync-update-mask" corresponds to a PWM channel & represents
|
||||
whether synchronous mode is possible for the PWM channel.
|
||||
|
||||
$ref: /schemas/types.yaml#/definitions/uint32
|
||||
default: 0
|
||||
|
||||
microchip,dac-mode-mask:
|
||||
description: |
|
||||
Optional, per-channel Low Ripple DAC mode is possible on this IP core. It creates
|
||||
a minimum period pulse train whose High/Low average is that of the chosen duty
|
||||
cycle. This "DAC" will have far better bandwidth and ripple performance than the
|
||||
standard PWM algorithm can achieve. A 16 bit DAC_MODE module parameter of the IP
|
||||
core, set at instantiation and by the bitstream programmed to the FPGA, determines
|
||||
whether a given channel operates in regular PWM or DAC mode.
|
||||
Each bit corresponds to a PWM channel & represents whether DAC mode is enabled
|
||||
for that channel.
|
||||
|
||||
$ref: /schemas/types.yaml#/definitions/uint32
|
||||
default: 0
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
- clocks
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
pwm@41000000 {
|
||||
compatible = "microchip,corepwm-rtl-v4";
|
||||
microchip,sync-update-mask = /bits/ 32 <0>;
|
||||
clocks = <&clkcfg 30>;
|
||||
reg = <0x41000000 0xF0>;
|
||||
#pwm-cells = <2>;
|
||||
};
|
||||
@@ -0,0 +1,58 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/rtc/microchip,mfps-rtc.yaml#
|
||||
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Microchip PolarFire Soc (MPFS) RTC Device Tree Bindings
|
||||
|
||||
allOf:
|
||||
- $ref: rtc.yaml#
|
||||
|
||||
maintainers:
|
||||
- Daire McNamara <daire.mcnamara@microchip.com>
|
||||
- Lewis Hanly <lewis.hanly@microchip.com>
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
enum:
|
||||
- microchip,mpfs-rtc
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
interrupts:
|
||||
items:
|
||||
- description: |
|
||||
RTC_WAKEUP interrupt
|
||||
- description: |
|
||||
RTC_MATCH, asserted when the content of the Alarm register is equal
|
||||
to that of the RTC's count register.
|
||||
|
||||
clocks:
|
||||
maxItems: 1
|
||||
|
||||
clock-names:
|
||||
items:
|
||||
- const: rtc
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
- interrupts
|
||||
- clocks
|
||||
- clock-names
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
rtc@20124000 {
|
||||
compatible = "microchip,mpfs-rtc";
|
||||
reg = <0x20124000 0x1000>;
|
||||
clocks = <&clkcfg 21>;
|
||||
clock-names = "rtc";
|
||||
interrupts = <80>, <81>;
|
||||
};
|
||||
...
|
||||
@@ -0,0 +1,40 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: "http://devicetree.org/schemas/soc/microchip/microchip,mpfs-sys-controller.yaml#"
|
||||
$schema: "http://devicetree.org/meta-schemas/core.yaml#"
|
||||
|
||||
title: Microchip PolarFire SoC (MPFS) MSS (microprocessor subsystem) system controller
|
||||
|
||||
maintainers:
|
||||
- Conor Dooley <conor.dooley@microchip.com>
|
||||
|
||||
description: |
|
||||
PolarFire SoC devices include a microcontroller acting as the system controller,
|
||||
which provides "services" to the main processor and to the FPGA fabric. These
|
||||
services include hardware rng, reprogramming of the FPGA and verfification of the
|
||||
eNVM contents etc. More information on these services can be found online, at
|
||||
https://onlinedocs.microchip.com/pr/GUID-1409CF11-8EF9-4C24-A94E-70979A688632-en-US-1/index.html
|
||||
|
||||
Communication with the system controller is done via a mailbox, of which the client
|
||||
portion is documented here.
|
||||
|
||||
properties:
|
||||
mboxes:
|
||||
maxItems: 1
|
||||
|
||||
compatible:
|
||||
const: microchip,mpfs-sys-controller
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- mboxes
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
syscontroller {
|
||||
compatible = "microchip,mpfs-sys-controller";
|
||||
mboxes = <&mbox 0>;
|
||||
};
|
||||
@@ -1,35 +0,0 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: "http://devicetree.org/schemas/soc/microchip/microchip,polarfire-soc-sys-controller.yaml#"
|
||||
$schema: "http://devicetree.org/meta-schemas/core.yaml#"
|
||||
|
||||
title: Microchip PolarFire SoC (MPFS) MSS (microprocessor subsystem) system controller
|
||||
|
||||
maintainers:
|
||||
- Conor Dooley <conor.dooley@microchip.com>
|
||||
|
||||
description: |
|
||||
The PolarFire SoC system controller is communicated with via a mailbox.
|
||||
This document describes the bindings for the client portion of that mailbox.
|
||||
|
||||
|
||||
properties:
|
||||
mboxes:
|
||||
maxItems: 1
|
||||
|
||||
compatible:
|
||||
const: microchip,polarfire-soc-sys-controller
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- mboxes
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
syscontroller: syscontroller {
|
||||
compatible = "microchip,polarfire-soc-sys-controller";
|
||||
mboxes = <&mbox 0>;
|
||||
};
|
||||
@@ -1,255 +0,0 @@
|
||||
===================================
|
||||
Supporting PMUs on RISC-V platforms
|
||||
===================================
|
||||
|
||||
Alan Kao <alankao@andestech.com>, Mar 2018
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
As of this writing, perf_event-related features mentioned in The RISC-V ISA
|
||||
Privileged Version 1.10 are as follows:
|
||||
(please check the manual for more details)
|
||||
|
||||
* [m|s]counteren
|
||||
* mcycle[h], cycle[h]
|
||||
* minstret[h], instret[h]
|
||||
* mhpeventx, mhpcounterx[h]
|
||||
|
||||
With such function set only, porting perf would require a lot of work, due to
|
||||
the lack of the following general architectural performance monitoring features:
|
||||
|
||||
* Enabling/Disabling counters
|
||||
Counters are just free-running all the time in our case.
|
||||
* Interrupt caused by counter overflow
|
||||
No such feature in the spec.
|
||||
* Interrupt indicator
|
||||
It is not possible to have many interrupt ports for all counters, so an
|
||||
interrupt indicator is required for software to tell which counter has
|
||||
just overflowed.
|
||||
* Writing to counters
|
||||
There will be an SBI to support this since the kernel cannot modify the
|
||||
counters [1]. Alternatively, some vendor considers to implement
|
||||
hardware-extension for M-S-U model machines to write counters directly.
|
||||
|
||||
This document aims to provide developers a quick guide on supporting their
|
||||
PMUs in the kernel. The following sections briefly explain perf' mechanism
|
||||
and todos.
|
||||
|
||||
You may check previous discussions here [1][2]. Also, it might be helpful
|
||||
to check the appendix for related kernel structures.
|
||||
|
||||
|
||||
1. Initialization
|
||||
-----------------
|
||||
|
||||
*riscv_pmu* is a global pointer of type *struct riscv_pmu*, which contains
|
||||
various methods according to perf's internal convention and PMU-specific
|
||||
parameters. One should declare such instance to represent the PMU. By default,
|
||||
*riscv_pmu* points to a constant structure *riscv_base_pmu*, which has very
|
||||
basic support to a baseline QEMU model.
|
||||
|
||||
Then he/she can either assign the instance's pointer to *riscv_pmu* so that
|
||||
the minimal and already-implemented logic can be leveraged, or invent his/her
|
||||
own *riscv_init_platform_pmu* implementation.
|
||||
|
||||
In other words, existing sources of *riscv_base_pmu* merely provide a
|
||||
reference implementation. Developers can flexibly decide how many parts they
|
||||
can leverage, and in the most extreme case, they can customize every function
|
||||
according to their needs.
|
||||
|
||||
|
||||
2. Event Initialization
|
||||
-----------------------
|
||||
|
||||
When a user launches a perf command to monitor some events, it is first
|
||||
interpreted by the userspace perf tool into multiple *perf_event_open*
|
||||
system calls, and then each of them calls to the body of *event_init*
|
||||
member function that was assigned in the previous step. In *riscv_base_pmu*'s
|
||||
case, it is *riscv_event_init*.
|
||||
|
||||
The main purpose of this function is to translate the event provided by user
|
||||
into bitmap, so that HW-related control registers or counters can directly be
|
||||
manipulated. The translation is based on the mappings and methods provided in
|
||||
*riscv_pmu*.
|
||||
|
||||
Note that some features can be done in this stage as well:
|
||||
|
||||
(1) interrupt setting, which is stated in the next section;
|
||||
(2) privilege level setting (user space only, kernel space only, both);
|
||||
(3) destructor setting. Normally it is sufficient to apply *riscv_destroy_event*;
|
||||
(4) tweaks for non-sampling events, which will be utilized by functions such as
|
||||
*perf_adjust_period*, usually something like the follows::
|
||||
|
||||
if (!is_sampling_event(event)) {
|
||||
hwc->sample_period = x86_pmu.max_period;
|
||||
hwc->last_period = hwc->sample_period;
|
||||
local64_set(&hwc->period_left, hwc->sample_period);
|
||||
}
|
||||
|
||||
In the case of *riscv_base_pmu*, only (3) is provided for now.
|
||||
|
||||
|
||||
3. Interrupt
|
||||
------------
|
||||
|
||||
3.1. Interrupt Initialization
|
||||
|
||||
This often occurs at the beginning of the *event_init* method. In common
|
||||
practice, this should be a code segment like::
|
||||
|
||||
int x86_reserve_hardware(void)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
if (!atomic_inc_not_zero(&pmc_refcount)) {
|
||||
mutex_lock(&pmc_reserve_mutex);
|
||||
if (atomic_read(&pmc_refcount) == 0) {
|
||||
if (!reserve_pmc_hardware())
|
||||
err = -EBUSY;
|
||||
else
|
||||
reserve_ds_buffers();
|
||||
}
|
||||
if (!err)
|
||||
atomic_inc(&pmc_refcount);
|
||||
mutex_unlock(&pmc_reserve_mutex);
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
And the magic is in *reserve_pmc_hardware*, which usually does atomic
|
||||
operations to make implemented IRQ accessible from some global function pointer.
|
||||
*release_pmc_hardware* serves the opposite purpose, and it is used in event
|
||||
destructors mentioned in previous section.
|
||||
|
||||
(Note: From the implementations in all the architectures, the *reserve/release*
|
||||
pair are always IRQ settings, so the *pmc_hardware* seems somehow misleading.
|
||||
It does NOT deal with the binding between an event and a physical counter,
|
||||
which will be introduced in the next section.)
|
||||
|
||||
3.2. IRQ Structure
|
||||
|
||||
Basically, a IRQ runs the following pseudo code::
|
||||
|
||||
for each hardware counter that triggered this overflow
|
||||
|
||||
get the event of this counter
|
||||
|
||||
// following two steps are defined as *read()*,
|
||||
// check the section Reading/Writing Counters for details.
|
||||
count the delta value since previous interrupt
|
||||
update the event->count (# event occurs) by adding delta, and
|
||||
event->hw.period_left by subtracting delta
|
||||
|
||||
if the event overflows
|
||||
sample data
|
||||
set the counter appropriately for the next overflow
|
||||
|
||||
if the event overflows again
|
||||
too frequently, throttle this event
|
||||
fi
|
||||
fi
|
||||
|
||||
end for
|
||||
|
||||
However as of this writing, none of the RISC-V implementations have designed an
|
||||
interrupt for perf, so the details are to be completed in the future.
|
||||
|
||||
4. Reading/Writing Counters
|
||||
---------------------------
|
||||
|
||||
They seem symmetric but perf treats them quite differently. For reading, there
|
||||
is a *read* interface in *struct pmu*, but it serves more than just reading.
|
||||
According to the context, the *read* function not only reads the content of the
|
||||
counter (event->count), but also updates the left period to the next interrupt
|
||||
(event->hw.period_left).
|
||||
|
||||
But the core of perf does not need direct write to counters. Writing counters
|
||||
is hidden behind the abstraction of 1) *pmu->start*, literally start counting so one
|
||||
has to set the counter to a good value for the next interrupt; 2) inside the IRQ
|
||||
it should set the counter to the same resonable value.
|
||||
|
||||
Reading is not a problem in RISC-V but writing would need some effort, since
|
||||
counters are not allowed to be written by S-mode.
|
||||
|
||||
|
||||
5. add()/del()/start()/stop()
|
||||
-----------------------------
|
||||
|
||||
Basic idea: add()/del() adds/deletes events to/from a PMU, and start()/stop()
|
||||
starts/stop the counter of some event in the PMU. All of them take the same
|
||||
arguments: *struct perf_event *event* and *int flag*.
|
||||
|
||||
Consider perf as a state machine, then you will find that these functions serve
|
||||
as the state transition process between those states.
|
||||
Three states (event->hw.state) are defined:
|
||||
|
||||
* PERF_HES_STOPPED: the counter is stopped
|
||||
* PERF_HES_UPTODATE: the event->count is up-to-date
|
||||
* PERF_HES_ARCH: arch-dependent usage ... we don't need this for now
|
||||
|
||||
A normal flow of these state transitions are as follows:
|
||||
|
||||
* A user launches a perf event, resulting in calling to *event_init*.
|
||||
* When being context-switched in, *add* is called by the perf core, with a flag
|
||||
PERF_EF_START, which means that the event should be started after it is added.
|
||||
At this stage, a general event is bound to a physical counter, if any.
|
||||
The state changes to PERF_HES_STOPPED and PERF_HES_UPTODATE, because it is now
|
||||
stopped, and the (software) event count does not need updating.
|
||||
|
||||
- *start* is then called, and the counter is enabled.
|
||||
With flag PERF_EF_RELOAD, it writes an appropriate value to the counter (check
|
||||
previous section for detail).
|
||||
Nothing is written if the flag does not contain PERF_EF_RELOAD.
|
||||
The state now is reset to none, because it is neither stopped nor updated
|
||||
(the counting already started)
|
||||
|
||||
* When being context-switched out, *del* is called. It then checks out all the
|
||||
events in the PMU and calls *stop* to update their counts.
|
||||
|
||||
- *stop* is called by *del*
|
||||
and the perf core with flag PERF_EF_UPDATE, and it often shares the same
|
||||
subroutine as *read* with the same logic.
|
||||
The state changes to PERF_HES_STOPPED and PERF_HES_UPTODATE, again.
|
||||
|
||||
- Life cycle of these two pairs: *add* and *del* are called repeatedly as
|
||||
tasks switch in-and-out; *start* and *stop* is also called when the perf core
|
||||
needs a quick stop-and-start, for instance, when the interrupt period is being
|
||||
adjusted.
|
||||
|
||||
Current implementation is sufficient for now and can be easily extended to
|
||||
features in the future.
|
||||
|
||||
A. Related Structures
|
||||
---------------------
|
||||
|
||||
* struct pmu: include/linux/perf_event.h
|
||||
* struct riscv_pmu: arch/riscv/include/asm/perf_event.h
|
||||
|
||||
Both structures are designed to be read-only.
|
||||
|
||||
*struct pmu* defines some function pointer interfaces, and most of them take
|
||||
*struct perf_event* as a main argument, dealing with perf events according to
|
||||
perf's internal state machine (check kernel/events/core.c for details).
|
||||
|
||||
*struct riscv_pmu* defines PMU-specific parameters. The naming follows the
|
||||
convention of all other architectures.
|
||||
|
||||
* struct perf_event: include/linux/perf_event.h
|
||||
* struct hw_perf_event
|
||||
|
||||
The generic structure that represents perf events, and the hardware-related
|
||||
details.
|
||||
|
||||
* struct riscv_hw_events: arch/riscv/include/asm/perf_event.h
|
||||
|
||||
The structure that holds the status of events, has two fixed members:
|
||||
the number of events and the array of the events.
|
||||
|
||||
References
|
||||
----------
|
||||
|
||||
[1] https://github.com/riscv/riscv-linux/pull/124
|
||||
|
||||
[2] https://groups.google.com/a/groups.riscv.org/forum/#!topic/sw-dev/f19TmCNP6yA
|
||||
15
MAINTAINERS
15
MAINTAINERS
@@ -16714,6 +16714,15 @@ S: Maintained
|
||||
F: drivers/mtd/nand/raw/r852.c
|
||||
F: drivers/mtd/nand/raw/r852.h
|
||||
|
||||
RISC-V PMU DRIVERS
|
||||
M: Atish Patra <atishp@atishpatra.org>
|
||||
R: Anup Patel <anup@brainfault.org>
|
||||
L: linux-riscv@lists.infradead.org
|
||||
S: Supported
|
||||
F: drivers/perf/riscv_pmu.c
|
||||
F: drivers/perf/riscv_pmu_legacy.c
|
||||
F: drivers/perf/riscv_pmu_sbi.c
|
||||
|
||||
RISC-V ARCHITECTURE
|
||||
M: Paul Walmsley <paul.walmsley@sifive.com>
|
||||
M: Palmer Dabbelt <palmer@dabbelt.com>
|
||||
@@ -16728,8 +16737,10 @@ K: riscv
|
||||
|
||||
RISC-V/MICROCHIP POLARFIRE SOC SUPPORT
|
||||
M: Lewis Hanly <lewis.hanly@microchip.com>
|
||||
M: Conor Dooley <conor.dooley@microchip.com>
|
||||
L: linux-riscv@lists.infradead.org
|
||||
S: Supported
|
||||
F: arch/riscv/boot/dts/microchip/
|
||||
F: drivers/mailbox/mailbox-mpfs.c
|
||||
F: drivers/soc/microchip/
|
||||
F: include/soc/microchip/mpfs.h
|
||||
@@ -17026,9 +17037,7 @@ L: linux-s390@vger.kernel.org
|
||||
S: Supported
|
||||
W: http://www.ibm.com/developerworks/linux/linux390/
|
||||
F: Documentation/s390/vfio-ap.rst
|
||||
F: drivers/s390/crypto/vfio_ap_drv.c
|
||||
F: drivers/s390/crypto/vfio_ap_ops.c
|
||||
F: drivers/s390/crypto/vfio_ap_private.h
|
||||
F: drivers/s390/crypto/vfio_ap*
|
||||
|
||||
S390 VFIO-CCW DRIVER
|
||||
M: Eric Farman <farman@linux.ibm.com>
|
||||
|
||||
@@ -202,6 +202,9 @@ config HAVE_FUNCTION_ERROR_INJECTION
|
||||
config HAVE_NMI
|
||||
bool
|
||||
|
||||
config HAVE_FUNCTION_DESCRIPTORS
|
||||
bool
|
||||
|
||||
config TRACE_IRQFLAGS_SUPPORT
|
||||
bool
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ config IA64
|
||||
select HAVE_SETUP_PER_CPU_AREA
|
||||
select TTY
|
||||
select HAVE_ARCH_TRACEHOOK
|
||||
select HAVE_FUNCTION_DESCRIPTORS
|
||||
select HAVE_VIRT_CPU_ACCOUNTING
|
||||
select HUGETLB_PAGE_SIZE_VARIABLE if HUGETLB_PAGE
|
||||
select VIRT_TO_BUS
|
||||
|
||||
@@ -226,7 +226,7 @@ struct got_entry {
|
||||
* Layout of the Function Descriptor
|
||||
*/
|
||||
struct fdesc {
|
||||
uint64_t ip;
|
||||
uint64_t addr;
|
||||
uint64_t gp;
|
||||
};
|
||||
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
|
||||
#include <linux/elf.h>
|
||||
#include <linux/uaccess.h>
|
||||
|
||||
typedef struct fdesc func_desc_t;
|
||||
|
||||
#include <asm-generic/sections.h>
|
||||
|
||||
extern char __phys_per_cpu_start[];
|
||||
@@ -27,25 +30,4 @@ extern char __start_gate_brl_fsys_bubble_down_patchlist[], __end_gate_brl_fsys_b
|
||||
extern char __start_unwind[], __end_unwind[];
|
||||
extern char __start_ivt_text[], __end_ivt_text[];
|
||||
|
||||
#define HAVE_DEREFERENCE_FUNCTION_DESCRIPTOR 1
|
||||
|
||||
#undef dereference_function_descriptor
|
||||
static inline void *dereference_function_descriptor(void *ptr)
|
||||
{
|
||||
struct fdesc *desc = ptr;
|
||||
void *p;
|
||||
|
||||
if (!get_kernel_nofault(p, (void *)&desc->ip))
|
||||
ptr = p;
|
||||
return ptr;
|
||||
}
|
||||
|
||||
#undef dereference_kernel_function_descriptor
|
||||
static inline void *dereference_kernel_function_descriptor(void *ptr)
|
||||
{
|
||||
if (ptr < (void *)__start_opd || ptr >= (void *)__end_opd)
|
||||
return ptr;
|
||||
return dereference_function_descriptor(ptr);
|
||||
}
|
||||
|
||||
#endif /* _ASM_IA64_SECTIONS_H */
|
||||
|
||||
@@ -602,15 +602,15 @@ get_fdesc (struct module *mod, uint64_t value, int *okp)
|
||||
return value;
|
||||
|
||||
/* Look for existing function descriptor. */
|
||||
while (fdesc->ip) {
|
||||
if (fdesc->ip == value)
|
||||
while (fdesc->addr) {
|
||||
if (fdesc->addr == value)
|
||||
return (uint64_t)fdesc;
|
||||
if ((uint64_t) ++fdesc >= mod->arch.opd->sh_addr + mod->arch.opd->sh_size)
|
||||
BUG();
|
||||
}
|
||||
|
||||
/* Create new one */
|
||||
fdesc->ip = value;
|
||||
fdesc->addr = value;
|
||||
fdesc->gp = mod->arch.gp;
|
||||
return (uint64_t) fdesc;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ platform-$(CONFIG_SIBYTE_SB1250) += sibyte/
|
||||
platform-$(CONFIG_SIBYTE_BCM1x55) += sibyte/
|
||||
platform-$(CONFIG_SIBYTE_BCM1x80) += sibyte/
|
||||
platform-$(CONFIG_SNI_RM) += sni/
|
||||
platform-$(CONFIG_MACH_TX39XX) += txx9/
|
||||
platform-$(CONFIG_MACH_TX49XX) += txx9/
|
||||
platform-$(CONFIG_MACH_VR41XX) += vr41xx/
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ config MIPS
|
||||
default y
|
||||
select ARCH_32BIT_OFF_T if !64BIT
|
||||
select ARCH_BINFMT_ELF_STATE if MIPS_FP_SUPPORT
|
||||
select ARCH_HAS_CURRENT_STACK_POINTER if !CC_IS_CLANG || CLANG_VERSION >= 140000
|
||||
select ARCH_HAS_DEBUG_VIRTUAL if !64BIT
|
||||
select ARCH_HAS_FORTIFY_SOURCE
|
||||
select ARCH_HAS_KCOV
|
||||
@@ -101,6 +102,7 @@ config MIPS
|
||||
select TRACE_IRQFLAGS_SUPPORT
|
||||
select VIRT_TO_BUS
|
||||
select ARCH_HAS_ELFCORE_COMPAT
|
||||
select HAVE_ARCH_KCSAN if 64BIT
|
||||
|
||||
config MIPS_FIXUP_BIGPHYS_ADDR
|
||||
bool
|
||||
@@ -511,6 +513,7 @@ config MACH_LOONGSON64
|
||||
select USE_OF
|
||||
select BUILTIN_DTB
|
||||
select PCI_HOST_GENERIC
|
||||
select HAVE_ARCH_NODEDATA_EXTENSION if NUMA
|
||||
help
|
||||
This enables the support of Loongson-2/3 family of machines.
|
||||
|
||||
@@ -707,6 +710,7 @@ config SGI_IP27
|
||||
select WAR_R10000_LLSC
|
||||
select MIPS_L1_CACHE_SHIFT_7
|
||||
select NUMA
|
||||
select HAVE_ARCH_NODEDATA_EXTENSION
|
||||
help
|
||||
This are the SGI Origin 200, Origin 2000 and Onyx 2 Graphics
|
||||
workstations. To compile a Linux kernel that runs on these, say Y
|
||||
@@ -926,9 +930,6 @@ config SNI_RM
|
||||
Technology and now in turn merged with Fujitsu. Say Y here to
|
||||
support this machine type.
|
||||
|
||||
config MACH_TX39XX
|
||||
bool "Toshiba TX39 series based machines"
|
||||
|
||||
config MACH_TX49XX
|
||||
bool "Toshiba TX49 series based machines"
|
||||
select WAR_TX49XX_ICACHE_INDEX_INV
|
||||
@@ -1343,19 +1344,14 @@ config LOONGSON3_ENHANCEMENT
|
||||
new Loongson-3 machines only, please say 'Y' here.
|
||||
|
||||
config CPU_LOONGSON3_WORKAROUNDS
|
||||
bool "Old Loongson-3 LLSC Workarounds"
|
||||
bool "Loongson-3 LLSC Workarounds"
|
||||
default y if SMP
|
||||
depends on CPU_LOONGSON64
|
||||
help
|
||||
Loongson-3 processors have the llsc issues which require workarounds.
|
||||
Without workarounds the system may hang unexpectedly.
|
||||
|
||||
Newer Loongson-3 will fix these issues and no workarounds are needed.
|
||||
The workarounds have no significant side effect on them but may
|
||||
decrease the performance of the system so this option should be
|
||||
disabled unless the kernel is intended to be run on old systems.
|
||||
|
||||
If unsure, please say Y.
|
||||
Say Y, unless you know what you are doing.
|
||||
|
||||
config CPU_LOONGSON3_CPUCFG_EMULATION
|
||||
bool "Emulate the CPUCFG instruction on older Loongson cores"
|
||||
@@ -1583,12 +1579,6 @@ config CPU_R3000
|
||||
might be a safe bet. If the resulting kernel does not work,
|
||||
try to recompile with R3000.
|
||||
|
||||
config CPU_TX39XX
|
||||
bool "R39XX"
|
||||
depends on SYS_HAS_CPU_TX39XX
|
||||
select CPU_SUPPORTS_32BIT_KERNEL
|
||||
select CPU_R3K_TLB
|
||||
|
||||
config CPU_VR41XX
|
||||
bool "R41xx"
|
||||
depends on SYS_HAS_CPU_VR41XX
|
||||
@@ -1915,9 +1905,6 @@ config SYS_HAS_CPU_P5600
|
||||
config SYS_HAS_CPU_R3000
|
||||
bool
|
||||
|
||||
config SYS_HAS_CPU_TX39XX
|
||||
bool
|
||||
|
||||
config SYS_HAS_CPU_VR41XX
|
||||
bool
|
||||
|
||||
@@ -2148,7 +2135,7 @@ config PAGE_SIZE_8KB
|
||||
|
||||
config PAGE_SIZE_16KB
|
||||
bool "16kB"
|
||||
depends on !CPU_R3000 && !CPU_TX39XX
|
||||
depends on !CPU_R3000
|
||||
help
|
||||
Using 16kB page size will result in higher performance kernel at
|
||||
the price of higher memory consumption. This option is available on
|
||||
@@ -2167,7 +2154,7 @@ config PAGE_SIZE_32KB
|
||||
|
||||
config PAGE_SIZE_64KB
|
||||
bool "64kB"
|
||||
depends on !CPU_R3000 && !CPU_TX39XX
|
||||
depends on !CPU_R3000
|
||||
help
|
||||
Using 64kB page size will result in higher performance kernel at
|
||||
the price of higher memory consumption. This option is available on
|
||||
@@ -2235,7 +2222,7 @@ config CPU_HAS_PREFETCH
|
||||
|
||||
config CPU_GENERIC_DUMP_TLB
|
||||
bool
|
||||
default y if !(CPU_R3000 || CPU_TX39XX)
|
||||
default y if !CPU_R3000
|
||||
|
||||
config MIPS_FP_SUPPORT
|
||||
bool "Floating Point support" if EXPERT
|
||||
@@ -2255,7 +2242,7 @@ config MIPS_FP_SUPPORT
|
||||
config CPU_R2300_FPU
|
||||
bool
|
||||
depends on MIPS_FP_SUPPORT
|
||||
default y if CPU_R3000 || CPU_TX39XX
|
||||
default y if CPU_R3000
|
||||
|
||||
config CPU_R3K_TLB
|
||||
bool
|
||||
@@ -2520,13 +2507,51 @@ config CPU_HAS_SYNC
|
||||
#
|
||||
# CPU non-features
|
||||
#
|
||||
|
||||
# Work around the "daddi" and "daddiu" CPU errata:
|
||||
#
|
||||
# - The `daddi' instruction fails to trap on overflow.
|
||||
# "MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0",
|
||||
# erratum #23
|
||||
#
|
||||
# - The `daddiu' instruction can produce an incorrect result.
|
||||
# "MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0",
|
||||
# erratum #41
|
||||
# "MIPS R4000MC Errata, Processor Revision 2.2 and 3.0", erratum
|
||||
# #15
|
||||
# "MIPS R4400PC/SC Errata, Processor Revision 1.0", erratum #7
|
||||
# "MIPS R4400MC Errata, Processor Revision 1.0", erratum #5
|
||||
config CPU_DADDI_WORKAROUNDS
|
||||
bool
|
||||
|
||||
# Work around certain R4000 CPU errata (as implemented by GCC):
|
||||
#
|
||||
# - A double-word or a variable shift may give an incorrect result
|
||||
# if executed immediately after starting an integer division:
|
||||
# "MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0",
|
||||
# erratum #28
|
||||
# "MIPS R4000MC Errata, Processor Revision 2.2 and 3.0", erratum
|
||||
# #19
|
||||
#
|
||||
# - A double-word or a variable shift may give an incorrect result
|
||||
# if executed while an integer multiplication is in progress:
|
||||
# "MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0",
|
||||
# errata #16 & #28
|
||||
#
|
||||
# - An integer division may give an incorrect result if started in
|
||||
# a delay slot of a taken branch or a jump:
|
||||
# "MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0",
|
||||
# erratum #52
|
||||
config CPU_R4000_WORKAROUNDS
|
||||
bool
|
||||
select CPU_R4400_WORKAROUNDS
|
||||
|
||||
# Work around certain R4400 CPU errata (as implemented by GCC):
|
||||
#
|
||||
# - A double-word or a variable shift may give an incorrect result
|
||||
# if executed immediately after starting an integer division:
|
||||
# "MIPS R4400MC Errata, Processor Revision 1.0", erratum #10
|
||||
# "MIPS R4400MC Errata, Processor Revision 2.0 & 3.0", erratum #4
|
||||
config CPU_R4400_WORKAROUNDS
|
||||
bool
|
||||
|
||||
@@ -2536,13 +2561,13 @@ config CPU_R4X00_BUGS64
|
||||
|
||||
config MIPS_ASID_SHIFT
|
||||
int
|
||||
default 6 if CPU_R3000 || CPU_TX39XX
|
||||
default 6 if CPU_R3000
|
||||
default 0
|
||||
|
||||
config MIPS_ASID_BITS
|
||||
int
|
||||
default 0 if MIPS_ASID_BITS_VARIABLE
|
||||
default 6 if CPU_R3000 || CPU_TX39XX
|
||||
default 6 if CPU_R3000
|
||||
default 8
|
||||
|
||||
config MIPS_ASID_BITS_VARIABLE
|
||||
@@ -2685,6 +2710,9 @@ config NUMA
|
||||
config SYS_SUPPORTS_NUMA
|
||||
bool
|
||||
|
||||
config HAVE_ARCH_NODEDATA_EXTENSION
|
||||
bool
|
||||
|
||||
config RELOCATABLE
|
||||
bool "Relocatable kernel"
|
||||
depends on SYS_SUPPORTS_RELOCATABLE
|
||||
@@ -3202,6 +3230,10 @@ config MIPS32_N32
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
config CC_HAS_MNO_BRANCH_LIKELY
|
||||
def_bool y
|
||||
depends on $(cc-option,-mno-branch-likely)
|
||||
|
||||
menu "Power management options"
|
||||
|
||||
config ARCH_HIBERNATION_POSSIBLE
|
||||
|
||||
@@ -158,7 +158,6 @@ cflags-y += $(call as-option,-Wa$(comma)-mno-fix-loongson3-llsc,)
|
||||
# CPU-dependent compiler/assembler options for optimization.
|
||||
#
|
||||
cflags-$(CONFIG_CPU_R3000) += -march=r3000
|
||||
cflags-$(CONFIG_CPU_TX39XX) += -march=r3900
|
||||
cflags-$(CONFIG_CPU_R4300) += -march=r4300 -Wa,--trap
|
||||
cflags-$(CONFIG_CPU_VR41XX) += -march=r4100 -Wa,--trap
|
||||
cflags-$(CONFIG_CPU_R4X00) += -march=r4600 -Wa,--trap
|
||||
@@ -340,14 +339,12 @@ drivers-$(CONFIG_PM) += arch/mips/power/
|
||||
boot-y := vmlinux.bin
|
||||
boot-y += vmlinux.ecoff
|
||||
boot-y += vmlinux.srec
|
||||
ifeq ($(shell expr $(load-y) \< 0xffffffff80000000 2> /dev/null), 0)
|
||||
boot-y += uImage
|
||||
boot-y += uImage.bin
|
||||
boot-y += uImage.bz2
|
||||
boot-y += uImage.gz
|
||||
boot-y += uImage.lzma
|
||||
boot-y += uImage.lzo
|
||||
endif
|
||||
boot-y += vmlinux.itb
|
||||
boot-y += vmlinux.gz.itb
|
||||
boot-y += vmlinux.bz2.itb
|
||||
@@ -359,9 +356,7 @@ bootz-y := vmlinuz
|
||||
bootz-y += vmlinuz.bin
|
||||
bootz-y += vmlinuz.ecoff
|
||||
bootz-y += vmlinuz.srec
|
||||
ifeq ($(shell expr $(zload-y) \< 0xffffffff80000000 2> /dev/null), 0)
|
||||
bootz-y += uzImage.bin
|
||||
endif
|
||||
bootz-y += vmlinuz.itb
|
||||
|
||||
#
|
||||
|
||||
@@ -112,7 +112,7 @@ static int ar2315_misc_irq_map(struct irq_domain *d, unsigned irq,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct irq_domain_ops ar2315_misc_irq_domain_ops = {
|
||||
static const struct irq_domain_ops ar2315_misc_irq_domain_ops = {
|
||||
.map = ar2315_misc_irq_map,
|
||||
};
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ static int ar5312_misc_irq_map(struct irq_domain *d, unsigned irq,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct irq_domain_ops ar5312_misc_irq_domain_ops = {
|
||||
static const struct irq_domain_ops ar5312_misc_irq_domain_ops = {
|
||||
.map = ar5312_misc_irq_map,
|
||||
};
|
||||
|
||||
|
||||
@@ -121,6 +121,7 @@ static void prom_putchar_init(void)
|
||||
case REV_ID_MAJOR_QCA9558:
|
||||
case REV_ID_MAJOR_TP9343:
|
||||
case REV_ID_MAJOR_QCA956X:
|
||||
case REV_ID_MAJOR_QCN550X:
|
||||
_prom_putchar = prom_putchar_ar71xx;
|
||||
break;
|
||||
|
||||
|
||||
@@ -168,6 +168,12 @@ static void __init ath79_detect_sys_type(void)
|
||||
rev = id & QCA956X_REV_ID_REVISION_MASK;
|
||||
break;
|
||||
|
||||
case REV_ID_MAJOR_QCN550X:
|
||||
ath79_soc = ATH79_SOC_QCA956X;
|
||||
chip = "550X";
|
||||
rev = id & QCA956X_REV_ID_REVISION_MASK;
|
||||
break;
|
||||
|
||||
case REV_ID_MAJOR_TP9343:
|
||||
ath79_soc = ATH79_SOC_TP9343;
|
||||
chip = "9343";
|
||||
@@ -263,8 +269,3 @@ void __init arch_init_irq(void)
|
||||
{
|
||||
irqchip_init();
|
||||
}
|
||||
|
||||
void __init device_tree_init(void)
|
||||
{
|
||||
unflatten_and_copy_device_tree();
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ KBUILD_AFLAGS := $(KBUILD_AFLAGS) -D__ASSEMBLY__ \
|
||||
KCOV_INSTRUMENT := n
|
||||
GCOV_PROFILE := n
|
||||
UBSAN_SANITIZE := n
|
||||
KCSAN_SANITIZE := n
|
||||
|
||||
# decompressor objects (linked with vmlinuz)
|
||||
vmlinuzobjs-y := $(obj)/head.o $(obj)/decompress.o $(obj)/string.o $(obj)/bswapsi.o
|
||||
|
||||
@@ -26,7 +26,7 @@ unsigned long free_mem_ptr;
|
||||
unsigned long free_mem_end_ptr;
|
||||
|
||||
/* The linker tells us where the image is. */
|
||||
extern unsigned char __image_begin, __image_end;
|
||||
extern unsigned char __image_begin[], __image_end[];
|
||||
|
||||
/* debug interfaces */
|
||||
#ifdef CONFIG_DEBUG_ZBOOT
|
||||
@@ -91,9 +91,9 @@ void decompress_kernel(unsigned long boot_heap_start)
|
||||
{
|
||||
unsigned long zimage_start, zimage_size;
|
||||
|
||||
zimage_start = (unsigned long)(&__image_begin);
|
||||
zimage_size = (unsigned long)(&__image_end) -
|
||||
(unsigned long)(&__image_begin);
|
||||
zimage_start = (unsigned long)(__image_begin);
|
||||
zimage_size = (unsigned long)(__image_end) -
|
||||
(unsigned long)(__image_begin);
|
||||
|
||||
puts("zimage at: ");
|
||||
puthex(zimage_start);
|
||||
@@ -121,7 +121,7 @@ void decompress_kernel(unsigned long boot_heap_start)
|
||||
dtb_size = fdt_totalsize((void *)&__appended_dtb);
|
||||
|
||||
/* last four bytes is always image size in little endian */
|
||||
image_size = get_unaligned_le32((void *)&__image_end - 4);
|
||||
image_size = get_unaligned_le32((void *)__image_end - 4);
|
||||
|
||||
/* The device tree's address must be properly aligned */
|
||||
image_size = ALIGN(image_size, STRUCT_ALIGNMENT);
|
||||
|
||||
@@ -510,7 +510,7 @@
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
eth0_addr: eth-mac-addr@0x22 {
|
||||
eth0_addr: eth-mac-addr@22 {
|
||||
reg = <0x22 0x6>;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1274,13 +1274,13 @@ static int octeon_irq_gpio_map(struct irq_domain *d,
|
||||
return r;
|
||||
}
|
||||
|
||||
static struct irq_domain_ops octeon_irq_domain_ciu_ops = {
|
||||
static const struct irq_domain_ops octeon_irq_domain_ciu_ops = {
|
||||
.map = octeon_irq_ciu_map,
|
||||
.unmap = octeon_irq_free_cd,
|
||||
.xlate = octeon_irq_ciu_xlat,
|
||||
};
|
||||
|
||||
static struct irq_domain_ops octeon_irq_domain_gpio_ops = {
|
||||
static const struct irq_domain_ops octeon_irq_domain_gpio_ops = {
|
||||
.map = octeon_irq_gpio_map,
|
||||
.unmap = octeon_irq_free_cd,
|
||||
.xlate = octeon_irq_gpio_xlat,
|
||||
@@ -1974,7 +1974,7 @@ static int octeon_irq_ciu2_map(struct irq_domain *d,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct irq_domain_ops octeon_irq_domain_ciu2_ops = {
|
||||
static const struct irq_domain_ops octeon_irq_domain_ciu2_ops = {
|
||||
.map = octeon_irq_ciu2_map,
|
||||
.unmap = octeon_irq_free_cd,
|
||||
.xlate = octeon_irq_ciu2_xlat,
|
||||
@@ -2226,7 +2226,7 @@ static int octeon_irq_cib_map(struct irq_domain *d,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct irq_domain_ops octeon_irq_domain_cib_ops = {
|
||||
static const struct irq_domain_ops octeon_irq_domain_cib_ops = {
|
||||
.map = octeon_irq_cib_map,
|
||||
.unmap = octeon_irq_free_cd,
|
||||
.xlate = octeon_irq_cib_xlat,
|
||||
@@ -2578,7 +2578,7 @@ static int octeon_irq_ciu3_map(struct irq_domain *d,
|
||||
return octeon_irq_ciu3_mapx(d, virq, hw, &octeon_irq_chip_ciu3);
|
||||
}
|
||||
|
||||
static struct irq_domain_ops octeon_dflt_domain_ciu3_ops = {
|
||||
static const struct irq_domain_ops octeon_dflt_domain_ciu3_ops = {
|
||||
.map = octeon_irq_ciu3_map,
|
||||
.unmap = octeon_irq_free_cd,
|
||||
.xlate = octeon_irq_ciu3_xlat,
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
CONFIG_SYSVIPC=y
|
||||
CONFIG_LOG_BUF_SHIFT=14
|
||||
CONFIG_EXPERT=y
|
||||
CONFIG_SLAB=y
|
||||
CONFIG_MACH_TX39XX=y
|
||||
CONFIG_TOSHIBA_JMR3927=y
|
||||
# CONFIG_SECCOMP is not set
|
||||
CONFIG_PCI=y
|
||||
CONFIG_NET=y
|
||||
CONFIG_PACKET=y
|
||||
CONFIG_UNIX=y
|
||||
CONFIG_INET=y
|
||||
CONFIG_IP_PNP=y
|
||||
CONFIG_IP_PNP_BOOTP=y
|
||||
# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
|
||||
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
|
||||
# CONFIG_INET_XFRM_MODE_BEET is not set
|
||||
# CONFIG_INET_DIAG is not set
|
||||
# CONFIG_IPV6 is not set
|
||||
CONFIG_MTD=y
|
||||
CONFIG_MTD_CMDLINE_PARTS=y
|
||||
CONFIG_MTD_CFI=y
|
||||
CONFIG_MTD_JEDECPROBE=y
|
||||
CONFIG_MTD_CFI_AMDSTD=y
|
||||
CONFIG_MTD_PHYSMAP=y
|
||||
CONFIG_NETDEVICES=y
|
||||
CONFIG_TC35815=y
|
||||
# CONFIG_INPUT is not set
|
||||
# CONFIG_SERIO is not set
|
||||
# CONFIG_VT is not set
|
||||
# CONFIG_UNIX98_PTYS is not set
|
||||
CONFIG_SERIAL_NONSTANDARD=y
|
||||
CONFIG_SERIAL_TXX9_CONSOLE=y
|
||||
CONFIG_SERIAL_TXX9_STDSERIAL=y
|
||||
# CONFIG_HW_RANDOM is not set
|
||||
# CONFIG_HWMON is not set
|
||||
CONFIG_WATCHDOG=y
|
||||
CONFIG_TXX9_WDT=y
|
||||
# CONFIG_USB_SUPPORT is not set
|
||||
CONFIG_NEW_LEDS=y
|
||||
CONFIG_LEDS_CLASS=y
|
||||
CONFIG_LEDS_GPIO=y
|
||||
CONFIG_LEDS_TRIGGERS=y
|
||||
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
|
||||
CONFIG_RTC_CLASS=y
|
||||
CONFIG_RTC_DRV_DS1742=y
|
||||
CONFIG_PROC_KCORE=y
|
||||
# CONFIG_MISC_FILESYSTEMS is not set
|
||||
CONFIG_NFS_FS=y
|
||||
CONFIG_ROOT_NFS=y
|
||||
@@ -4,6 +4,7 @@ CONFIG_HIGH_RES_TIMERS=y
|
||||
CONFIG_LOG_BUF_SHIFT=15
|
||||
CONFIG_NAMESPACES=y
|
||||
CONFIG_RELAY=y
|
||||
CONFIG_BLK_DEV_INITRD=y
|
||||
CONFIG_EXPERT=y
|
||||
# CONFIG_COMPAT_BRK is not set
|
||||
CONFIG_SLAB=y
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
*/
|
||||
mfc0 t0,CP0_CAUSE # get pending interrupts
|
||||
mfc0 t1,CP0_STATUS
|
||||
#ifdef CONFIG_32BIT
|
||||
#if defined(CONFIG_32BIT) && defined(CONFIG_MIPS_FP_SUPPORT)
|
||||
lw t2,cpu_fpu_mask
|
||||
#endif
|
||||
andi t0,ST0_IM # CAUSE.CE may be non-zero!
|
||||
@@ -139,7 +139,7 @@
|
||||
|
||||
beqz t0,spurious
|
||||
|
||||
#ifdef CONFIG_32BIT
|
||||
#if defined(CONFIG_32BIT) && defined(CONFIG_MIPS_FP_SUPPORT)
|
||||
and t2,t0
|
||||
bnez t2,fpu # handle FPU immediately
|
||||
#endif
|
||||
@@ -280,7 +280,7 @@ handle_it:
|
||||
j dec_irq_dispatch
|
||||
nop
|
||||
|
||||
#ifdef CONFIG_32BIT
|
||||
#if defined(CONFIG_32BIT) && defined(CONFIG_MIPS_FP_SUPPORT)
|
||||
fpu:
|
||||
lw t0,fpu_kstat_irq
|
||||
nop
|
||||
|
||||
@@ -6,4 +6,4 @@
|
||||
|
||||
lib-y += init.o memory.o cmdline.o identify.o console.o
|
||||
|
||||
lib-$(CONFIG_32BIT) += locore.o
|
||||
lib-$(CONFIG_CPU_R3000) += locore.o
|
||||
|
||||
@@ -746,7 +746,8 @@ void __init arch_init_irq(void)
|
||||
dec_interrupt[DEC_IRQ_HALT] = -1;
|
||||
|
||||
/* Register board interrupts: FPU and cascade. */
|
||||
if (dec_interrupt[DEC_IRQ_FPU] >= 0 && cpu_has_fpu) {
|
||||
if (IS_ENABLED(CONFIG_MIPS_FP_SUPPORT) &&
|
||||
dec_interrupt[DEC_IRQ_FPU] >= 0 && cpu_has_fpu) {
|
||||
struct irq_desc *desc_fpu;
|
||||
int irq_fpu;
|
||||
|
||||
|
||||
@@ -120,9 +120,6 @@
|
||||
#ifndef cpu_has_4k_cache
|
||||
#define cpu_has_4k_cache __isa_ge_or_opt(1, MIPS_CPU_4K_CACHE)
|
||||
#endif
|
||||
#ifndef cpu_has_tx39_cache
|
||||
#define cpu_has_tx39_cache __opt(MIPS_CPU_TX39_CACHE)
|
||||
#endif
|
||||
#ifndef cpu_has_octeon_cache
|
||||
#define cpu_has_octeon_cache 0
|
||||
#endif
|
||||
|
||||
@@ -105,12 +105,6 @@ static inline int __pure __get_cpu_type(const int cpu_type)
|
||||
case CPU_R3081E:
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SYS_HAS_CPU_TX39XX
|
||||
case CPU_TX3912:
|
||||
case CPU_TX3922:
|
||||
case CPU_TX3927:
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SYS_HAS_CPU_VR41XX
|
||||
case CPU_VR41XX:
|
||||
case CPU_VR4111:
|
||||
|
||||
@@ -309,11 +309,6 @@ enum cpu_type_enum {
|
||||
CPU_VR4122, CPU_VR4131, CPU_VR4133, CPU_VR4181, CPU_VR4181A, CPU_RM7000,
|
||||
CPU_SR71000, CPU_TX49XX,
|
||||
|
||||
/*
|
||||
* TX3900 class processors
|
||||
*/
|
||||
CPU_TX3912, CPU_TX3922, CPU_TX3927,
|
||||
|
||||
/*
|
||||
* MIPS32 class processors
|
||||
*/
|
||||
@@ -367,7 +362,6 @@ enum cpu_type_enum {
|
||||
#define MIPS_CPU_4KEX BIT_ULL( 1) /* "R4K" exception model */
|
||||
#define MIPS_CPU_3K_CACHE BIT_ULL( 2) /* R3000-style caches */
|
||||
#define MIPS_CPU_4K_CACHE BIT_ULL( 3) /* R4000-style caches */
|
||||
#define MIPS_CPU_TX39_CACHE BIT_ULL( 4) /* TX3900-style caches */
|
||||
#define MIPS_CPU_FPU BIT_ULL( 5) /* CPU has FPU */
|
||||
#define MIPS_CPU_32FPR BIT_ULL( 6) /* 32 dbl. prec. FP registers */
|
||||
#define MIPS_CPU_COUNTER BIT_ULL( 7) /* Cycle count/compare */
|
||||
|
||||
@@ -43,16 +43,11 @@
|
||||
*/
|
||||
#define REX_PROM_MAGIC 0x30464354
|
||||
|
||||
#ifdef CONFIG_64BIT
|
||||
|
||||
#define prom_is_rex(magic) 1 /* KN04 and KN05 are REX PROMs. */
|
||||
|
||||
#else /* !CONFIG_64BIT */
|
||||
|
||||
#define prom_is_rex(magic) ((magic) == REX_PROM_MAGIC)
|
||||
|
||||
#endif /* !CONFIG_64BIT */
|
||||
|
||||
/* KN04 and KN05 are REX PROMs, so only do the check for R3k systems. */
|
||||
static inline bool prom_is_rex(u32 magic)
|
||||
{
|
||||
return !IS_ENABLED(CONFIG_CPU_R3000) || magic == REX_PROM_MAGIC;
|
||||
}
|
||||
|
||||
/*
|
||||
* 3MIN/MAXINE PROM entry points for DS5000/1xx's, DS5000/xx's and
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#include <asm/compiler.h>
|
||||
#include <asm/errno.h>
|
||||
#include <asm/sync.h>
|
||||
#include <asm/war.h>
|
||||
|
||||
#define arch_futex_atomic_op_inuser arch_futex_atomic_op_inuser
|
||||
#define futex_atomic_cmpxchg_inatomic futex_atomic_cmpxchg_inatomic
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#ifndef __ASM_ISADEP_H
|
||||
#define __ASM_ISADEP_H
|
||||
|
||||
#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
|
||||
#if defined(CONFIG_CPU_R3000)
|
||||
/*
|
||||
* R2000 or R3000
|
||||
*/
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#define cpu_has_4kex 1
|
||||
#define cpu_has_3k_cache 0
|
||||
#define cpu_has_4k_cache 1
|
||||
#define cpu_has_tx39_cache 0
|
||||
#define cpu_has_sb1_cache 0
|
||||
#define cpu_has_fpu 0
|
||||
#define cpu_has_32fpr 0
|
||||
|
||||
@@ -862,6 +862,7 @@
|
||||
#define REV_ID_MAJOR_QCA9558 0x1130
|
||||
#define REV_ID_MAJOR_TP9343 0x0150
|
||||
#define REV_ID_MAJOR_QCA956X 0x1150
|
||||
#define REV_ID_MAJOR_QCN550X 0x2170
|
||||
|
||||
#define AR71XX_REV_ID_MINOR_MASK 0x3
|
||||
#define AR71XX_REV_ID_MINOR_AR7130 0x0
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
#define cpu_has_4kex 1
|
||||
#define cpu_has_3k_cache 0
|
||||
#define cpu_has_4k_cache 1
|
||||
#define cpu_has_tx39_cache 0
|
||||
#define cpu_has_sb1_cache 0
|
||||
#define cpu_has_fpu 0
|
||||
#define cpu_has_32fpr 0
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#define cpu_has_4kex 1
|
||||
#define cpu_has_3k_cache 0
|
||||
#define cpu_has_4k_cache 1
|
||||
#define cpu_has_tx39_cache 0
|
||||
#define cpu_has_fpu 0
|
||||
#define cpu_has_32fpr 0
|
||||
#define cpu_has_counter 1
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#define cpu_has_4kex 1
|
||||
#define cpu_has_3k_cache 0
|
||||
#define cpu_has_4k_cache 1
|
||||
#define cpu_has_tx39_cache 0
|
||||
#define cpu_has_fpu 0
|
||||
#define cpu_has_32fpr 0
|
||||
#define cpu_has_counter 1
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#define cpu_has_4kex 1
|
||||
#define cpu_has_3k_cache 0
|
||||
#define cpu_has_4k_cache 0
|
||||
#define cpu_has_tx39_cache 0
|
||||
#define cpu_has_counter 1
|
||||
#define cpu_has_watch 1
|
||||
#define cpu_has_divec 1
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#define cpu_has_4kex 1
|
||||
#define cpu_has_3k_cache 0
|
||||
#define cpu_has_4k_cache 1
|
||||
#define cpu_has_tx39_cache 0
|
||||
#define cpu_has_32fpr 1
|
||||
#define cpu_has_counter 1
|
||||
#define cpu_has_watch 0
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#define cpu_has_rixiex 0
|
||||
#define cpu_has_maar 0
|
||||
#define cpu_has_rw_llb 0
|
||||
#define cpu_has_tx39_cache 0
|
||||
#define cpu_has_divec 0
|
||||
#define cpu_has_prefetch 0
|
||||
#define cpu_has_mcheck 0
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#define cpu_has_4kex 1
|
||||
#define cpu_has_3k_cache 0
|
||||
#define cpu_has_4k_cache 1
|
||||
#define cpu_has_tx39_cache 0
|
||||
#define cpu_has_counter 0
|
||||
#define cpu_has_watch 1
|
||||
#define cpu_has_divec 1
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#define cpu_has_4kex 1
|
||||
#define cpu_has_3k_cache 0
|
||||
#define cpu_has_4k_cache 1
|
||||
#define cpu_has_tx39_cache 0
|
||||
#define cpu_has_fpu 1
|
||||
#define cpu_has_nofpuex 0
|
||||
#define cpu_has_32fpr 1
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#define cpu_has_4kex 1
|
||||
#define cpu_has_3k_cache 0
|
||||
#define cpu_has_4k_cache 1
|
||||
#define cpu_has_tx39_cache 0
|
||||
#define cpu_has_fpu 1
|
||||
#define cpu_has_nofpuex 0
|
||||
#define cpu_has_32fpr 1
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#define cpu_has_4kex 1
|
||||
#define cpu_has_3k_cache 0
|
||||
#define cpu_has_4k_cache 1
|
||||
#define cpu_has_tx39_cache 0
|
||||
#define cpu_has_sb1_cache 0
|
||||
#define cpu_has_fpu 0
|
||||
#define cpu_has_32fpr 0
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
#define cpu_has_mipsmt 0
|
||||
#define cpu_has_smartmips 0
|
||||
#define cpu_has_tlb 1
|
||||
#define cpu_has_tx39_cache 0
|
||||
#define cpu_has_vce 0
|
||||
#define cpu_has_veic 0
|
||||
#define cpu_has_vint 0
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
#define cpu_has_mipsmt 0
|
||||
#define cpu_has_smartmips 0
|
||||
#define cpu_has_tlb 1
|
||||
#define cpu_has_tx39_cache 0
|
||||
#define cpu_has_vce 0
|
||||
#define cpu_has_veic 0
|
||||
#define cpu_has_vint 0
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
#define cpu_has_4kex 1
|
||||
#define cpu_has_3k_cache 0
|
||||
#define cpu_has_4k_cache 1
|
||||
#define cpu_has_tx39_cache 0
|
||||
#define cpu_has_sb1_cache 0
|
||||
#define cpu_has_fpu 0
|
||||
#define cpu_has_32fpr 0
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#define cpu_has_4kex 1
|
||||
#define cpu_has_3k_cache 0
|
||||
#define cpu_has_4k_cache 1
|
||||
#define cpu_has_tx39_cache 0
|
||||
#define cpu_has_sb1_cache 0
|
||||
#define cpu_has_fpu 0
|
||||
#define cpu_has_32fpr 0
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
#define cpu_has_4kex 1
|
||||
#define cpu_has_3k_cache 0
|
||||
#define cpu_has_4k_cache 1
|
||||
#define cpu_has_tx39_cache 0
|
||||
#define cpu_has_sb1_cache 0
|
||||
#define cpu_has_fpu 0
|
||||
#define cpu_has_32fpr 0
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
#define cpu_has_4kex 1
|
||||
#define cpu_has_3k_cache 0
|
||||
#define cpu_has_4k_cache 1
|
||||
#define cpu_has_tx39_cache 0
|
||||
#define cpu_has_sb1_cache 0
|
||||
#define cpu_has_fpu 0
|
||||
#define cpu_has_32fpr 0
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#define cpu_has_4kex 1
|
||||
#define cpu_has_3k_cache 0
|
||||
#define cpu_has_4k_cache 1
|
||||
#define cpu_has_tx39_cache 0
|
||||
#define cpu_has_sb1_cache 0
|
||||
#define cpu_has_fpu 0
|
||||
#define cpu_has_32fpr 0
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#define cpu_has_4kex 1
|
||||
#define cpu_has_3k_cache 0
|
||||
#define cpu_has_4k_cache 1
|
||||
#define cpu_has_tx39_cache 0
|
||||
#define cpu_has_sb1_cache 0
|
||||
#define cpu_has_fpu 0
|
||||
#define cpu_has_32fpr 0
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
/*
|
||||
* include/asm-mips/mach-tx39xx/ioremap.h
|
||||
*/
|
||||
#ifndef __ASM_MACH_TX39XX_IOREMAP_H
|
||||
#define __ASM_MACH_TX39XX_IOREMAP_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
static inline void __iomem *plat_ioremap(phys_addr_t offset, unsigned long size,
|
||||
unsigned long flags)
|
||||
{
|
||||
#define TXX9_DIRECTMAP_BASE 0xff000000ul
|
||||
if (offset >= TXX9_DIRECTMAP_BASE &&
|
||||
offset < TXX9_DIRECTMAP_BASE + 0xff0000)
|
||||
return (void __iomem *)offset;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline int plat_iounmap(const volatile void __iomem *addr)
|
||||
{
|
||||
return (unsigned long)addr >= TXX9_DIRECTMAP_BASE;
|
||||
}
|
||||
|
||||
#endif /* __ASM_MACH_TX39XX_IOREMAP_H */
|
||||
@@ -1,24 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef __ASM_MACH_TX39XX_MANGLE_PORT_H
|
||||
#define __ASM_MACH_TX39XX_MANGLE_PORT_H
|
||||
|
||||
#if defined(CONFIG_TOSHIBA_JMR3927)
|
||||
extern unsigned long (*__swizzle_addr_b)(unsigned long port);
|
||||
#define NEEDS_TXX9_SWIZZLE_ADDR_B
|
||||
#else
|
||||
#define __swizzle_addr_b(port) (port)
|
||||
#endif
|
||||
#define __swizzle_addr_w(port) (port)
|
||||
#define __swizzle_addr_l(port) (port)
|
||||
#define __swizzle_addr_q(port) (port)
|
||||
|
||||
#define ioswabb(a, x) (x)
|
||||
#define __mem_ioswabb(a, x) (x)
|
||||
#define ioswabw(a, x) le16_to_cpu((__force __le16)(x))
|
||||
#define __mem_ioswabw(a, x) (x)
|
||||
#define ioswabl(a, x) le32_to_cpu((__force __le32)(x))
|
||||
#define __mem_ioswabl(a, x) (x)
|
||||
#define ioswabq(a, x) le64_to_cpu((__force __le64)(x))
|
||||
#define __mem_ioswabq(a, x) (x)
|
||||
|
||||
#endif /* __ASM_MACH_TX39XX_MANGLE_PORT_H */
|
||||
@@ -1,17 +0,0 @@
|
||||
/*
|
||||
* 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) 1994 - 1999, 2000, 03, 04 Ralf Baechle
|
||||
* Copyright (C) 2000, 2002 Maciej W. Rozycki
|
||||
* Copyright (C) 1990, 1999, 2000 Silicon Graphics, Inc.
|
||||
*/
|
||||
#ifndef _ASM_TX39XX_SPACES_H
|
||||
#define _ASM_TX39XX_SPACES_H
|
||||
|
||||
#define FIXADDR_TOP ((unsigned long)(long)(int)0xfefe0000)
|
||||
|
||||
#include <asm/mach-generic/spaces.h>
|
||||
|
||||
#endif /* __ASM_TX39XX_SPACES_H */
|
||||
@@ -9,7 +9,6 @@
|
||||
#define _ASM_MIPSMTREGS_H
|
||||
|
||||
#include <asm/mipsregs.h>
|
||||
#include <asm/war.h>
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#include <linux/types.h>
|
||||
#include <asm/hazards.h>
|
||||
#include <asm/isa-rev.h>
|
||||
#include <asm/war.h>
|
||||
|
||||
/*
|
||||
* The following macros are especially useful for __asm__
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
#define __HAVE_ARCH_PMD_ALLOC_ONE
|
||||
#define __HAVE_ARCH_PUD_ALLOC_ONE
|
||||
#define __HAVE_ARCH_PGD_FREE
|
||||
#include <asm-generic/pgalloc.h>
|
||||
|
||||
static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd,
|
||||
@@ -48,6 +49,11 @@ static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
|
||||
extern void pgd_init(unsigned long page);
|
||||
extern pgd_t *pgd_alloc(struct mm_struct *mm);
|
||||
|
||||
static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
|
||||
{
|
||||
free_pages((unsigned long)pgd, PGD_ORDER);
|
||||
}
|
||||
|
||||
#define __pte_free_tlb(tlb,pte,address) \
|
||||
do { \
|
||||
pgtable_pte_page_dtor(pte); \
|
||||
|
||||
@@ -20,9 +20,9 @@ struct boot_param_header;
|
||||
extern void __dt_setup_arch(void *bph);
|
||||
extern int __dt_register_buses(const char *bus0, const char *bus1);
|
||||
|
||||
#else /* CONFIG_OF */
|
||||
#else /* !CONFIG_USE_OF */
|
||||
static inline void device_tree_init(void) { }
|
||||
#endif /* CONFIG_OF */
|
||||
#endif /* !CONFIG_USE_OF */
|
||||
|
||||
extern char *mips_get_machine_name(void);
|
||||
extern void mips_set_machine_name(const char *name);
|
||||
|
||||
@@ -16,7 +16,7 @@ static inline void setup_8250_early_printk_port(unsigned long base,
|
||||
unsigned int reg_shift, unsigned int timeout) {}
|
||||
#endif
|
||||
|
||||
extern void set_handler(unsigned long offset, void *addr, unsigned long len);
|
||||
void set_handler(unsigned long offset, const void *addr, unsigned long len);
|
||||
extern void set_uncached_handler(unsigned long offset, void *addr, unsigned long len);
|
||||
|
||||
typedef void (*vi_handler_t)(void);
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
cfi_restore \reg \offset \docfi
|
||||
.endm
|
||||
|
||||
#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
|
||||
#if defined(CONFIG_CPU_R3000)
|
||||
#define STATMASK 0x3f
|
||||
#else
|
||||
#define STATMASK 0x1f
|
||||
@@ -349,7 +349,7 @@
|
||||
cfi_ld sp, PT_R29, \docfi
|
||||
.endm
|
||||
|
||||
#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
|
||||
#if defined(CONFIG_CPU_R3000)
|
||||
|
||||
.macro RESTORE_SOME docfi=0
|
||||
.set push
|
||||
@@ -478,7 +478,7 @@
|
||||
.macro KMODE
|
||||
mfc0 t0, CP0_STATUS
|
||||
li t1, ST0_KERNEL_CUMASK | (STATMASK & ~1)
|
||||
#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
|
||||
#if defined(CONFIG_CPU_R3000)
|
||||
andi t2, t0, ST0_IEP
|
||||
srl t2, 2
|
||||
or t0, t2
|
||||
|
||||
@@ -69,6 +69,10 @@ static inline struct thread_info *current_thread_info(void)
|
||||
return __current_thread_info;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_ARCH_HAS_CURRENT_STACK_POINTER
|
||||
register unsigned long current_stack_pointer __asm__("sp");
|
||||
#endif
|
||||
|
||||
#endif /* !__ASSEMBLY__ */
|
||||
|
||||
/* thread information allocation */
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifdef CONFIG_TOSHIBA_JMR3927
|
||||
BOARD_VEC(jmr3927_vec)
|
||||
#endif
|
||||
#ifdef CONFIG_TOSHIBA_RBTX4927
|
||||
BOARD_VEC(rbtx4927_vec)
|
||||
BOARD_VEC(rbtx4937_vec)
|
||||
|
||||
@@ -1,179 +0,0 @@
|
||||
/*
|
||||
* Defines for the TJSYS JMR-TX3927
|
||||
*
|
||||
* 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) 2000-2001 Toshiba Corporation
|
||||
*/
|
||||
#ifndef __ASM_TXX9_JMR3927_H
|
||||
#define __ASM_TXX9_JMR3927_H
|
||||
|
||||
#include <asm/txx9/tx3927.h>
|
||||
#include <asm/addrspace.h>
|
||||
#include <asm/txx9irq.h>
|
||||
|
||||
/* CS */
|
||||
#define JMR3927_ROMCE0 0x1fc00000 /* 4M */
|
||||
#define JMR3927_ROMCE1 0x1e000000 /* 4M */
|
||||
#define JMR3927_ROMCE2 0x14000000 /* 16M */
|
||||
#define JMR3927_ROMCE3 0x10000000 /* 64M */
|
||||
#define JMR3927_ROMCE5 0x1d000000 /* 4M */
|
||||
#define JMR3927_SDCS0 0x00000000 /* 32M */
|
||||
#define JMR3927_SDCS1 0x02000000 /* 32M */
|
||||
/* PCI Direct Mappings */
|
||||
|
||||
#define JMR3927_PCIMEM 0x08000000
|
||||
#define JMR3927_PCIMEM_SIZE 0x08000000 /* 128M */
|
||||
#define JMR3927_PCIIO 0x15000000
|
||||
#define JMR3927_PCIIO_SIZE 0x01000000 /* 16M */
|
||||
|
||||
#define JMR3927_SDRAM_SIZE 0x02000000 /* 32M */
|
||||
#define JMR3927_PORT_BASE KSEG1
|
||||
|
||||
/* Address map (virtual address) */
|
||||
#define JMR3927_ROM0_BASE (KSEG1 + JMR3927_ROMCE0)
|
||||
#define JMR3927_ROM1_BASE (KSEG1 + JMR3927_ROMCE1)
|
||||
#define JMR3927_IOC_BASE (KSEG1 + JMR3927_ROMCE2)
|
||||
#define JMR3927_PCIMEM_BASE (KSEG1 + JMR3927_PCIMEM)
|
||||
#define JMR3927_PCIIO_BASE (KSEG1 + JMR3927_PCIIO)
|
||||
|
||||
#define JMR3927_IOC_REV_ADDR (JMR3927_IOC_BASE + 0x00000000)
|
||||
#define JMR3927_IOC_NVRAMB_ADDR (JMR3927_IOC_BASE + 0x00010000)
|
||||
#define JMR3927_IOC_LED_ADDR (JMR3927_IOC_BASE + 0x00020000)
|
||||
#define JMR3927_IOC_DIPSW_ADDR (JMR3927_IOC_BASE + 0x00030000)
|
||||
#define JMR3927_IOC_BREV_ADDR (JMR3927_IOC_BASE + 0x00040000)
|
||||
#define JMR3927_IOC_DTR_ADDR (JMR3927_IOC_BASE + 0x00050000)
|
||||
#define JMR3927_IOC_INTS1_ADDR (JMR3927_IOC_BASE + 0x00080000)
|
||||
#define JMR3927_IOC_INTS2_ADDR (JMR3927_IOC_BASE + 0x00090000)
|
||||
#define JMR3927_IOC_INTM_ADDR (JMR3927_IOC_BASE + 0x000a0000)
|
||||
#define JMR3927_IOC_INTP_ADDR (JMR3927_IOC_BASE + 0x000b0000)
|
||||
#define JMR3927_IOC_RESET_ADDR (JMR3927_IOC_BASE + 0x000f0000)
|
||||
|
||||
/* Flash ROM */
|
||||
#define JMR3927_FLASH_BASE (JMR3927_ROM0_BASE)
|
||||
#define JMR3927_FLASH_SIZE 0x00400000
|
||||
|
||||
/* bits for IOC_REV/IOC_BREV (high byte) */
|
||||
#define JMR3927_IDT_MASK 0xfc
|
||||
#define JMR3927_REV_MASK 0x03
|
||||
#define JMR3927_IOC_IDT 0xe0
|
||||
|
||||
/* bits for IOC_INTS1/IOC_INTS2/IOC_INTM/IOC_INTP (high byte) */
|
||||
#define JMR3927_IOC_INTB_PCIA 0
|
||||
#define JMR3927_IOC_INTB_PCIB 1
|
||||
#define JMR3927_IOC_INTB_PCIC 2
|
||||
#define JMR3927_IOC_INTB_PCID 3
|
||||
#define JMR3927_IOC_INTB_MODEM 4
|
||||
#define JMR3927_IOC_INTB_INT6 5
|
||||
#define JMR3927_IOC_INTB_INT7 6
|
||||
#define JMR3927_IOC_INTB_SOFT 7
|
||||
#define JMR3927_IOC_INTF_PCIA (1 << JMR3927_IOC_INTF_PCIA)
|
||||
#define JMR3927_IOC_INTF_PCIB (1 << JMR3927_IOC_INTB_PCIB)
|
||||
#define JMR3927_IOC_INTF_PCIC (1 << JMR3927_IOC_INTB_PCIC)
|
||||
#define JMR3927_IOC_INTF_PCID (1 << JMR3927_IOC_INTB_PCID)
|
||||
#define JMR3927_IOC_INTF_MODEM (1 << JMR3927_IOC_INTB_MODEM)
|
||||
#define JMR3927_IOC_INTF_INT6 (1 << JMR3927_IOC_INTB_INT6)
|
||||
#define JMR3927_IOC_INTF_INT7 (1 << JMR3927_IOC_INTB_INT7)
|
||||
#define JMR3927_IOC_INTF_SOFT (1 << JMR3927_IOC_INTB_SOFT)
|
||||
|
||||
/* bits for IOC_RESET (high byte) */
|
||||
#define JMR3927_IOC_RESET_CPU 1
|
||||
#define JMR3927_IOC_RESET_PCI 2
|
||||
|
||||
#if defined(__BIG_ENDIAN)
|
||||
#define jmr3927_ioc_reg_out(d, a) ((*(volatile unsigned char *)(a)) = (d))
|
||||
#define jmr3927_ioc_reg_in(a) (*(volatile unsigned char *)(a))
|
||||
#elif defined(__LITTLE_ENDIAN)
|
||||
#define jmr3927_ioc_reg_out(d, a) ((*(volatile unsigned char *)((a)^1)) = (d))
|
||||
#define jmr3927_ioc_reg_in(a) (*(volatile unsigned char *)((a)^1))
|
||||
#else
|
||||
#error "No Endian"
|
||||
#endif
|
||||
|
||||
/* LED macro */
|
||||
#define jmr3927_led_set(n/*0-16*/) jmr3927_ioc_reg_out(~(n), JMR3927_IOC_LED_ADDR)
|
||||
|
||||
#define jmr3927_led_and_set(n/*0-16*/) jmr3927_ioc_reg_out((~(n)) & jmr3927_ioc_reg_in(JMR3927_IOC_LED_ADDR), JMR3927_IOC_LED_ADDR)
|
||||
|
||||
/* DIPSW4 macro */
|
||||
#define jmr3927_dipsw1() (gpio_get_value(11) == 0)
|
||||
#define jmr3927_dipsw2() (gpio_get_value(10) == 0)
|
||||
#define jmr3927_dipsw3() ((jmr3927_ioc_reg_in(JMR3927_IOC_DIPSW_ADDR) & 2) == 0)
|
||||
#define jmr3927_dipsw4() ((jmr3927_ioc_reg_in(JMR3927_IOC_DIPSW_ADDR) & 1) == 0)
|
||||
|
||||
/*
|
||||
* IRQ mappings
|
||||
*/
|
||||
|
||||
/* These are the virtual IRQ numbers, we divide all IRQ's into
|
||||
* 'spaces', the 'space' determines where and how to enable/disable
|
||||
* that particular IRQ on an JMR machine. Add new 'spaces' as new
|
||||
* IRQ hardware is supported.
|
||||
*/
|
||||
#define JMR3927_NR_IRQ_IRC 16 /* On-Chip IRC */
|
||||
#define JMR3927_NR_IRQ_IOC 8 /* PCI/MODEM/INT[6:7] */
|
||||
|
||||
#define JMR3927_IRQ_IRC TXX9_IRQ_BASE
|
||||
#define JMR3927_IRQ_IOC (JMR3927_IRQ_IRC + JMR3927_NR_IRQ_IRC)
|
||||
#define JMR3927_IRQ_END (JMR3927_IRQ_IOC + JMR3927_NR_IRQ_IOC)
|
||||
|
||||
#define JMR3927_IRQ_IRC_INT0 (JMR3927_IRQ_IRC + TX3927_IR_INT0)
|
||||
#define JMR3927_IRQ_IRC_INT1 (JMR3927_IRQ_IRC + TX3927_IR_INT1)
|
||||
#define JMR3927_IRQ_IRC_INT2 (JMR3927_IRQ_IRC + TX3927_IR_INT2)
|
||||
#define JMR3927_IRQ_IRC_INT3 (JMR3927_IRQ_IRC + TX3927_IR_INT3)
|
||||
#define JMR3927_IRQ_IRC_INT4 (JMR3927_IRQ_IRC + TX3927_IR_INT4)
|
||||
#define JMR3927_IRQ_IRC_INT5 (JMR3927_IRQ_IRC + TX3927_IR_INT5)
|
||||
#define JMR3927_IRQ_IRC_SIO0 (JMR3927_IRQ_IRC + TX3927_IR_SIO0)
|
||||
#define JMR3927_IRQ_IRC_SIO1 (JMR3927_IRQ_IRC + TX3927_IR_SIO1)
|
||||
#define JMR3927_IRQ_IRC_SIO(ch) (JMR3927_IRQ_IRC + TX3927_IR_SIO(ch))
|
||||
#define JMR3927_IRQ_IRC_DMA (JMR3927_IRQ_IRC + TX3927_IR_DMA)
|
||||
#define JMR3927_IRQ_IRC_PIO (JMR3927_IRQ_IRC + TX3927_IR_PIO)
|
||||
#define JMR3927_IRQ_IRC_PCI (JMR3927_IRQ_IRC + TX3927_IR_PCI)
|
||||
#define JMR3927_IRQ_IRC_TMR(ch) (JMR3927_IRQ_IRC + TX3927_IR_TMR(ch))
|
||||
#define JMR3927_IRQ_IOC_PCIA (JMR3927_IRQ_IOC + JMR3927_IOC_INTB_PCIA)
|
||||
#define JMR3927_IRQ_IOC_PCIB (JMR3927_IRQ_IOC + JMR3927_IOC_INTB_PCIB)
|
||||
#define JMR3927_IRQ_IOC_PCIC (JMR3927_IRQ_IOC + JMR3927_IOC_INTB_PCIC)
|
||||
#define JMR3927_IRQ_IOC_PCID (JMR3927_IRQ_IOC + JMR3927_IOC_INTB_PCID)
|
||||
#define JMR3927_IRQ_IOC_MODEM (JMR3927_IRQ_IOC + JMR3927_IOC_INTB_MODEM)
|
||||
#define JMR3927_IRQ_IOC_INT6 (JMR3927_IRQ_IOC + JMR3927_IOC_INTB_INT6)
|
||||
#define JMR3927_IRQ_IOC_INT7 (JMR3927_IRQ_IOC + JMR3927_IOC_INTB_INT7)
|
||||
#define JMR3927_IRQ_IOC_SOFT (JMR3927_IRQ_IOC + JMR3927_IOC_INTB_SOFT)
|
||||
|
||||
/* IOC (PCI, MODEM) */
|
||||
#define JMR3927_IRQ_IOCINT JMR3927_IRQ_IRC_INT1
|
||||
/* TC35815 100M Ether (JMR-TX3912:JPW4:2-3 Short) */
|
||||
#define JMR3927_IRQ_ETHER0 JMR3927_IRQ_IRC_INT3
|
||||
|
||||
/* Clocks */
|
||||
#define JMR3927_CORECLK 132710400 /* 132.7MHz */
|
||||
|
||||
/*
|
||||
* TX3927 Pin Configuration:
|
||||
*
|
||||
* PCFG bits Avail Dead
|
||||
* SELSIO[1:0]:11 RXD[1:0], TXD[1:0] PIO[6:3]
|
||||
* SELSIOC[0]:1 CTS[0], RTS[0] INT[5:4]
|
||||
* SELSIOC[1]:0,SELDSF:0, GSDAO[0],GPCST[3] CTS[1], RTS[1],DSF,
|
||||
* GDBGE* PIO[2:1]
|
||||
* SELDMA[2]:1 DMAREQ[2],DMAACK[2] PIO[13:12]
|
||||
* SELTMR[2:0]:000 TIMER[1:0]
|
||||
* SELCS:0,SELDMA[1]:0 PIO[11;10] SDCS_CE[7:6],
|
||||
* DMAREQ[1],DMAACK[1]
|
||||
* SELDMA[0]:1 DMAREQ[0],DMAACK[0] PIO[9:8]
|
||||
* SELDMA[3]:1 DMAREQ[3],DMAACK[3] PIO[15:14]
|
||||
* SELDONE:1 DMADONE PIO[7]
|
||||
*
|
||||
* Usable pins are:
|
||||
* RXD[1;0],TXD[1:0],CTS[0],RTS[0],
|
||||
* DMAREQ[0,2,3],DMAACK[0,2,3],DMADONE,PIO[0,10,11]
|
||||
* INT[3:0]
|
||||
*/
|
||||
|
||||
void jmr3927_prom_init(void);
|
||||
void jmr3927_irq_setup(void);
|
||||
struct pci_dev;
|
||||
int jmr3927_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin);
|
||||
|
||||
#endif /* __ASM_TXX9_JMR3927_H */
|
||||
@@ -1,341 +0,0 @@
|
||||
/*
|
||||
* 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) 2000 Toshiba Corporation
|
||||
*/
|
||||
#ifndef __ASM_TXX9_TX3927_H
|
||||
#define __ASM_TXX9_TX3927_H
|
||||
|
||||
#define TX3927_REG_BASE 0xfffe0000UL
|
||||
#define TX3927_REG_SIZE 0x00010000
|
||||
#define TX3927_SDRAMC_REG (TX3927_REG_BASE + 0x8000)
|
||||
#define TX3927_ROMC_REG (TX3927_REG_BASE + 0x9000)
|
||||
#define TX3927_DMA_REG (TX3927_REG_BASE + 0xb000)
|
||||
#define TX3927_IRC_REG (TX3927_REG_BASE + 0xc000)
|
||||
#define TX3927_PCIC_REG (TX3927_REG_BASE + 0xd000)
|
||||
#define TX3927_CCFG_REG (TX3927_REG_BASE + 0xe000)
|
||||
#define TX3927_NR_TMR 3
|
||||
#define TX3927_TMR_REG(ch) (TX3927_REG_BASE + 0xf000 + (ch) * 0x100)
|
||||
#define TX3927_NR_SIO 2
|
||||
#define TX3927_SIO_REG(ch) (TX3927_REG_BASE + 0xf300 + (ch) * 0x100)
|
||||
#define TX3927_PIO_REG (TX3927_REG_BASE + 0xf500)
|
||||
|
||||
struct tx3927_sdramc_reg {
|
||||
volatile unsigned long cr[8];
|
||||
volatile unsigned long tr[3];
|
||||
volatile unsigned long cmd;
|
||||
volatile unsigned long smrs[2];
|
||||
};
|
||||
|
||||
struct tx3927_romc_reg {
|
||||
volatile unsigned long cr[8];
|
||||
};
|
||||
|
||||
struct tx3927_dma_reg {
|
||||
struct tx3927_dma_ch_reg {
|
||||
volatile unsigned long cha;
|
||||
volatile unsigned long sar;
|
||||
volatile unsigned long dar;
|
||||
volatile unsigned long cntr;
|
||||
volatile unsigned long sair;
|
||||
volatile unsigned long dair;
|
||||
volatile unsigned long ccr;
|
||||
volatile unsigned long csr;
|
||||
} ch[4];
|
||||
volatile unsigned long dbr[8];
|
||||
volatile unsigned long tdhr;
|
||||
volatile unsigned long mcr;
|
||||
volatile unsigned long unused0;
|
||||
};
|
||||
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
#ifdef __BIG_ENDIAN
|
||||
#define endian_def_s2(e1, e2) \
|
||||
volatile unsigned short e1, e2
|
||||
#define endian_def_sb2(e1, e2, e3) \
|
||||
volatile unsigned short e1;volatile unsigned char e2, e3
|
||||
#define endian_def_b2s(e1, e2, e3) \
|
||||
volatile unsigned char e1, e2;volatile unsigned short e3
|
||||
#define endian_def_b4(e1, e2, e3, e4) \
|
||||
volatile unsigned char e1, e2, e3, e4
|
||||
#else
|
||||
#define endian_def_s2(e1, e2) \
|
||||
volatile unsigned short e2, e1
|
||||
#define endian_def_sb2(e1, e2, e3) \
|
||||
volatile unsigned char e3, e2;volatile unsigned short e1
|
||||
#define endian_def_b2s(e1, e2, e3) \
|
||||
volatile unsigned short e3;volatile unsigned char e2, e1
|
||||
#define endian_def_b4(e1, e2, e3, e4) \
|
||||
volatile unsigned char e4, e3, e2, e1
|
||||
#endif
|
||||
|
||||
struct tx3927_pcic_reg {
|
||||
endian_def_s2(did, vid);
|
||||
endian_def_s2(pcistat, pcicmd);
|
||||
endian_def_b4(cc, scc, rpli, rid);
|
||||
endian_def_b4(unused0, ht, mlt, cls);
|
||||
volatile unsigned long ioba; /* +10 */
|
||||
volatile unsigned long mba;
|
||||
volatile unsigned long unused1[5];
|
||||
endian_def_s2(svid, ssvid);
|
||||
volatile unsigned long unused2; /* +30 */
|
||||
endian_def_sb2(unused3, unused4, capptr);
|
||||
volatile unsigned long unused5;
|
||||
endian_def_b4(ml, mg, ip, il);
|
||||
volatile unsigned long unused6; /* +40 */
|
||||
volatile unsigned long istat;
|
||||
volatile unsigned long iim;
|
||||
volatile unsigned long rrt;
|
||||
volatile unsigned long unused7[3]; /* +50 */
|
||||
volatile unsigned long ipbmma;
|
||||
volatile unsigned long ipbioma; /* +60 */
|
||||
volatile unsigned long ilbmma;
|
||||
volatile unsigned long ilbioma;
|
||||
volatile unsigned long unused8[9];
|
||||
volatile unsigned long tc; /* +90 */
|
||||
volatile unsigned long tstat;
|
||||
volatile unsigned long tim;
|
||||
volatile unsigned long tccmd;
|
||||
volatile unsigned long pcirrt; /* +a0 */
|
||||
volatile unsigned long pcirrt_cmd;
|
||||
volatile unsigned long pcirrdt;
|
||||
volatile unsigned long unused9[3];
|
||||
volatile unsigned long tlboap;
|
||||
volatile unsigned long tlbiap;
|
||||
volatile unsigned long tlbmma; /* +c0 */
|
||||
volatile unsigned long tlbioma;
|
||||
volatile unsigned long sc_msg;
|
||||
volatile unsigned long sc_be;
|
||||
volatile unsigned long tbl; /* +d0 */
|
||||
volatile unsigned long unused10[3];
|
||||
volatile unsigned long pwmng; /* +e0 */
|
||||
volatile unsigned long pwmngs;
|
||||
volatile unsigned long unused11[6];
|
||||
volatile unsigned long req_trace; /* +100 */
|
||||
volatile unsigned long pbapmc;
|
||||
volatile unsigned long pbapms;
|
||||
volatile unsigned long pbapmim;
|
||||
volatile unsigned long bm; /* +110 */
|
||||
volatile unsigned long cpcibrs;
|
||||
volatile unsigned long cpcibgs;
|
||||
volatile unsigned long pbacs;
|
||||
volatile unsigned long iobas; /* +120 */
|
||||
volatile unsigned long mbas;
|
||||
volatile unsigned long lbc;
|
||||
volatile unsigned long lbstat;
|
||||
volatile unsigned long lbim; /* +130 */
|
||||
volatile unsigned long pcistatim;
|
||||
volatile unsigned long ica;
|
||||
volatile unsigned long icd;
|
||||
volatile unsigned long iiadp; /* +140 */
|
||||
volatile unsigned long iscdp;
|
||||
volatile unsigned long mmas;
|
||||
volatile unsigned long iomas;
|
||||
volatile unsigned long ipciaddr; /* +150 */
|
||||
volatile unsigned long ipcidata;
|
||||
volatile unsigned long ipcibe;
|
||||
};
|
||||
|
||||
struct tx3927_ccfg_reg {
|
||||
volatile unsigned long ccfg;
|
||||
volatile unsigned long crir;
|
||||
volatile unsigned long pcfg;
|
||||
volatile unsigned long tear;
|
||||
volatile unsigned long pdcr;
|
||||
};
|
||||
|
||||
/*
|
||||
* SDRAMC
|
||||
*/
|
||||
|
||||
/*
|
||||
* ROMC
|
||||
*/
|
||||
|
||||
/*
|
||||
* DMA
|
||||
*/
|
||||
/* bits for MCR */
|
||||
#define TX3927_DMA_MCR_EIS(ch) (0x10000000<<(ch))
|
||||
#define TX3927_DMA_MCR_DIS(ch) (0x01000000<<(ch))
|
||||
#define TX3927_DMA_MCR_RSFIF 0x00000080
|
||||
#define TX3927_DMA_MCR_FIFUM(ch) (0x00000008<<(ch))
|
||||
#define TX3927_DMA_MCR_LE 0x00000004
|
||||
#define TX3927_DMA_MCR_RPRT 0x00000002
|
||||
#define TX3927_DMA_MCR_MSTEN 0x00000001
|
||||
|
||||
/* bits for CCRn */
|
||||
#define TX3927_DMA_CCR_DBINH 0x04000000
|
||||
#define TX3927_DMA_CCR_SBINH 0x02000000
|
||||
#define TX3927_DMA_CCR_CHRST 0x01000000
|
||||
#define TX3927_DMA_CCR_RVBYTE 0x00800000
|
||||
#define TX3927_DMA_CCR_ACKPOL 0x00400000
|
||||
#define TX3927_DMA_CCR_REQPL 0x00200000
|
||||
#define TX3927_DMA_CCR_EGREQ 0x00100000
|
||||
#define TX3927_DMA_CCR_CHDN 0x00080000
|
||||
#define TX3927_DMA_CCR_DNCTL 0x00060000
|
||||
#define TX3927_DMA_CCR_EXTRQ 0x00010000
|
||||
#define TX3927_DMA_CCR_INTRQD 0x0000e000
|
||||
#define TX3927_DMA_CCR_INTENE 0x00001000
|
||||
#define TX3927_DMA_CCR_INTENC 0x00000800
|
||||
#define TX3927_DMA_CCR_INTENT 0x00000400
|
||||
#define TX3927_DMA_CCR_CHNEN 0x00000200
|
||||
#define TX3927_DMA_CCR_XFACT 0x00000100
|
||||
#define TX3927_DMA_CCR_SNOP 0x00000080
|
||||
#define TX3927_DMA_CCR_DSTINC 0x00000040
|
||||
#define TX3927_DMA_CCR_SRCINC 0x00000020
|
||||
#define TX3927_DMA_CCR_XFSZ(order) (((order) << 2) & 0x0000001c)
|
||||
#define TX3927_DMA_CCR_XFSZ_1W TX3927_DMA_CCR_XFSZ(2)
|
||||
#define TX3927_DMA_CCR_XFSZ_4W TX3927_DMA_CCR_XFSZ(4)
|
||||
#define TX3927_DMA_CCR_XFSZ_8W TX3927_DMA_CCR_XFSZ(5)
|
||||
#define TX3927_DMA_CCR_XFSZ_16W TX3927_DMA_CCR_XFSZ(6)
|
||||
#define TX3927_DMA_CCR_XFSZ_32W TX3927_DMA_CCR_XFSZ(7)
|
||||
#define TX3927_DMA_CCR_MEMIO 0x00000002
|
||||
#define TX3927_DMA_CCR_ONEAD 0x00000001
|
||||
|
||||
/* bits for CSRn */
|
||||
#define TX3927_DMA_CSR_CHNACT 0x00000100
|
||||
#define TX3927_DMA_CSR_ABCHC 0x00000080
|
||||
#define TX3927_DMA_CSR_NCHNC 0x00000040
|
||||
#define TX3927_DMA_CSR_NTRNFC 0x00000020
|
||||
#define TX3927_DMA_CSR_EXTDN 0x00000010
|
||||
#define TX3927_DMA_CSR_CFERR 0x00000008
|
||||
#define TX3927_DMA_CSR_CHERR 0x00000004
|
||||
#define TX3927_DMA_CSR_DESERR 0x00000002
|
||||
#define TX3927_DMA_CSR_SORERR 0x00000001
|
||||
|
||||
/*
|
||||
* IRC
|
||||
*/
|
||||
#define TX3927_IR_INT0 0
|
||||
#define TX3927_IR_INT1 1
|
||||
#define TX3927_IR_INT2 2
|
||||
#define TX3927_IR_INT3 3
|
||||
#define TX3927_IR_INT4 4
|
||||
#define TX3927_IR_INT5 5
|
||||
#define TX3927_IR_SIO0 6
|
||||
#define TX3927_IR_SIO1 7
|
||||
#define TX3927_IR_SIO(ch) (6 + (ch))
|
||||
#define TX3927_IR_DMA 8
|
||||
#define TX3927_IR_PIO 9
|
||||
#define TX3927_IR_PCI 10
|
||||
#define TX3927_IR_TMR(ch) (13 + (ch))
|
||||
#define TX3927_NUM_IR 16
|
||||
|
||||
/*
|
||||
* PCIC
|
||||
*/
|
||||
/* bits for PCICMD */
|
||||
/* see PCI_COMMAND_XXX in linux/pci.h */
|
||||
|
||||
/* bits for PCISTAT */
|
||||
/* see PCI_STATUS_XXX in linux/pci.h */
|
||||
#define PCI_STATUS_NEW_CAP 0x0010
|
||||
|
||||
/* bits for ISTAT/IIM */
|
||||
#define TX3927_PCIC_IIM_ALL 0x00001600
|
||||
|
||||
/* bits for TC */
|
||||
#define TX3927_PCIC_TC_OF16E 0x00000020
|
||||
#define TX3927_PCIC_TC_IF8E 0x00000010
|
||||
#define TX3927_PCIC_TC_OF8E 0x00000008
|
||||
|
||||
/* bits for TSTAT/TIM */
|
||||
#define TX3927_PCIC_TIM_ALL 0x0003ffff
|
||||
|
||||
/* bits for IOBA/MBA */
|
||||
/* see PCI_BASE_ADDRESS_XXX in linux/pci.h */
|
||||
|
||||
/* bits for PBAPMC */
|
||||
#define TX3927_PCIC_PBAPMC_RPBA 0x00000004
|
||||
#define TX3927_PCIC_PBAPMC_PBAEN 0x00000002
|
||||
#define TX3927_PCIC_PBAPMC_BMCEN 0x00000001
|
||||
|
||||
/* bits for LBSTAT/LBIM */
|
||||
#define TX3927_PCIC_LBIM_ALL 0x0000003e
|
||||
|
||||
/* bits for PCISTATIM (see also PCI_STATUS_XXX in linux/pci.h */
|
||||
#define TX3927_PCIC_PCISTATIM_ALL 0x0000f900
|
||||
|
||||
/* bits for LBC */
|
||||
#define TX3927_PCIC_LBC_IBSE 0x00004000
|
||||
#define TX3927_PCIC_LBC_TIBSE 0x00002000
|
||||
#define TX3927_PCIC_LBC_TMFBSE 0x00001000
|
||||
#define TX3927_PCIC_LBC_HRST 0x00000800
|
||||
#define TX3927_PCIC_LBC_SRST 0x00000400
|
||||
#define TX3927_PCIC_LBC_EPCAD 0x00000200
|
||||
#define TX3927_PCIC_LBC_MSDSE 0x00000100
|
||||
#define TX3927_PCIC_LBC_CRR 0x00000080
|
||||
#define TX3927_PCIC_LBC_ILMDE 0x00000040
|
||||
#define TX3927_PCIC_LBC_ILIDE 0x00000020
|
||||
|
||||
#define TX3927_PCIC_IDSEL_AD_TO_SLOT(ad) ((ad) - 11)
|
||||
#define TX3927_PCIC_MAX_DEVNU TX3927_PCIC_IDSEL_AD_TO_SLOT(32)
|
||||
|
||||
/*
|
||||
* CCFG
|
||||
*/
|
||||
/* CCFG : Chip Configuration */
|
||||
#define TX3927_CCFG_TLBOFF 0x00020000
|
||||
#define TX3927_CCFG_BEOW 0x00010000
|
||||
#define TX3927_CCFG_WR 0x00008000
|
||||
#define TX3927_CCFG_TOE 0x00004000
|
||||
#define TX3927_CCFG_PCIXARB 0x00002000
|
||||
#define TX3927_CCFG_PCI3 0x00001000
|
||||
#define TX3927_CCFG_PSNP 0x00000800
|
||||
#define TX3927_CCFG_PPRI 0x00000400
|
||||
#define TX3927_CCFG_PLLM 0x00000030
|
||||
#define TX3927_CCFG_ENDIAN 0x00000004
|
||||
#define TX3927_CCFG_HALT 0x00000002
|
||||
#define TX3927_CCFG_ACEHOLD 0x00000001
|
||||
|
||||
/* PCFG : Pin Configuration */
|
||||
#define TX3927_PCFG_SYSCLKEN 0x08000000
|
||||
#define TX3927_PCFG_SDRCLKEN_ALL 0x07c00000
|
||||
#define TX3927_PCFG_SDRCLKEN(ch) (0x00400000<<(ch))
|
||||
#define TX3927_PCFG_PCICLKEN_ALL 0x003c0000
|
||||
#define TX3927_PCFG_PCICLKEN(ch) (0x00040000<<(ch))
|
||||
#define TX3927_PCFG_SELALL 0x0003ffff
|
||||
#define TX3927_PCFG_SELCS 0x00020000
|
||||
#define TX3927_PCFG_SELDSF 0x00010000
|
||||
#define TX3927_PCFG_SELSIOC_ALL 0x0000c000
|
||||
#define TX3927_PCFG_SELSIOC(ch) (0x00004000<<(ch))
|
||||
#define TX3927_PCFG_SELSIO_ALL 0x00003000
|
||||
#define TX3927_PCFG_SELSIO(ch) (0x00001000<<(ch))
|
||||
#define TX3927_PCFG_SELTMR_ALL 0x00000e00
|
||||
#define TX3927_PCFG_SELTMR(ch) (0x00000200<<(ch))
|
||||
#define TX3927_PCFG_SELDONE 0x00000100
|
||||
#define TX3927_PCFG_INTDMA_ALL 0x000000f0
|
||||
#define TX3927_PCFG_INTDMA(ch) (0x00000010<<(ch))
|
||||
#define TX3927_PCFG_SELDMA_ALL 0x0000000f
|
||||
#define TX3927_PCFG_SELDMA(ch) (0x00000001<<(ch))
|
||||
|
||||
#define tx3927_sdramcptr ((struct tx3927_sdramc_reg *)TX3927_SDRAMC_REG)
|
||||
#define tx3927_romcptr ((struct tx3927_romc_reg *)TX3927_ROMC_REG)
|
||||
#define tx3927_dmaptr ((struct tx3927_dma_reg *)TX3927_DMA_REG)
|
||||
#define tx3927_pcicptr ((struct tx3927_pcic_reg *)TX3927_PCIC_REG)
|
||||
#define tx3927_ccfgptr ((struct tx3927_ccfg_reg *)TX3927_CCFG_REG)
|
||||
#define tx3927_sioptr(ch) ((struct txx927_sio_reg *)TX3927_SIO_REG(ch))
|
||||
#define tx3927_pioptr ((struct txx9_pio_reg __iomem *)TX3927_PIO_REG)
|
||||
|
||||
#define TX3927_REV_PCODE() (tx3927_ccfgptr->crir >> 16)
|
||||
#define TX3927_ROMC_BA(ch) (tx3927_romcptr->cr[(ch)] & 0xfff00000)
|
||||
#define TX3927_ROMC_SIZE(ch) \
|
||||
(0x00100000 << ((tx3927_romcptr->cr[(ch)] >> 8) & 0xf))
|
||||
#define TX3927_ROMC_WIDTH(ch) (32 >> ((tx3927_romcptr->cr[(ch)] >> 7) & 0x1))
|
||||
|
||||
void tx3927_wdt_init(void);
|
||||
void tx3927_setup(void);
|
||||
void tx3927_time_init(unsigned int evt_tmrnr, unsigned int src_tmrnr);
|
||||
void tx3927_sio_init(unsigned int sclk, unsigned int cts_mask);
|
||||
struct pci_controller;
|
||||
void tx3927_pcic_setup(struct pci_controller *channel,
|
||||
unsigned long sdram_size, int extarb);
|
||||
void tx3927_setup_pcierr_irq(void);
|
||||
void tx3927_irq_init(void);
|
||||
void tx3927_mtd_init(int ch);
|
||||
|
||||
#endif /* __ASM_TXX9_TX3927_H */
|
||||
@@ -21,11 +21,7 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_TX39XX
|
||||
#define TXx9_MAX_IR 16
|
||||
#else
|
||||
#define TXx9_MAX_IR 32
|
||||
#endif
|
||||
|
||||
void txx9_irq_init(unsigned long baseaddr);
|
||||
int txx9_irq(void);
|
||||
|
||||
@@ -58,10 +58,6 @@ void txx9_clockevent_init(unsigned long baseaddr, int irq,
|
||||
unsigned int imbusclk);
|
||||
void txx9_tmr_init(unsigned long baseaddr);
|
||||
|
||||
#ifdef CONFIG_CPU_TX39XX
|
||||
#define TXX9_TIMER_BITS 24
|
||||
#else
|
||||
#define TXX9_TIMER_BITS 32
|
||||
#endif
|
||||
|
||||
#endif /* __ASM_TXX9TMR_H */
|
||||
|
||||
@@ -22,8 +22,6 @@
|
||||
#define MODULE_PROC_FAMILY "MIPS64_R6 "
|
||||
#elif defined CONFIG_CPU_R3000
|
||||
#define MODULE_PROC_FAMILY "R3000 "
|
||||
#elif defined CONFIG_CPU_TX39XX
|
||||
#define MODULE_PROC_FAMILY "TX39XX "
|
||||
#elif defined CONFIG_CPU_VR41XX
|
||||
#define MODULE_PROC_FAMILY "VR41XX "
|
||||
#elif defined CONFIG_CPU_R4300
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
/*
|
||||
* 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) 2002, 2004, 2007 by Ralf Baechle
|
||||
* Copyright (C) 2007 Maciej W. Rozycki
|
||||
*/
|
||||
#ifndef _ASM_WAR_H
|
||||
#define _ASM_WAR_H
|
||||
|
||||
/*
|
||||
* Work around certain R4000 CPU errata (as implemented by GCC):
|
||||
*
|
||||
* - A double-word or a variable shift may give an incorrect result
|
||||
* if executed immediately after starting an integer division:
|
||||
* "MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0",
|
||||
* erratum #28
|
||||
* "MIPS R4000MC Errata, Processor Revision 2.2 and 3.0", erratum
|
||||
* #19
|
||||
*
|
||||
* - A double-word or a variable shift may give an incorrect result
|
||||
* if executed while an integer multiplication is in progress:
|
||||
* "MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0",
|
||||
* errata #16 & #28
|
||||
*
|
||||
* - An integer division may give an incorrect result if started in
|
||||
* a delay slot of a taken branch or a jump:
|
||||
* "MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0",
|
||||
* erratum #52
|
||||
*/
|
||||
#ifdef CONFIG_CPU_R4000_WORKAROUNDS
|
||||
#define R4000_WAR 1
|
||||
#else
|
||||
#define R4000_WAR 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Work around certain R4400 CPU errata (as implemented by GCC):
|
||||
*
|
||||
* - A double-word or a variable shift may give an incorrect result
|
||||
* if executed immediately after starting an integer division:
|
||||
* "MIPS R4400MC Errata, Processor Revision 1.0", erratum #10
|
||||
* "MIPS R4400MC Errata, Processor Revision 2.0 & 3.0", erratum #4
|
||||
*/
|
||||
#ifdef CONFIG_CPU_R4400_WORKAROUNDS
|
||||
#define R4400_WAR 1
|
||||
#else
|
||||
#define R4400_WAR 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Work around the "daddi" and "daddiu" CPU errata:
|
||||
*
|
||||
* - The `daddi' instruction fails to trap on overflow.
|
||||
* "MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0",
|
||||
* erratum #23
|
||||
*
|
||||
* - The `daddiu' instruction can produce an incorrect result.
|
||||
* "MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0",
|
||||
* erratum #41
|
||||
* "MIPS R4000MC Errata, Processor Revision 2.2 and 3.0", erratum
|
||||
* #15
|
||||
* "MIPS R4400PC/SC Errata, Processor Revision 1.0", erratum #7
|
||||
* "MIPS R4400MC Errata, Processor Revision 1.0", erratum #5
|
||||
*/
|
||||
#ifdef CONFIG_CPU_DADDI_WORKAROUNDS
|
||||
#define DADDI_WAR 1
|
||||
#else
|
||||
#define DADDI_WAR 0
|
||||
#endif
|
||||
|
||||
#endif /* _ASM_WAR_H */
|
||||
@@ -44,7 +44,6 @@ obj-$(CONFIG_FUNCTION_TRACER) += mcount.o ftrace.o
|
||||
|
||||
sw-y := r4k_switch.o
|
||||
sw-$(CONFIG_CPU_R3000) := r2300_switch.o
|
||||
sw-$(CONFIG_CPU_TX39XX) := r2300_switch.o
|
||||
sw-$(CONFIG_CPU_CAVIUM_OCTEON) := octeon_switch.o
|
||||
obj-y += $(sw-y)
|
||||
|
||||
|
||||
@@ -1189,29 +1189,6 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu)
|
||||
c->tlbsize = 48;
|
||||
break;
|
||||
#endif
|
||||
case PRID_IMP_TX39:
|
||||
c->fpu_msk31 |= FPU_CSR_CONDX | FPU_CSR_FS;
|
||||
c->options = MIPS_CPU_TLB | MIPS_CPU_TX39_CACHE;
|
||||
|
||||
if ((c->processor_id & 0xf0) == (PRID_REV_TX3927 & 0xf0)) {
|
||||
c->cputype = CPU_TX3927;
|
||||
__cpu_name[cpu] = "TX3927";
|
||||
c->tlbsize = 64;
|
||||
} else {
|
||||
switch (c->processor_id & PRID_REV_MASK) {
|
||||
case PRID_REV_TX3912:
|
||||
c->cputype = CPU_TX3912;
|
||||
__cpu_name[cpu] = "TX3912";
|
||||
c->tlbsize = 32;
|
||||
break;
|
||||
case PRID_REV_TX3922:
|
||||
c->cputype = CPU_TX3922;
|
||||
__cpu_name[cpu] = "TX3922";
|
||||
c->tlbsize = 64;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case PRID_IMP_R4700:
|
||||
c->cputype = CPU_R4700;
|
||||
__cpu_name[cpu] = "R4700";
|
||||
|
||||
@@ -118,28 +118,6 @@ void cpu_probe(void)
|
||||
c->options |= MIPS_CPU_FPU;
|
||||
c->tlbsize = 64;
|
||||
break;
|
||||
case PRID_COMP_LEGACY | PRID_IMP_TX39:
|
||||
c->options = MIPS_CPU_TLB | MIPS_CPU_TX39_CACHE;
|
||||
|
||||
if ((c->processor_id & 0xf0) == (PRID_REV_TX3927 & 0xf0)) {
|
||||
c->cputype = CPU_TX3927;
|
||||
__cpu_name[cpu] = "TX3927";
|
||||
c->tlbsize = 64;
|
||||
} else {
|
||||
switch (c->processor_id & PRID_REV_MASK) {
|
||||
case PRID_REV_TX3912:
|
||||
c->cputype = CPU_TX3912;
|
||||
__cpu_name[cpu] = "TX3912";
|
||||
c->tlbsize = 32;
|
||||
break;
|
||||
case PRID_REV_TX3922:
|
||||
c->cputype = CPU_TX3922;
|
||||
__cpu_name[cpu] = "TX3922";
|
||||
c->tlbsize = 64;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
BUG_ON(!__cpu_name[cpu]);
|
||||
|
||||
@@ -328,16 +328,10 @@ void mips_set_personality_nan(struct arch_elf_state *state)
|
||||
|
||||
int mips_elf_read_implies_exec(void *elf_ex, int exstack)
|
||||
{
|
||||
if (exstack != EXSTACK_DISABLE_X) {
|
||||
/* The binary doesn't request a non-executable stack */
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!cpu_has_rixi) {
|
||||
/* The CPU doesn't support non-executable memory */
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
/*
|
||||
* Set READ_IMPLIES_EXEC only on non-NX systems that
|
||||
* do not request a specific state via PT_GNU_STACK.
|
||||
*/
|
||||
return (!cpu_has_rixi && exstack == EXSTACK_DEFAULT);
|
||||
}
|
||||
EXPORT_SYMBOL(mips_elf_read_implies_exec);
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#include <asm/stackframe.h>
|
||||
#include <asm/isadep.h>
|
||||
#include <asm/thread_info.h>
|
||||
#include <asm/war.h>
|
||||
|
||||
#ifndef CONFIG_PREEMPTION
|
||||
#define resume_kernel restore_all
|
||||
@@ -101,7 +100,7 @@ restore_partial: # restore partial frame
|
||||
SAVE_AT
|
||||
SAVE_TEMP
|
||||
LONG_L v0, PT_STATUS(sp)
|
||||
#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
|
||||
#if defined(CONFIG_CPU_R3000)
|
||||
and v0, ST0_IEP
|
||||
#else
|
||||
and v0, ST0_IE
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include <asm/mipsregs.h>
|
||||
#include <asm/stackframe.h>
|
||||
#include <asm/sync.h>
|
||||
#include <asm/war.h>
|
||||
#include <asm/thread_info.h>
|
||||
|
||||
__INIT
|
||||
@@ -163,7 +162,7 @@ NESTED(handle_int, PT_SIZE, sp)
|
||||
.set push
|
||||
.set noat
|
||||
mfc0 k0, CP0_STATUS
|
||||
#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
|
||||
#if defined(CONFIG_CPU_R3000)
|
||||
and k0, ST0_IEP
|
||||
bnez k0, 1f
|
||||
|
||||
@@ -645,7 +644,7 @@ isrdhwr:
|
||||
get_saved_sp /* k1 := current_thread_info */
|
||||
.set noreorder
|
||||
MFC0 k0, CP0_EPC
|
||||
#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
|
||||
#if defined(CONFIG_CPU_R3000)
|
||||
ori k1, _THREAD_MASK
|
||||
xori k1, _THREAD_MASK
|
||||
LONG_L v1, TI_TP_VALUE(k1)
|
||||
|
||||
@@ -36,13 +36,6 @@ static void __cpuidle r3081_wait(void)
|
||||
raw_local_irq_enable();
|
||||
}
|
||||
|
||||
static void __cpuidle r39xx_wait(void)
|
||||
{
|
||||
if (!need_resched())
|
||||
write_c0_conf(read_c0_conf() | TX39_CONF_HALT);
|
||||
raw_local_irq_enable();
|
||||
}
|
||||
|
||||
void __cpuidle r4k_wait(void)
|
||||
{
|
||||
raw_local_irq_enable();
|
||||
@@ -147,9 +140,6 @@ void __init check_wait(void)
|
||||
case CPU_R3081E:
|
||||
cpu_wait = r3081_wait;
|
||||
break;
|
||||
case CPU_TX3927:
|
||||
cpu_wait = r39xx_wait;
|
||||
break;
|
||||
case CPU_R4200:
|
||||
/* case CPU_R4300: */
|
||||
case CPU_R4600:
|
||||
|
||||
@@ -72,11 +72,6 @@ static void txx9_irq_unmask(struct irq_data *d)
|
||||
__raw_writel((__raw_readl(ilrp) & ~(0xff << ofs))
|
||||
| (txx9irq[irq_nr].level << ofs),
|
||||
ilrp);
|
||||
#ifdef CONFIG_CPU_TX39XX
|
||||
/* update IRCSR */
|
||||
__raw_writel(0, &txx9_ircptr->imr);
|
||||
__raw_writel(irc_elevel, &txx9_ircptr->imr);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void txx9_irq_mask(struct irq_data *d)
|
||||
@@ -88,15 +83,7 @@ static inline void txx9_irq_mask(struct irq_data *d)
|
||||
__raw_writel((__raw_readl(ilrp) & ~(0xff << ofs))
|
||||
| (irc_dlevel << ofs),
|
||||
ilrp);
|
||||
#ifdef CONFIG_CPU_TX39XX
|
||||
/* update IRCSR */
|
||||
__raw_writel(0, &txx9_ircptr->imr);
|
||||
__raw_writel(irc_elevel, &txx9_ircptr->imr);
|
||||
/* flush write buffer */
|
||||
__raw_readl(&txx9_ircptr->ssr);
|
||||
#else
|
||||
mmiowb();
|
||||
#endif
|
||||
}
|
||||
|
||||
static void txx9_irq_mask_ack(struct irq_data *d)
|
||||
|
||||
@@ -181,8 +181,6 @@ static int show_cpuinfo(struct seq_file *m, void *v)
|
||||
seq_puts(m, " 3k_cache");
|
||||
if (cpu_has_4k_cache)
|
||||
seq_puts(m, " 4k_cache");
|
||||
if (cpu_has_tx39_cache)
|
||||
seq_puts(m, " tx39_cache");
|
||||
if (cpu_has_octeon_cache)
|
||||
seq_puts(m, " octeon_cache");
|
||||
if (raw_cpu_has_fpu)
|
||||
|
||||
@@ -128,7 +128,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
|
||||
p->thread.reg17 = kthread_arg;
|
||||
p->thread.reg29 = childksp;
|
||||
p->thread.reg31 = (unsigned long) ret_from_kernel_thread;
|
||||
#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
|
||||
#if defined(CONFIG_CPU_R3000)
|
||||
status = (status & ~(ST0_KUP | ST0_IEP | ST0_IEC)) |
|
||||
((status & (ST0_KUC | ST0_IEC)) << 2);
|
||||
#else
|
||||
|
||||
@@ -64,4 +64,9 @@ int __init __dt_register_buses(const char *bus0, const char *bus1)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void __weak __init device_tree_init(void)
|
||||
{
|
||||
unflatten_and_copy_device_tree();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -163,7 +163,8 @@ static __always_inline __init void check_mult_sh(void)
|
||||
}
|
||||
|
||||
pr_cont("no.\n");
|
||||
panic(bug64hit, !R4000_WAR ? r4kwar : nowar);
|
||||
panic(bug64hit,
|
||||
IS_ENABLED(CONFIG_CPU_R4000_WORKAROUNDS) ? nowar : r4kwar);
|
||||
}
|
||||
|
||||
static volatile int daddi_ov;
|
||||
@@ -239,7 +240,8 @@ static __init void check_daddi(void)
|
||||
}
|
||||
|
||||
pr_cont("no.\n");
|
||||
panic(bug64hit, !DADDI_WAR ? daddiwar : nowar);
|
||||
panic(bug64hit,
|
||||
IS_ENABLED(CONFIG_CPU_DADDI_WORKAROUNDS) ? nowar : daddiwar);
|
||||
}
|
||||
|
||||
int daddiu_bug = -1;
|
||||
@@ -307,7 +309,8 @@ static __init void check_daddiu(void)
|
||||
}
|
||||
|
||||
pr_cont("no.\n");
|
||||
panic(bug64hit, !DADDI_WAR ? daddiwar : nowar);
|
||||
panic(bug64hit,
|
||||
IS_ENABLED(CONFIG_CPU_DADDI_WORKAROUNDS) ? nowar : daddiwar);
|
||||
}
|
||||
|
||||
void __init check_bugs64_early(void)
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include <asm/sysmips.h>
|
||||
#include <asm/thread_info.h>
|
||||
#include <asm/unistd.h>
|
||||
#include <asm/war.h>
|
||||
#include <asm/asm-offsets.h>
|
||||
|
||||
.align 5
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#include <asm/sysmips.h>
|
||||
#include <asm/thread_info.h>
|
||||
#include <asm/unistd.h>
|
||||
#include <asm/war.h>
|
||||
|
||||
#ifndef CONFIG_MIPS32_COMPAT
|
||||
/* Neither O32 nor N32, so define handle_sys here */
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#include <asm/sim.h>
|
||||
#include <asm/ucontext.h>
|
||||
#include <asm/cpu-features.h>
|
||||
#include <asm/war.h>
|
||||
#include <asm/dsp.h>
|
||||
#include <asm/inst.h>
|
||||
#include <asm/msa.h>
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#include <asm/ucontext.h>
|
||||
#include <asm/fpu.h>
|
||||
#include <asm/cpu-features.h>
|
||||
#include <asm/war.h>
|
||||
|
||||
#include "signal-common.h"
|
||||
|
||||
|
||||
@@ -2091,19 +2091,19 @@ static void *set_vi_srs_handler(int n, vi_handler_t addr, int srs)
|
||||
* If no shadow set is selected then use the default handler
|
||||
* that does normal register saving and standard interrupt exit
|
||||
*/
|
||||
extern char except_vec_vi, except_vec_vi_lui;
|
||||
extern char except_vec_vi_ori, except_vec_vi_end;
|
||||
extern char rollback_except_vec_vi;
|
||||
char *vec_start = using_rollback_handler() ?
|
||||
&rollback_except_vec_vi : &except_vec_vi;
|
||||
extern const u8 except_vec_vi[], except_vec_vi_lui[];
|
||||
extern const u8 except_vec_vi_ori[], except_vec_vi_end[];
|
||||
extern const u8 rollback_except_vec_vi[];
|
||||
const u8 *vec_start = using_rollback_handler() ?
|
||||
rollback_except_vec_vi : except_vec_vi;
|
||||
#if defined(CONFIG_CPU_MICROMIPS) || defined(CONFIG_CPU_BIG_ENDIAN)
|
||||
const int lui_offset = &except_vec_vi_lui - vec_start + 2;
|
||||
const int ori_offset = &except_vec_vi_ori - vec_start + 2;
|
||||
const int lui_offset = except_vec_vi_lui - vec_start + 2;
|
||||
const int ori_offset = except_vec_vi_ori - vec_start + 2;
|
||||
#else
|
||||
const int lui_offset = &except_vec_vi_lui - vec_start;
|
||||
const int ori_offset = &except_vec_vi_ori - vec_start;
|
||||
const int lui_offset = except_vec_vi_lui - vec_start;
|
||||
const int ori_offset = except_vec_vi_ori - vec_start;
|
||||
#endif
|
||||
const int handler_len = &except_vec_vi_end - vec_start;
|
||||
const int handler_len = except_vec_vi_end - vec_start;
|
||||
|
||||
if (handler_len > VECTORSPACING) {
|
||||
/*
|
||||
@@ -2311,7 +2311,7 @@ void per_cpu_trap_init(bool is_boot_cpu)
|
||||
}
|
||||
|
||||
/* Install CPU exception handler */
|
||||
void set_handler(unsigned long offset, void *addr, unsigned long size)
|
||||
void set_handler(unsigned long offset, const void *addr, unsigned long size)
|
||||
{
|
||||
#ifdef CONFIG_CPU_MICROMIPS
|
||||
memcpy((void *)(ebase + offset), ((unsigned char *)addr - 1), size);
|
||||
|
||||
@@ -84,11 +84,6 @@ void __init plat_mem_setup(void)
|
||||
__dt_setup_arch(dtb);
|
||||
}
|
||||
|
||||
void __init device_tree_init(void)
|
||||
{
|
||||
unflatten_and_copy_device_tree();
|
||||
}
|
||||
|
||||
void __init prom_init(void)
|
||||
{
|
||||
/* call the soc specific detetcion code and get it to fill soc_info */
|
||||
|
||||
@@ -13,7 +13,6 @@ lib-$(CONFIG_GENERIC_CSUM) := $(filter-out csum_partial.o, $(lib-y))
|
||||
|
||||
obj-$(CONFIG_CPU_GENERIC_DUMP_TLB) += dump_tlb.o
|
||||
obj-$(CONFIG_CPU_R3000) += r3k_dump_tlb.o
|
||||
obj-$(CONFIG_CPU_TX39XX) += r3k_dump_tlb.o
|
||||
|
||||
# libgcc-style stuff needed in the kernel
|
||||
obj-y += bswapsi.o bswapdi.o multi3.o
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
#include <asm/asm.h>
|
||||
#include <asm/compiler.h>
|
||||
#include <asm/war.h>
|
||||
|
||||
#ifndef CONFIG_CPU_DADDI_WORKAROUNDS
|
||||
#define GCC_DADDI_IMM_ASM() "I"
|
||||
|
||||
@@ -14,15 +14,11 @@
|
||||
#include <asm/page.h>
|
||||
#include <asm/tlbdebug.h>
|
||||
|
||||
extern int r3k_have_wired_reg;
|
||||
|
||||
void dump_tlb_regs(void)
|
||||
{
|
||||
pr_info("Index : %0x\n", read_c0_index());
|
||||
pr_info("EntryHi : %0lx\n", read_c0_entryhi());
|
||||
pr_info("EntryLo : %0lx\n", read_c0_entrylo0());
|
||||
if (r3k_have_wired_reg)
|
||||
pr_info("Wired : %0x\n", read_c0_wired());
|
||||
}
|
||||
|
||||
static void dump_tlb(int first, int last)
|
||||
|
||||
@@ -41,6 +41,7 @@ cflags-y += $(call cc-option,-mno-loongson-mmi)
|
||||
# Loongson Machines' Support
|
||||
#
|
||||
|
||||
cflags-$(CONFIG_MACH_LOONGSON2EF) += -I$(srctree)/arch/mips/include/asm/mach-loongson2ef -mno-branch-likely
|
||||
cflags-$(CONFIG_MACH_LOONGSON2EF) += -I$(srctree)/arch/mips/include/asm/mach-loongson2ef
|
||||
cflags-$(CONFIG_CC_HAS_MNO_BRANCH_LIKELY) += -mno-branch-likely
|
||||
load-$(CONFIG_LEMOTE_FULOONG2E) += 0xffffffff80100000
|
||||
load-$(CONFIG_LEMOTE_MACH2F) += 0xffffffff80200000
|
||||
|
||||
@@ -5,24 +5,9 @@
|
||||
|
||||
cflags-$(CONFIG_CPU_LOONGSON64) += -Wa,--trap
|
||||
|
||||
#
|
||||
# binutils from v2.25 on and gcc starting from v4.9.0 treat -march=loongson3a
|
||||
# as MIPS64 R2; older versions as just R1. This leaves the possibility open
|
||||
# that GCC might generate R2 code for -march=loongson3a which then is rejected
|
||||
# by GAS. The cc-option can't probe for this behaviour so -march=loongson3a
|
||||
# can't easily be used safely within the kbuild framework.
|
||||
#
|
||||
ifeq ($(call cc-ifversion, -ge, 0409, y), y)
|
||||
ifeq ($(call ld-ifversion, -ge, 22500, y), y)
|
||||
cflags-$(CONFIG_CPU_LOONGSON64) += \
|
||||
$(call cc-option,-march=loongson3a -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64)
|
||||
else
|
||||
cflags-$(CONFIG_CPU_LOONGSON64) += \
|
||||
$(call cc-option,-march=mips64r2,-mips64r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64)
|
||||
endif
|
||||
else
|
||||
cflags-$(CONFIG_CPU_LOONGSON64) += \
|
||||
$(call cc-option,-march=mips64r2,-mips64r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64)
|
||||
ifdef CONFIG_CPU_LOONGSON64
|
||||
cflags-$(CONFIG_CC_IS_GCC) += -march=loongson3a
|
||||
cflags-$(CONFIG_CC_IS_CLANG) += -march=mips64r2
|
||||
endif
|
||||
|
||||
# Some -march= flags enable MMI instructions, and GCC complains about that
|
||||
@@ -33,5 +18,6 @@ cflags-y += $(call cc-option,-mno-loongson-mmi)
|
||||
# Loongson Machines' Support
|
||||
#
|
||||
|
||||
cflags-$(CONFIG_MACH_LOONGSON64) += -I$(srctree)/arch/mips/include/asm/mach-loongson64 -mno-branch-likely
|
||||
cflags-$(CONFIG_MACH_LOONGSON64) += -I$(srctree)/arch/mips/include/asm/mach-loongson64
|
||||
cflags-$(CONFIG_CC_HAS_MNO_BRANCH_LIKELY) += -mno-branch-likely
|
||||
load-$(CONFIG_CPU_LOONGSON64) += 0xffffffff80200000
|
||||
|
||||
@@ -197,3 +197,13 @@ void __init prom_init_numa_memory(void)
|
||||
prom_meminit();
|
||||
}
|
||||
EXPORT_SYMBOL(prom_init_numa_memory);
|
||||
|
||||
pg_data_t * __init arch_alloc_nodedata(int nid)
|
||||
{
|
||||
return memblock_alloc(sizeof(pg_data_t), SMP_CACHE_BYTES);
|
||||
}
|
||||
|
||||
void arch_refresh_nodedata(int nid, pg_data_t *pgdat)
|
||||
{
|
||||
__node_data[nid] = pgdat;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user