Merge 3b69e8b457
("Merge tag 'sh-for-5.8' of git://git.libc.org/linux-sh") into android-mainline
Steps on the way to 5.8-rc1. Change-Id: I9fcdd820bc1555c51a93d77278079ec8c1b4c186 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -56,6 +56,7 @@ modules.order
|
|||||||
/linux
|
/linux
|
||||||
/vmlinux
|
/vmlinux
|
||||||
/vmlinux.32
|
/vmlinux.32
|
||||||
|
/vmlinux.symvers
|
||||||
/vmlinux-gdb.py
|
/vmlinux-gdb.py
|
||||||
/vmlinuz
|
/vmlinuz
|
||||||
/System.map
|
/System.map
|
||||||
|
@@ -78,8 +78,8 @@ by the PCI controller driver.
|
|||||||
Cleanup the pci_epc_mem structure allocated during pci_epc_mem_init().
|
Cleanup the pci_epc_mem structure allocated during pci_epc_mem_init().
|
||||||
|
|
||||||
|
|
||||||
APIs for the PCI Endpoint Function Driver
|
EPC APIs for the PCI Endpoint Function Driver
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
This section lists the APIs that the PCI Endpoint core provides to be used
|
This section lists the APIs that the PCI Endpoint core provides to be used
|
||||||
by the PCI endpoint function driver.
|
by the PCI endpoint function driver.
|
||||||
@@ -117,8 +117,8 @@ by the PCI endpoint function driver.
|
|||||||
The PCI endpoint function driver should use pci_epc_mem_free_addr() to
|
The PCI endpoint function driver should use pci_epc_mem_free_addr() to
|
||||||
free the memory space allocated using pci_epc_mem_alloc_addr().
|
free the memory space allocated using pci_epc_mem_alloc_addr().
|
||||||
|
|
||||||
Other APIs
|
Other EPC APIs
|
||||||
~~~~~~~~~~
|
~~~~~~~~~~~~~~
|
||||||
|
|
||||||
There are other APIs provided by the EPC library. These are used for binding
|
There are other APIs provided by the EPC library. These are used for binding
|
||||||
the EPF device with EPC device. pci-ep-cfs.c can be used as reference for
|
the EPF device with EPC device. pci-ep-cfs.c can be used as reference for
|
||||||
@@ -160,8 +160,8 @@ PCI Endpoint Function(EPF) Library
|
|||||||
The EPF library provides APIs to be used by the function driver and the EPC
|
The EPF library provides APIs to be used by the function driver and the EPC
|
||||||
library to provide endpoint mode functionality.
|
library to provide endpoint mode functionality.
|
||||||
|
|
||||||
APIs for the PCI Endpoint Function Driver
|
EPF APIs for the PCI Endpoint Function Driver
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
This section lists the APIs that the PCI Endpoint core provides to be used
|
This section lists the APIs that the PCI Endpoint core provides to be used
|
||||||
by the PCI endpoint function driver.
|
by the PCI endpoint function driver.
|
||||||
@@ -204,8 +204,8 @@ by the PCI endpoint controller library.
|
|||||||
The PCI endpoint controller library invokes pci_epf_linkup() when the
|
The PCI endpoint controller library invokes pci_epf_linkup() when the
|
||||||
EPC device has established the connection to the host.
|
EPC device has established the connection to the host.
|
||||||
|
|
||||||
Other APIs
|
Other EPF APIs
|
||||||
~~~~~~~~~~
|
~~~~~~~~~~~~~~
|
||||||
|
|
||||||
There are other APIs provided by the EPF library. These are used to notify
|
There are other APIs provided by the EPF library. These are used to notify
|
||||||
the function driver when the EPF device is bound to the EPC device.
|
the function driver when the EPF device is bound to the EPC device.
|
||||||
|
@@ -209,15 +209,22 @@ Configuring the kernel
|
|||||||
store the lsmod of that machine into a file
|
store the lsmod of that machine into a file
|
||||||
and pass it in as a LSMOD parameter.
|
and pass it in as a LSMOD parameter.
|
||||||
|
|
||||||
|
Also, you can preserve modules in certain folders
|
||||||
|
or kconfig files by specifying their paths in
|
||||||
|
parameter LMC_KEEP.
|
||||||
|
|
||||||
target$ lsmod > /tmp/mylsmod
|
target$ lsmod > /tmp/mylsmod
|
||||||
target$ scp /tmp/mylsmod host:/tmp
|
target$ scp /tmp/mylsmod host:/tmp
|
||||||
|
|
||||||
host$ make LSMOD=/tmp/mylsmod localmodconfig
|
host$ make LSMOD=/tmp/mylsmod \
|
||||||
|
LMC_KEEP="drivers/usb:drivers/gpu:fs" \
|
||||||
|
localmodconfig
|
||||||
|
|
||||||
The above also works when cross compiling.
|
The above also works when cross compiling.
|
||||||
|
|
||||||
"make localyesconfig" Similar to localmodconfig, except it will convert
|
"make localyesconfig" Similar to localmodconfig, except it will convert
|
||||||
all module options to built in (=y) options.
|
all module options to built in (=y) options. You can
|
||||||
|
also preserve modules by LMC_KEEP.
|
||||||
|
|
||||||
"make kvmconfig" Enable additional options for kvm guest kernel support.
|
"make kvmconfig" Enable additional options for kvm guest kernel support.
|
||||||
|
|
||||||
|
@@ -714,9 +714,7 @@ Conventions
|
|||||||
- Settings for a single feature should be contained in a single file.
|
- Settings for a single feature should be contained in a single file.
|
||||||
|
|
||||||
- The root cgroup should be exempt from resource control and thus
|
- The root cgroup should be exempt from resource control and thus
|
||||||
shouldn't have resource control interface files. Also,
|
shouldn't have resource control interface files.
|
||||||
informational files on the root cgroup which end up showing global
|
|
||||||
information available elsewhere shouldn't exist.
|
|
||||||
|
|
||||||
- The default time unit is microseconds. If a different unit is ever
|
- The default time unit is microseconds. If a different unit is ever
|
||||||
used, an explicit unit suffix must be present.
|
used, an explicit unit suffix must be present.
|
||||||
@@ -985,7 +983,7 @@ CPU Interface Files
|
|||||||
All time durations are in microseconds.
|
All time durations are in microseconds.
|
||||||
|
|
||||||
cpu.stat
|
cpu.stat
|
||||||
A read-only flat-keyed file which exists on non-root cgroups.
|
A read-only flat-keyed file.
|
||||||
This file exists whether the controller is enabled or not.
|
This file exists whether the controller is enabled or not.
|
||||||
|
|
||||||
It always reports the following three stats:
|
It always reports the following three stats:
|
||||||
|
51
Documentation/admin-guide/device-mapper/dm-ebs.rst
Normal file
51
Documentation/admin-guide/device-mapper/dm-ebs.rst
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
======
|
||||||
|
dm-ebs
|
||||||
|
======
|
||||||
|
|
||||||
|
|
||||||
|
This target is similar to the linear target except that it emulates
|
||||||
|
a smaller logical block size on a device with a larger logical block
|
||||||
|
size. Its main purpose is to provide emulation of 512 byte sectors on
|
||||||
|
devices that do not provide this emulation (i.e. 4K native disks).
|
||||||
|
|
||||||
|
Supported emulated logical block sizes 512, 1024, 2048 and 4096.
|
||||||
|
|
||||||
|
Underlying block size can be set to > 4K to test buffering larger units.
|
||||||
|
|
||||||
|
|
||||||
|
Table parameters
|
||||||
|
----------------
|
||||||
|
<dev path> <offset> <emulated sectors> [<underlying sectors>]
|
||||||
|
|
||||||
|
Mandatory parameters:
|
||||||
|
|
||||||
|
<dev path>:
|
||||||
|
Full pathname to the underlying block-device,
|
||||||
|
or a "major:minor" device-number.
|
||||||
|
<offset>:
|
||||||
|
Starting sector within the device;
|
||||||
|
has to be a multiple of <emulated sectors>.
|
||||||
|
<emulated sectors>:
|
||||||
|
Number of sectors defining the logical block size to be emulated;
|
||||||
|
1, 2, 4, 8 sectors of 512 bytes supported.
|
||||||
|
|
||||||
|
Optional parameter:
|
||||||
|
|
||||||
|
<underyling sectors>:
|
||||||
|
Number of sectors defining the logical block size of <dev path>.
|
||||||
|
2^N supported, e.g. 8 = emulate 8 sectors of 512 bytes = 4KiB.
|
||||||
|
If not provided, the logical block size of <dev path> will be used.
|
||||||
|
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
|
||||||
|
Emulate 1 sector = 512 bytes logical block size on /dev/sda starting at
|
||||||
|
offset 1024 sectors with underlying devices block size automatically set:
|
||||||
|
|
||||||
|
ebs /dev/sda 1024 1
|
||||||
|
|
||||||
|
Emulate 2 sector = 1KiB logical block size on /dev/sda starting at
|
||||||
|
offset 128 sectors, enforce 2KiB underlying device block size.
|
||||||
|
This presumes 2KiB logical blocksize on /dev/sda or less to work:
|
||||||
|
|
||||||
|
ebs /dev/sda 128 2 4
|
@@ -193,6 +193,14 @@ should not be changed when reloading the target because the layout of disk
|
|||||||
data depend on them and the reloaded target would be non-functional.
|
data depend on them and the reloaded target would be non-functional.
|
||||||
|
|
||||||
|
|
||||||
|
Status line:
|
||||||
|
|
||||||
|
1. the number of integrity mismatches
|
||||||
|
2. provided data sectors - that is the number of sectors that the user
|
||||||
|
could use
|
||||||
|
3. the current recalculating position (or '-' if we didn't recalculate)
|
||||||
|
|
||||||
|
|
||||||
The layout of the formatted block device:
|
The layout of the formatted block device:
|
||||||
|
|
||||||
* reserved sectors
|
* reserved sectors
|
||||||
|
@@ -37,9 +37,13 @@ Algorithm
|
|||||||
dm-zoned implements an on-disk buffering scheme to handle non-sequential
|
dm-zoned implements an on-disk buffering scheme to handle non-sequential
|
||||||
write accesses to the sequential zones of a zoned block device.
|
write accesses to the sequential zones of a zoned block device.
|
||||||
Conventional zones are used for caching as well as for storing internal
|
Conventional zones are used for caching as well as for storing internal
|
||||||
metadata.
|
metadata. It can also use a regular block device together with the zoned
|
||||||
|
block device; in that case the regular block device will be split logically
|
||||||
|
in zones with the same size as the zoned block device. These zones will be
|
||||||
|
placed in front of the zones from the zoned block device and will be handled
|
||||||
|
just like conventional zones.
|
||||||
|
|
||||||
The zones of the device are separated into 2 types:
|
The zones of the device(s) are separated into 2 types:
|
||||||
|
|
||||||
1) Metadata zones: these are conventional zones used to store metadata.
|
1) Metadata zones: these are conventional zones used to store metadata.
|
||||||
Metadata zones are not reported as useable capacity to the user.
|
Metadata zones are not reported as useable capacity to the user.
|
||||||
@@ -127,6 +131,13 @@ resumed. Flushing metadata thus only temporarily delays write and
|
|||||||
discard requests. Read requests can be processed concurrently while
|
discard requests. Read requests can be processed concurrently while
|
||||||
metadata flush is being executed.
|
metadata flush is being executed.
|
||||||
|
|
||||||
|
If a regular device is used in conjunction with the zoned block device,
|
||||||
|
a third set of metadata (without the zone bitmaps) is written to the
|
||||||
|
start of the zoned block device. This metadata has a generation counter of
|
||||||
|
'0' and will never be updated during normal operation; it just serves for
|
||||||
|
identification purposes. The first and second copy of the metadata
|
||||||
|
are located at the start of the regular block device.
|
||||||
|
|
||||||
Usage
|
Usage
|
||||||
=====
|
=====
|
||||||
|
|
||||||
@@ -138,9 +149,46 @@ Ex::
|
|||||||
|
|
||||||
dmzadm --format /dev/sdxx
|
dmzadm --format /dev/sdxx
|
||||||
|
|
||||||
For a formatted device, the target can be created normally with the
|
|
||||||
dmsetup utility. The only parameter that dm-zoned requires is the
|
|
||||||
underlying zoned block device name. Ex::
|
|
||||||
|
|
||||||
echo "0 `blockdev --getsize ${dev}` zoned ${dev}" | \
|
If two drives are to be used, both devices must be specified, with the
|
||||||
dmsetup create dmz-`basename ${dev}`
|
regular block device as the first device.
|
||||||
|
|
||||||
|
Ex::
|
||||||
|
|
||||||
|
dmzadm --format /dev/sdxx /dev/sdyy
|
||||||
|
|
||||||
|
|
||||||
|
Fomatted device(s) can be started with the dmzadm utility, too.:
|
||||||
|
|
||||||
|
Ex::
|
||||||
|
|
||||||
|
dmzadm --start /dev/sdxx /dev/sdyy
|
||||||
|
|
||||||
|
|
||||||
|
Information about the internal layout and current usage of the zones can
|
||||||
|
be obtained with the 'status' callback from dmsetup:
|
||||||
|
|
||||||
|
Ex::
|
||||||
|
|
||||||
|
dmsetup status /dev/dm-X
|
||||||
|
|
||||||
|
will return a line
|
||||||
|
|
||||||
|
0 <size> zoned <nr_zones> zones <nr_unmap_rnd>/<nr_rnd> random <nr_unmap_seq>/<nr_seq> sequential
|
||||||
|
|
||||||
|
where <nr_zones> is the total number of zones, <nr_unmap_rnd> is the number
|
||||||
|
of unmapped (ie free) random zones, <nr_rnd> the total number of zones,
|
||||||
|
<nr_unmap_seq> the number of unmapped sequential zones, and <nr_seq> the
|
||||||
|
total number of sequential zones.
|
||||||
|
|
||||||
|
Normally the reclaim process will be started once there are less than 50
|
||||||
|
percent free random zones. In order to start the reclaim process manually
|
||||||
|
even before reaching this threshold the 'dmsetup message' function can be
|
||||||
|
used:
|
||||||
|
|
||||||
|
Ex::
|
||||||
|
|
||||||
|
dmsetup message /dev/dm-X 0 reclaim
|
||||||
|
|
||||||
|
will start the reclaim process and random zones will be moved to sequential
|
||||||
|
zones.
|
||||||
|
@@ -19,6 +19,9 @@ contain the following properties:
|
|||||||
- interrupt-map-mask and interrupt-map: standard PCI properties to
|
- interrupt-map-mask and interrupt-map: standard PCI properties to
|
||||||
define the mapping of the PCIe interface to interrupt numbers.
|
define the mapping of the PCIe interface to interrupt numbers.
|
||||||
- bus-range: PCI bus numbers covered
|
- bus-range: PCI bus numbers covered
|
||||||
|
- phys: the PCIe PHY handle
|
||||||
|
- max-link-speed: see pci.txt
|
||||||
|
- reset-gpios: see pci.txt
|
||||||
|
|
||||||
In addition, the Device Tree describing an Aardvark PCIe controller
|
In addition, the Device Tree describing an Aardvark PCIe controller
|
||||||
must include a sub-node that describes the legacy interrupt controller
|
must include a sub-node that describes the legacy interrupt controller
|
||||||
@@ -48,6 +51,7 @@ Example:
|
|||||||
<0 0 0 2 &pcie_intc 1>,
|
<0 0 0 2 &pcie_intc 1>,
|
||||||
<0 0 0 3 &pcie_intc 2>,
|
<0 0 0 3 &pcie_intc 2>,
|
||||||
<0 0 0 4 &pcie_intc 3>;
|
<0 0 0 4 &pcie_intc 3>;
|
||||||
|
phys = <&comphy1 0>;
|
||||||
pcie_intc: interrupt-controller {
|
pcie_intc: interrupt-controller {
|
||||||
interrupt-controller;
|
interrupt-controller;
|
||||||
#interrupt-cells = <1>;
|
#interrupt-cells = <1>;
|
||||||
|
@@ -56,6 +56,8 @@ properties:
|
|||||||
description: Indicates usage of spread-spectrum clocking.
|
description: Indicates usage of spread-spectrum clocking.
|
||||||
type: boolean
|
type: boolean
|
||||||
|
|
||||||
|
aspm-no-l0s: true
|
||||||
|
|
||||||
required:
|
required:
|
||||||
- reg
|
- reg
|
||||||
- dma-ranges
|
- dma-ranges
|
||||||
|
@@ -10,7 +10,7 @@ maintainers:
|
|||||||
- Tom Joseph <tjoseph@cadence.com>
|
- Tom Joseph <tjoseph@cadence.com>
|
||||||
|
|
||||||
allOf:
|
allOf:
|
||||||
- $ref: "cdns-pcie.yaml#"
|
- $ref: "cdns-pcie-ep.yaml#"
|
||||||
- $ref: "pci-ep.yaml#"
|
- $ref: "pci-ep.yaml#"
|
||||||
|
|
||||||
properties:
|
properties:
|
||||||
|
@@ -45,8 +45,6 @@ examples:
|
|||||||
#size-cells = <2>;
|
#size-cells = <2>;
|
||||||
bus-range = <0x0 0xff>;
|
bus-range = <0x0 0xff>;
|
||||||
linux,pci-domain = <0>;
|
linux,pci-domain = <0>;
|
||||||
cdns,max-outbound-regions = <16>;
|
|
||||||
cdns,no-bar-match-nbits = <32>;
|
|
||||||
vendor-id = <0x17cd>;
|
vendor-id = <0x17cd>;
|
||||||
device-id = <0x0200>;
|
device-id = <0x0200>;
|
||||||
|
|
||||||
@@ -57,6 +55,7 @@ examples:
|
|||||||
|
|
||||||
ranges = <0x02000000 0x0 0x42000000 0x0 0x42000000 0x0 0x1000000>,
|
ranges = <0x02000000 0x0 0x42000000 0x0 0x42000000 0x0 0x1000000>,
|
||||||
<0x01000000 0x0 0x43000000 0x0 0x43000000 0x0 0x0010000>;
|
<0x01000000 0x0 0x43000000 0x0 0x43000000 0x0 0x0010000>;
|
||||||
|
dma-ranges = <0x02000000 0x0 0x0 0x0 0x0 0x1 0x00000000>;
|
||||||
|
|
||||||
#interrupt-cells = <0x1>;
|
#interrupt-cells = <0x1>;
|
||||||
|
|
||||||
|
25
Documentation/devicetree/bindings/pci/cdns-pcie-ep.yaml
Normal file
25
Documentation/devicetree/bindings/pci/cdns-pcie-ep.yaml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||||
|
%YAML 1.2
|
||||||
|
---
|
||||||
|
$id: "http://devicetree.org/schemas/pci/cdns-pcie-ep.yaml#"
|
||||||
|
$schema: "http://devicetree.org/meta-schemas/core.yaml#"
|
||||||
|
|
||||||
|
title: Cadence PCIe Device
|
||||||
|
|
||||||
|
maintainers:
|
||||||
|
- Tom Joseph <tjoseph@cadence.com>
|
||||||
|
|
||||||
|
allOf:
|
||||||
|
- $ref: "cdns-pcie.yaml#"
|
||||||
|
|
||||||
|
properties:
|
||||||
|
cdns,max-outbound-regions:
|
||||||
|
description: maximum number of outbound regions
|
||||||
|
allOf:
|
||||||
|
- $ref: /schemas/types.yaml#/definitions/uint32
|
||||||
|
minimum: 1
|
||||||
|
maximum: 32
|
||||||
|
default: 32
|
||||||
|
|
||||||
|
required:
|
||||||
|
- cdns,max-outbound-regions
|
@@ -14,6 +14,15 @@ allOf:
|
|||||||
- $ref: "cdns-pcie.yaml#"
|
- $ref: "cdns-pcie.yaml#"
|
||||||
|
|
||||||
properties:
|
properties:
|
||||||
|
cdns,max-outbound-regions:
|
||||||
|
description: maximum number of outbound regions
|
||||||
|
allOf:
|
||||||
|
- $ref: /schemas/types.yaml#/definitions/uint32
|
||||||
|
minimum: 1
|
||||||
|
maximum: 32
|
||||||
|
default: 32
|
||||||
|
deprecated: true
|
||||||
|
|
||||||
cdns,no-bar-match-nbits:
|
cdns,no-bar-match-nbits:
|
||||||
description:
|
description:
|
||||||
Set into the no BAR match register to configure the number of least
|
Set into the no BAR match register to configure the number of least
|
||||||
@@ -22,5 +31,6 @@ properties:
|
|||||||
minimum: 0
|
minimum: 0
|
||||||
maximum: 64
|
maximum: 64
|
||||||
default: 32
|
default: 32
|
||||||
|
deprecated: true
|
||||||
|
|
||||||
msi-parent: true
|
msi-parent: true
|
||||||
|
@@ -10,13 +10,6 @@ maintainers:
|
|||||||
- Tom Joseph <tjoseph@cadence.com>
|
- Tom Joseph <tjoseph@cadence.com>
|
||||||
|
|
||||||
properties:
|
properties:
|
||||||
cdns,max-outbound-regions:
|
|
||||||
description: maximum number of outbound regions
|
|
||||||
$ref: /schemas/types.yaml#/definitions/uint32
|
|
||||||
minimum: 1
|
|
||||||
maximum: 32
|
|
||||||
default: 32
|
|
||||||
|
|
||||||
phys:
|
phys:
|
||||||
description:
|
description:
|
||||||
One per lane if more than one in the list. If only one PHY listed it must
|
One per lane if more than one in the list. If only one PHY listed it must
|
||||||
|
77
Documentation/devicetree/bindings/pci/rcar-pci-ep.yaml
Normal file
77
Documentation/devicetree/bindings/pci/rcar-pci-ep.yaml
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||||
|
# Copyright (C) 2020 Renesas Electronics Europe GmbH - https://www.renesas.com/eu/en/
|
||||||
|
%YAML 1.2
|
||||||
|
---
|
||||||
|
$id: http://devicetree.org/schemas/pci/rcar-pci-ep.yaml#
|
||||||
|
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||||
|
|
||||||
|
title: Renesas R-Car PCIe Endpoint
|
||||||
|
|
||||||
|
maintainers:
|
||||||
|
- Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
|
||||||
|
- Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
|
||||||
|
|
||||||
|
properties:
|
||||||
|
compatible:
|
||||||
|
items:
|
||||||
|
- const: renesas,r8a774c0-pcie-ep
|
||||||
|
- const: renesas,rcar-gen3-pcie-ep
|
||||||
|
|
||||||
|
reg:
|
||||||
|
maxItems: 5
|
||||||
|
|
||||||
|
reg-names:
|
||||||
|
items:
|
||||||
|
- const: apb-base
|
||||||
|
- const: memory0
|
||||||
|
- const: memory1
|
||||||
|
- const: memory2
|
||||||
|
- const: memory3
|
||||||
|
|
||||||
|
power-domains:
|
||||||
|
maxItems: 1
|
||||||
|
|
||||||
|
resets:
|
||||||
|
maxItems: 1
|
||||||
|
|
||||||
|
clocks:
|
||||||
|
maxItems: 1
|
||||||
|
|
||||||
|
clock-names:
|
||||||
|
items:
|
||||||
|
- const: pcie
|
||||||
|
|
||||||
|
max-functions:
|
||||||
|
minimum: 1
|
||||||
|
maximum: 1
|
||||||
|
|
||||||
|
required:
|
||||||
|
- compatible
|
||||||
|
- reg
|
||||||
|
- reg-names
|
||||||
|
- resets
|
||||||
|
- power-domains
|
||||||
|
- clocks
|
||||||
|
- clock-names
|
||||||
|
- max-functions
|
||||||
|
|
||||||
|
examples:
|
||||||
|
- |
|
||||||
|
#include <dt-bindings/clock/r8a774c0-cpg-mssr.h>
|
||||||
|
#include <dt-bindings/power/r8a774c0-sysc.h>
|
||||||
|
|
||||||
|
pcie0_ep: pcie-ep@fe000000 {
|
||||||
|
compatible = "renesas,r8a774c0-pcie-ep",
|
||||||
|
"renesas,rcar-gen3-pcie-ep";
|
||||||
|
reg = <0xfe000000 0x80000>,
|
||||||
|
<0xfe100000 0x100000>,
|
||||||
|
<0xfe200000 0x200000>,
|
||||||
|
<0x30000000 0x8000000>,
|
||||||
|
<0x38000000 0x8000000>;
|
||||||
|
reg-names = "apb-base", "memory0", "memory1", "memory2", "memory3";
|
||||||
|
resets = <&cpg 319>;
|
||||||
|
power-domains = <&sysc R8A774C0_PD_ALWAYS_ON>;
|
||||||
|
clocks = <&cpg CPG_MOD 319>;
|
||||||
|
clock-names = "pcie";
|
||||||
|
max-functions = /bits/ 8 <1>;
|
||||||
|
};
|
@@ -11,7 +11,8 @@ compatible: "renesas,pcie-r8a7743" for the R8A7743 SoC;
|
|||||||
"renesas,pcie-r8a7791" for the R8A7791 SoC;
|
"renesas,pcie-r8a7791" for the R8A7791 SoC;
|
||||||
"renesas,pcie-r8a7793" for the R8A7793 SoC;
|
"renesas,pcie-r8a7793" for the R8A7793 SoC;
|
||||||
"renesas,pcie-r8a7795" for the R8A7795 SoC;
|
"renesas,pcie-r8a7795" for the R8A7795 SoC;
|
||||||
"renesas,pcie-r8a7796" for the R8A7796 SoC;
|
"renesas,pcie-r8a7796" for the R8A77960 SoC;
|
||||||
|
"renesas,pcie-r8a77961" for the R8A77961 SoC;
|
||||||
"renesas,pcie-r8a77980" for the R8A77980 SoC;
|
"renesas,pcie-r8a77980" for the R8A77980 SoC;
|
||||||
"renesas,pcie-r8a77990" for the R8A77990 SoC;
|
"renesas,pcie-r8a77990" for the R8A77990 SoC;
|
||||||
"renesas,pcie-rcar-gen2" for a generic R-Car Gen2 or
|
"renesas,pcie-rcar-gen2" for a generic R-Car Gen2 or
|
||||||
|
@@ -0,0 +1,92 @@
|
|||||||
|
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||||
|
%YAML 1.2
|
||||||
|
---
|
||||||
|
$id: http://devicetree.org/schemas/pci/socionext,uniphier-pcie-ep.yaml#
|
||||||
|
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||||
|
|
||||||
|
title: Socionext UniPhier PCIe endpoint controller
|
||||||
|
|
||||||
|
description: |
|
||||||
|
UniPhier PCIe endpoint controller is based on the Synopsys DesignWare
|
||||||
|
PCI core. It shares common features with the PCIe DesignWare core and
|
||||||
|
inherits common properties defined in
|
||||||
|
Documentation/devicetree/bindings/pci/designware-pcie.txt.
|
||||||
|
|
||||||
|
maintainers:
|
||||||
|
- Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
|
||||||
|
|
||||||
|
allOf:
|
||||||
|
- $ref: "pci-ep.yaml#"
|
||||||
|
|
||||||
|
properties:
|
||||||
|
compatible:
|
||||||
|
const: socionext,uniphier-pro5-pcie-ep
|
||||||
|
|
||||||
|
reg:
|
||||||
|
maxItems: 4
|
||||||
|
|
||||||
|
reg-names:
|
||||||
|
items:
|
||||||
|
- const: dbi
|
||||||
|
- const: dbi2
|
||||||
|
- const: link
|
||||||
|
- const: addr_space
|
||||||
|
|
||||||
|
clocks:
|
||||||
|
maxItems: 2
|
||||||
|
|
||||||
|
clock-names:
|
||||||
|
items:
|
||||||
|
- const: gio
|
||||||
|
- const: link
|
||||||
|
|
||||||
|
resets:
|
||||||
|
maxItems: 2
|
||||||
|
|
||||||
|
reset-names:
|
||||||
|
items:
|
||||||
|
- const: gio
|
||||||
|
- const: link
|
||||||
|
|
||||||
|
num-ib-windows:
|
||||||
|
const: 16
|
||||||
|
|
||||||
|
num-ob-windows:
|
||||||
|
const: 16
|
||||||
|
|
||||||
|
num-lanes: true
|
||||||
|
|
||||||
|
phys:
|
||||||
|
maxItems: 1
|
||||||
|
|
||||||
|
phy-names:
|
||||||
|
const: pcie-phy
|
||||||
|
|
||||||
|
required:
|
||||||
|
- compatible
|
||||||
|
- reg
|
||||||
|
- reg-names
|
||||||
|
- clocks
|
||||||
|
- clock-names
|
||||||
|
- resets
|
||||||
|
- reset-names
|
||||||
|
|
||||||
|
additionalProperties: false
|
||||||
|
|
||||||
|
examples:
|
||||||
|
- |
|
||||||
|
pcie_ep: pcie-ep@66000000 {
|
||||||
|
compatible = "socionext,uniphier-pro5-pcie-ep";
|
||||||
|
reg-names = "dbi", "dbi2", "link", "addr_space";
|
||||||
|
reg = <0x66000000 0x1000>, <0x66001000 0x1000>,
|
||||||
|
<0x66010000 0x10000>, <0x67000000 0x400000>;
|
||||||
|
clock-names = "gio", "link";
|
||||||
|
clocks = <&sys_clk 12>, <&sys_clk 24>;
|
||||||
|
reset-names = "gio", "link";
|
||||||
|
resets = <&sys_rst 12>, <&sys_rst 24>;
|
||||||
|
num-ib-windows = <16>;
|
||||||
|
num-ob-windows = <16>;
|
||||||
|
num-lanes = <4>;
|
||||||
|
phy-names = "pcie-phy";
|
||||||
|
phys = <&pcie_phy>;
|
||||||
|
};
|
@@ -251,6 +251,7 @@ vmlinux-*
|
|||||||
vmlinux.aout
|
vmlinux.aout
|
||||||
vmlinux.bin.all
|
vmlinux.bin.all
|
||||||
vmlinux.lds
|
vmlinux.lds
|
||||||
|
vmlinux.symvers
|
||||||
vmlinuz
|
vmlinuz
|
||||||
voffset.h
|
voffset.h
|
||||||
vsyscall.lds
|
vsyscall.lds
|
||||||
|
@@ -206,16 +206,18 @@ EINTR once fatal signal received.
|
|||||||
|
|
||||||
|
|
||||||
Flag checking should be done at the beginning of the ->fiemap callback via the
|
Flag checking should be done at the beginning of the ->fiemap callback via the
|
||||||
fiemap_check_flags() helper::
|
fiemap_prep() helper::
|
||||||
|
|
||||||
int fiemap_check_flags(struct fiemap_extent_info *fieinfo, u32 fs_flags);
|
int fiemap_prep(struct inode *inode, struct fiemap_extent_info *fieinfo,
|
||||||
|
u64 start, u64 *len, u32 supported_flags);
|
||||||
|
|
||||||
The struct fieinfo should be passed in as received from ioctl_fiemap(). The
|
The struct fieinfo should be passed in as received from ioctl_fiemap(). The
|
||||||
set of fiemap flags which the fs understands should be passed via fs_flags. If
|
set of fiemap flags which the fs understands should be passed via fs_flags. If
|
||||||
fiemap_check_flags finds invalid user flags, it will place the bad values in
|
fiemap_prep finds invalid user flags, it will place the bad values in
|
||||||
fieinfo->fi_flags and return -EBADR. If the file system gets -EBADR, from
|
fieinfo->fi_flags and return -EBADR. If the file system gets -EBADR, from
|
||||||
fiemap_check_flags(), it should immediately exit, returning that error back to
|
fiemap_prep(), it should immediately exit, returning that error back to
|
||||||
ioctl_fiemap().
|
ioctl_fiemap(). Additionally the range is validate against the supported
|
||||||
|
maximum file size.
|
||||||
|
|
||||||
|
|
||||||
For each extent in the request range, the file system should call
|
For each extent in the request range, the file system should call
|
||||||
|
@@ -29,31 +29,37 @@ This document describes the Linux kernel Makefiles.
|
|||||||
--- 4.4 Controlling compiler options for host programs
|
--- 4.4 Controlling compiler options for host programs
|
||||||
--- 4.5 When host programs are actually built
|
--- 4.5 When host programs are actually built
|
||||||
|
|
||||||
=== 5 Kbuild clean infrastructure
|
=== 5 Userspace Program support
|
||||||
|
--- 5.1 Simple Userspace Program
|
||||||
|
--- 5.2 Composite Userspace Programs
|
||||||
|
--- 5.3 Controlling compiler options for userspace programs
|
||||||
|
--- 5.4 When userspace programs are actually built
|
||||||
|
|
||||||
=== 6 Architecture Makefiles
|
=== 6 Kbuild clean infrastructure
|
||||||
--- 6.1 Set variables to tweak the build to the architecture
|
|
||||||
--- 6.2 Add prerequisites to archheaders:
|
|
||||||
--- 6.3 Add prerequisites to archprepare:
|
|
||||||
--- 6.4 List directories to visit when descending
|
|
||||||
--- 6.5 Architecture-specific boot images
|
|
||||||
--- 6.6 Building non-kbuild targets
|
|
||||||
--- 6.7 Commands useful for building a boot image
|
|
||||||
--- 6.8 Custom kbuild commands
|
|
||||||
--- 6.9 Preprocessing linker scripts
|
|
||||||
--- 6.10 Generic header files
|
|
||||||
--- 6.11 Post-link pass
|
|
||||||
|
|
||||||
=== 7 Kbuild syntax for exported headers
|
=== 7 Architecture Makefiles
|
||||||
--- 7.1 no-export-headers
|
--- 7.1 Set variables to tweak the build to the architecture
|
||||||
--- 7.2 generic-y
|
--- 7.2 Add prerequisites to archheaders:
|
||||||
--- 7.3 generated-y
|
--- 7.3 Add prerequisites to archprepare:
|
||||||
--- 7.4 mandatory-y
|
--- 7.4 List directories to visit when descending
|
||||||
|
--- 7.5 Architecture-specific boot images
|
||||||
|
--- 7.6 Building non-kbuild targets
|
||||||
|
--- 7.7 Commands useful for building a boot image
|
||||||
|
--- 7.8 Custom kbuild commands
|
||||||
|
--- 7.9 Preprocessing linker scripts
|
||||||
|
--- 7.10 Generic header files
|
||||||
|
--- 7.11 Post-link pass
|
||||||
|
|
||||||
=== 8 Kbuild Variables
|
=== 8 Kbuild syntax for exported headers
|
||||||
=== 9 Makefile language
|
--- 8.1 no-export-headers
|
||||||
=== 10 Credits
|
--- 8.2 generic-y
|
||||||
=== 11 TODO
|
--- 8.3 generated-y
|
||||||
|
--- 8.4 mandatory-y
|
||||||
|
|
||||||
|
=== 9 Kbuild Variables
|
||||||
|
=== 10 Makefile language
|
||||||
|
=== 11 Credits
|
||||||
|
=== 12 TODO
|
||||||
|
|
||||||
1 Overview
|
1 Overview
|
||||||
==========
|
==========
|
||||||
@@ -732,7 +738,88 @@ Both possibilities are described in the following.
|
|||||||
This will tell kbuild to build lxdialog even if not referenced in
|
This will tell kbuild to build lxdialog even if not referenced in
|
||||||
any rule.
|
any rule.
|
||||||
|
|
||||||
5 Kbuild clean infrastructure
|
5 Userspace Program support
|
||||||
|
===========================
|
||||||
|
|
||||||
|
Just like host programs, Kbuild also supports building userspace executables
|
||||||
|
for the target architecture (i.e. the same architecture as you are building
|
||||||
|
the kernel for).
|
||||||
|
|
||||||
|
The syntax is quite similar. The difference is to use "userprogs" instead of
|
||||||
|
"hostprogs".
|
||||||
|
|
||||||
|
5.1 Simple Userspace Program
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
The following line tells kbuild that the program bpf-direct shall be
|
||||||
|
built for the target architecture.
|
||||||
|
|
||||||
|
Example::
|
||||||
|
|
||||||
|
userprogs := bpf-direct
|
||||||
|
|
||||||
|
Kbuild assumes in the above example that bpf-direct is made from a
|
||||||
|
single C source file named bpf-direct.c located in the same directory
|
||||||
|
as the Makefile.
|
||||||
|
|
||||||
|
5.2 Composite Userspace Programs
|
||||||
|
--------------------------------
|
||||||
|
|
||||||
|
Userspace programs can be made up based on composite objects.
|
||||||
|
The syntax used to define composite objects for userspace programs is
|
||||||
|
similar to the syntax used for kernel objects.
|
||||||
|
$(<executable>-objs) lists all objects used to link the final
|
||||||
|
executable.
|
||||||
|
|
||||||
|
Example::
|
||||||
|
|
||||||
|
#samples/seccomp/Makefile
|
||||||
|
userprogs := bpf-fancy
|
||||||
|
bpf-fancy-objs := bpf-fancy.o bpf-helper.o
|
||||||
|
|
||||||
|
Objects with extension .o are compiled from the corresponding .c
|
||||||
|
files. In the above example, bpf-fancy.c is compiled to bpf-fancy.o
|
||||||
|
and bpf-helper.c is compiled to bpf-helper.o.
|
||||||
|
|
||||||
|
Finally, the two .o files are linked to the executable, bpf-fancy.
|
||||||
|
Note: The syntax <executable>-y is not permitted for userspace programs.
|
||||||
|
|
||||||
|
5.3 Controlling compiler options for userspace programs
|
||||||
|
-------------------------------------------------------
|
||||||
|
|
||||||
|
When compiling userspace programs, it is possible to set specific flags.
|
||||||
|
The programs will always be compiled utilising $(CC) passed
|
||||||
|
the options specified in $(KBUILD_USERCFLAGS).
|
||||||
|
To set flags that will take effect for all userspace programs created
|
||||||
|
in that Makefile, use the variable userccflags.
|
||||||
|
|
||||||
|
Example::
|
||||||
|
|
||||||
|
# samples/seccomp/Makefile
|
||||||
|
userccflags += -I usr/include
|
||||||
|
|
||||||
|
To set specific flags for a single file the following construction
|
||||||
|
is used:
|
||||||
|
|
||||||
|
Example::
|
||||||
|
|
||||||
|
bpf-helper-userccflags += -I user/include
|
||||||
|
|
||||||
|
It is also possible to specify additional options to the linker.
|
||||||
|
|
||||||
|
Example::
|
||||||
|
|
||||||
|
# net/bpfilter/Makefile
|
||||||
|
bpfilter_umh-userldflags += -static
|
||||||
|
|
||||||
|
When linking bpfilter_umh, it will be passed the extra option -static.
|
||||||
|
|
||||||
|
5.4 When userspace programs are actually built
|
||||||
|
----------------------------------------------
|
||||||
|
|
||||||
|
Same as "When host programs are actually built".
|
||||||
|
|
||||||
|
6 Kbuild clean infrastructure
|
||||||
=============================
|
=============================
|
||||||
|
|
||||||
"make clean" deletes most generated files in the obj tree where the kernel
|
"make clean" deletes most generated files in the obj tree where the kernel
|
||||||
@@ -790,7 +877,7 @@ is not operational at that point.
|
|||||||
Note 2: All directories listed in core-y, libs-y, drivers-y and net-y will
|
Note 2: All directories listed in core-y, libs-y, drivers-y and net-y will
|
||||||
be visited during "make clean".
|
be visited during "make clean".
|
||||||
|
|
||||||
6 Architecture Makefiles
|
7 Architecture Makefiles
|
||||||
========================
|
========================
|
||||||
|
|
||||||
The top level Makefile sets up the environment and does the preparation,
|
The top level Makefile sets up the environment and does the preparation,
|
||||||
@@ -820,10 +907,10 @@ When kbuild executes, the following steps are followed (roughly):
|
|||||||
- Preparing initrd images and the like
|
- Preparing initrd images and the like
|
||||||
|
|
||||||
|
|
||||||
6.1 Set variables to tweak the build to the architecture
|
7.1 Set variables to tweak the build to the architecture
|
||||||
--------------------------------------------------------
|
--------------------------------------------------------
|
||||||
|
|
||||||
LDFLAGS
|
KBUILD_LDFLAGS
|
||||||
Generic $(LD) options
|
Generic $(LD) options
|
||||||
|
|
||||||
Flags used for all invocations of the linker.
|
Flags used for all invocations of the linker.
|
||||||
@@ -832,7 +919,7 @@ When kbuild executes, the following steps are followed (roughly):
|
|||||||
Example::
|
Example::
|
||||||
|
|
||||||
#arch/s390/Makefile
|
#arch/s390/Makefile
|
||||||
LDFLAGS := -m elf_s390
|
KBUILD_LDFLAGS := -m elf_s390
|
||||||
|
|
||||||
Note: ldflags-y can be used to further customise
|
Note: ldflags-y can be used to further customise
|
||||||
the flags used. See chapter 3.7.
|
the flags used. See chapter 3.7.
|
||||||
@@ -967,7 +1054,7 @@ When kbuild executes, the following steps are followed (roughly):
|
|||||||
KBUILD_VMLINUX_LIBS together specify all the object files used to
|
KBUILD_VMLINUX_LIBS together specify all the object files used to
|
||||||
link vmlinux.
|
link vmlinux.
|
||||||
|
|
||||||
6.2 Add prerequisites to archheaders
|
7.2 Add prerequisites to archheaders
|
||||||
------------------------------------
|
------------------------------------
|
||||||
|
|
||||||
The archheaders: rule is used to generate header files that
|
The archheaders: rule is used to generate header files that
|
||||||
@@ -977,7 +1064,7 @@ When kbuild executes, the following steps are followed (roughly):
|
|||||||
architecture itself.
|
architecture itself.
|
||||||
|
|
||||||
|
|
||||||
6.3 Add prerequisites to archprepare
|
7.3 Add prerequisites to archprepare
|
||||||
------------------------------------
|
------------------------------------
|
||||||
|
|
||||||
The archprepare: rule is used to list prerequisites that need to be
|
The archprepare: rule is used to list prerequisites that need to be
|
||||||
@@ -995,7 +1082,7 @@ When kbuild executes, the following steps are followed (roughly):
|
|||||||
generating offset header files.
|
generating offset header files.
|
||||||
|
|
||||||
|
|
||||||
6.4 List directories to visit when descending
|
7.4 List directories to visit when descending
|
||||||
---------------------------------------------
|
---------------------------------------------
|
||||||
|
|
||||||
An arch Makefile cooperates with the top Makefile to define variables
|
An arch Makefile cooperates with the top Makefile to define variables
|
||||||
@@ -1030,7 +1117,7 @@ When kbuild executes, the following steps are followed (roughly):
|
|||||||
drivers-$(CONFIG_OPROFILE) += arch/sparc64/oprofile/
|
drivers-$(CONFIG_OPROFILE) += arch/sparc64/oprofile/
|
||||||
|
|
||||||
|
|
||||||
6.5 Architecture-specific boot images
|
7.5 Architecture-specific boot images
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
|
|
||||||
An arch Makefile specifies goals that take the vmlinux file, compress
|
An arch Makefile specifies goals that take the vmlinux file, compress
|
||||||
@@ -1085,7 +1172,7 @@ When kbuild executes, the following steps are followed (roughly):
|
|||||||
|
|
||||||
When "make" is executed without arguments, bzImage will be built.
|
When "make" is executed without arguments, bzImage will be built.
|
||||||
|
|
||||||
6.6 Building non-kbuild targets
|
7.6 Building non-kbuild targets
|
||||||
-------------------------------
|
-------------------------------
|
||||||
|
|
||||||
extra-y
|
extra-y
|
||||||
@@ -1108,7 +1195,7 @@ When kbuild executes, the following steps are followed (roughly):
|
|||||||
In this example, extra-y is used to list object files that
|
In this example, extra-y is used to list object files that
|
||||||
shall be built, but shall not be linked as part of built-in.a.
|
shall be built, but shall not be linked as part of built-in.a.
|
||||||
|
|
||||||
6.7 Commands useful for building a boot image
|
7.7 Commands useful for building a boot image
|
||||||
---------------------------------------------
|
---------------------------------------------
|
||||||
|
|
||||||
Kbuild provides a few macros that are useful when building a
|
Kbuild provides a few macros that are useful when building a
|
||||||
@@ -1211,7 +1298,7 @@ When kbuild executes, the following steps are followed (roughly):
|
|||||||
targets += $(dtb-y)
|
targets += $(dtb-y)
|
||||||
DTC_FLAGS ?= -p 1024
|
DTC_FLAGS ?= -p 1024
|
||||||
|
|
||||||
6.8 Custom kbuild commands
|
7.8 Custom kbuild commands
|
||||||
--------------------------
|
--------------------------
|
||||||
|
|
||||||
When kbuild is executing with KBUILD_VERBOSE=0, then only a shorthand
|
When kbuild is executing with KBUILD_VERBOSE=0, then only a shorthand
|
||||||
@@ -1241,7 +1328,7 @@ When kbuild executes, the following steps are followed (roughly):
|
|||||||
will be displayed with "make KBUILD_VERBOSE=0".
|
will be displayed with "make KBUILD_VERBOSE=0".
|
||||||
|
|
||||||
|
|
||||||
6.9 Preprocessing linker scripts
|
7.9 Preprocessing linker scripts
|
||||||
--------------------------------
|
--------------------------------
|
||||||
|
|
||||||
When the vmlinux image is built, the linker script
|
When the vmlinux image is built, the linker script
|
||||||
@@ -1274,7 +1361,7 @@ When kbuild executes, the following steps are followed (roughly):
|
|||||||
The kbuild infrastructure for `*lds` files is used in several
|
The kbuild infrastructure for `*lds` files is used in several
|
||||||
architecture-specific files.
|
architecture-specific files.
|
||||||
|
|
||||||
6.10 Generic header files
|
7.10 Generic header files
|
||||||
-------------------------
|
-------------------------
|
||||||
|
|
||||||
The directory include/asm-generic contains the header files
|
The directory include/asm-generic contains the header files
|
||||||
@@ -1283,7 +1370,7 @@ When kbuild executes, the following steps are followed (roughly):
|
|||||||
to list the file in the Kbuild file.
|
to list the file in the Kbuild file.
|
||||||
See "7.2 generic-y" for further info on syntax etc.
|
See "7.2 generic-y" for further info on syntax etc.
|
||||||
|
|
||||||
6.11 Post-link pass
|
7.11 Post-link pass
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
If the file arch/xxx/Makefile.postlink exists, this makefile
|
If the file arch/xxx/Makefile.postlink exists, this makefile
|
||||||
@@ -1299,7 +1386,7 @@ When kbuild executes, the following steps are followed (roughly):
|
|||||||
For example, powerpc uses this to check relocation sanity of
|
For example, powerpc uses this to check relocation sanity of
|
||||||
the linked vmlinux file.
|
the linked vmlinux file.
|
||||||
|
|
||||||
7 Kbuild syntax for exported headers
|
8 Kbuild syntax for exported headers
|
||||||
------------------------------------
|
------------------------------------
|
||||||
|
|
||||||
The kernel includes a set of headers that is exported to userspace.
|
The kernel includes a set of headers that is exported to userspace.
|
||||||
@@ -1319,14 +1406,14 @@ A Kbuild file may be defined under arch/<arch>/include/uapi/asm/ and
|
|||||||
arch/<arch>/include/asm/ to list asm files coming from asm-generic.
|
arch/<arch>/include/asm/ to list asm files coming from asm-generic.
|
||||||
See subsequent chapter for the syntax of the Kbuild file.
|
See subsequent chapter for the syntax of the Kbuild file.
|
||||||
|
|
||||||
7.1 no-export-headers
|
8.1 no-export-headers
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
no-export-headers is essentially used by include/uapi/linux/Kbuild to
|
no-export-headers is essentially used by include/uapi/linux/Kbuild to
|
||||||
avoid exporting specific headers (e.g. kvm.h) on architectures that do
|
avoid exporting specific headers (e.g. kvm.h) on architectures that do
|
||||||
not support it. It should be avoided as much as possible.
|
not support it. It should be avoided as much as possible.
|
||||||
|
|
||||||
7.2 generic-y
|
8.2 generic-y
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
If an architecture uses a verbatim copy of a header from
|
If an architecture uses a verbatim copy of a header from
|
||||||
@@ -1356,7 +1443,7 @@ See subsequent chapter for the syntax of the Kbuild file.
|
|||||||
|
|
||||||
#include <asm-generic/termios.h>
|
#include <asm-generic/termios.h>
|
||||||
|
|
||||||
7.3 generated-y
|
8.3 generated-y
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
If an architecture generates other header files alongside generic-y
|
If an architecture generates other header files alongside generic-y
|
||||||
@@ -1370,7 +1457,7 @@ See subsequent chapter for the syntax of the Kbuild file.
|
|||||||
#arch/x86/include/asm/Kbuild
|
#arch/x86/include/asm/Kbuild
|
||||||
generated-y += syscalls_32.h
|
generated-y += syscalls_32.h
|
||||||
|
|
||||||
7.4 mandatory-y
|
8.4 mandatory-y
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
mandatory-y is essentially used by include/(uapi/)asm-generic/Kbuild
|
mandatory-y is essentially used by include/(uapi/)asm-generic/Kbuild
|
||||||
@@ -1380,7 +1467,7 @@ See subsequent chapter for the syntax of the Kbuild file.
|
|||||||
in arch/$(ARCH)/include/(uapi/)/asm, Kbuild will automatically generate
|
in arch/$(ARCH)/include/(uapi/)/asm, Kbuild will automatically generate
|
||||||
a wrapper of the asm-generic one.
|
a wrapper of the asm-generic one.
|
||||||
|
|
||||||
8 Kbuild Variables
|
9 Kbuild Variables
|
||||||
==================
|
==================
|
||||||
|
|
||||||
The top Makefile exports the following variables:
|
The top Makefile exports the following variables:
|
||||||
@@ -1438,8 +1525,8 @@ The top Makefile exports the following variables:
|
|||||||
command.
|
command.
|
||||||
|
|
||||||
|
|
||||||
9 Makefile language
|
10 Makefile language
|
||||||
===================
|
====================
|
||||||
|
|
||||||
The kernel Makefiles are designed to be run with GNU Make. The Makefiles
|
The kernel Makefiles are designed to be run with GNU Make. The Makefiles
|
||||||
use only the documented features of GNU Make, but they do use many
|
use only the documented features of GNU Make, but they do use many
|
||||||
@@ -1458,7 +1545,7 @@ time the left-hand side is used.
|
|||||||
There are some cases where "=" is appropriate. Usually, though, ":="
|
There are some cases where "=" is appropriate. Usually, though, ":="
|
||||||
is the right choice.
|
is the right choice.
|
||||||
|
|
||||||
10 Credits
|
11 Credits
|
||||||
==========
|
==========
|
||||||
|
|
||||||
- Original version made by Michael Elizabeth Chastain, <mailto:mec@shout.net>
|
- Original version made by Michael Elizabeth Chastain, <mailto:mec@shout.net>
|
||||||
@@ -1466,7 +1553,7 @@ is the right choice.
|
|||||||
- Updates by Sam Ravnborg <sam@ravnborg.org>
|
- Updates by Sam Ravnborg <sam@ravnborg.org>
|
||||||
- Language QA by Jan Engelhardt <jengelh@gmx.de>
|
- Language QA by Jan Engelhardt <jengelh@gmx.de>
|
||||||
|
|
||||||
11 TODO
|
12 TODO
|
||||||
=======
|
=======
|
||||||
|
|
||||||
- Describe how kbuild supports shipped files with _shipped.
|
- Describe how kbuild supports shipped files with _shipped.
|
||||||
|
@@ -528,18 +528,6 @@ build.
|
|||||||
will then do the expected and compile both modules with
|
will then do the expected and compile both modules with
|
||||||
full knowledge of symbols from either module.
|
full knowledge of symbols from either module.
|
||||||
|
|
||||||
Use an extra Module.symvers file
|
|
||||||
When an external module is built, a Module.symvers file
|
|
||||||
is generated containing all exported symbols which are
|
|
||||||
not defined in the kernel. To get access to symbols
|
|
||||||
from bar.ko, copy the Module.symvers file from the
|
|
||||||
compilation of bar.ko to the directory where foo.ko is
|
|
||||||
built. During the module build, kbuild will read the
|
|
||||||
Module.symvers file in the directory of the external
|
|
||||||
module, and when the build is finished, a new
|
|
||||||
Module.symvers file is created containing the sum of
|
|
||||||
all symbols defined and not part of the kernel.
|
|
||||||
|
|
||||||
Use "make" variable KBUILD_EXTRA_SYMBOLS
|
Use "make" variable KBUILD_EXTRA_SYMBOLS
|
||||||
If it is impractical to add a top-level kbuild file,
|
If it is impractical to add a top-level kbuild file,
|
||||||
you can assign a space separated list
|
you can assign a space separated list
|
||||||
|
2
Kconfig
2
Kconfig
@@ -5,8 +5,6 @@
|
|||||||
#
|
#
|
||||||
mainmenu "Linux/$(ARCH) $(KERNELVERSION) Kernel Configuration"
|
mainmenu "Linux/$(ARCH) $(KERNELVERSION) Kernel Configuration"
|
||||||
|
|
||||||
comment "Compiler: $(CC_VERSION_TEXT)"
|
|
||||||
|
|
||||||
source "scripts/Kconfig.include"
|
source "scripts/Kconfig.include"
|
||||||
|
|
||||||
source "init/Kconfig"
|
source "init/Kconfig"
|
||||||
|
@@ -13080,7 +13080,7 @@ L: linux-pci@vger.kernel.org
|
|||||||
L: linux-arm-kernel@lists.infradead.org
|
L: linux-arm-kernel@lists.infradead.org
|
||||||
S: Maintained
|
S: Maintained
|
||||||
F: Documentation/devicetree/bindings/pci/layerscape-pcie-gen4.txt
|
F: Documentation/devicetree/bindings/pci/layerscape-pcie-gen4.txt
|
||||||
F: drivers/pci/controller/mobibeil/pcie-layerscape-gen4.c
|
F: drivers/pci/controller/mobiveil/pcie-layerscape-gen4.c
|
||||||
|
|
||||||
PCI DRIVER FOR RENESAS R-CAR
|
PCI DRIVER FOR RENESAS R-CAR
|
||||||
M: Marek Vasut <marek.vasut+renesas@gmail.com>
|
M: Marek Vasut <marek.vasut+renesas@gmail.com>
|
||||||
@@ -13088,6 +13088,7 @@ M: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
|
|||||||
L: linux-pci@vger.kernel.org
|
L: linux-pci@vger.kernel.org
|
||||||
L: linux-renesas-soc@vger.kernel.org
|
L: linux-renesas-soc@vger.kernel.org
|
||||||
S: Maintained
|
S: Maintained
|
||||||
|
F: Documentation/devicetree/bindings/pci/*rcar*
|
||||||
F: drivers/pci/controller/*rcar*
|
F: drivers/pci/controller/*rcar*
|
||||||
|
|
||||||
PCI DRIVER FOR SAMSUNG EXYNOS
|
PCI DRIVER FOR SAMSUNG EXYNOS
|
||||||
@@ -13281,8 +13282,8 @@ PCIE DRIVER FOR SOCIONEXT UNIPHIER
|
|||||||
M: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
|
M: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
|
||||||
L: linux-pci@vger.kernel.org
|
L: linux-pci@vger.kernel.org
|
||||||
S: Maintained
|
S: Maintained
|
||||||
F: Documentation/devicetree/bindings/pci/uniphier-pcie.txt
|
F: Documentation/devicetree/bindings/pci/uniphier-pcie*
|
||||||
F: drivers/pci/controller/dwc/pcie-uniphier.c
|
F: drivers/pci/controller/dwc/pcie-uniphier*
|
||||||
|
|
||||||
PCIE DRIVER FOR ST SPEAR13XX
|
PCIE DRIVER FOR ST SPEAR13XX
|
||||||
M: Pratyush Anand <pratyush.anand@gmail.com>
|
M: Pratyush Anand <pratyush.anand@gmail.com>
|
||||||
|
223
Makefile
223
Makefile
@@ -11,9 +11,12 @@ NAME = Kleptomaniac Octopus
|
|||||||
# Comments in this file are targeted only to the developer, do not
|
# Comments in this file are targeted only to the developer, do not
|
||||||
# expect to learn how to build the kernel reading this file.
|
# expect to learn how to build the kernel reading this file.
|
||||||
|
|
||||||
|
$(if $(filter __%, $(MAKECMDGOALS)), \
|
||||||
|
$(error targets prefixed with '__' are only for internal use))
|
||||||
|
|
||||||
# That's our default target when none is given on the command line
|
# That's our default target when none is given on the command line
|
||||||
PHONY := _all
|
PHONY := __all
|
||||||
_all:
|
__all:
|
||||||
|
|
||||||
# We are using a recursive build, so we need to do a little thinking
|
# We are using a recursive build, so we need to do a little thinking
|
||||||
# to get the ordering right.
|
# to get the ordering right.
|
||||||
@@ -157,12 +160,14 @@ MAKEFLAGS += --include-dir=$(abs_srctree)
|
|||||||
need-sub-make := 1
|
need-sub-make := 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
this-makefile := $(lastword $(MAKEFILE_LIST))
|
||||||
|
|
||||||
ifneq ($(filter 3.%,$(MAKE_VERSION)),)
|
ifneq ($(filter 3.%,$(MAKE_VERSION)),)
|
||||||
# 'MAKEFLAGS += -rR' does not immediately become effective for GNU Make 3.x
|
# 'MAKEFLAGS += -rR' does not immediately become effective for GNU Make 3.x
|
||||||
# We need to invoke sub-make to avoid implicit rules in the top Makefile.
|
# We need to invoke sub-make to avoid implicit rules in the top Makefile.
|
||||||
need-sub-make := 1
|
need-sub-make := 1
|
||||||
# Cancel implicit rules for this Makefile.
|
# Cancel implicit rules for this Makefile.
|
||||||
$(lastword $(MAKEFILE_LIST)): ;
|
$(this-makefile): ;
|
||||||
endif
|
endif
|
||||||
|
|
||||||
export abs_srctree abs_objtree
|
export abs_srctree abs_objtree
|
||||||
@@ -170,13 +175,13 @@ export sub_make_done := 1
|
|||||||
|
|
||||||
ifeq ($(need-sub-make),1)
|
ifeq ($(need-sub-make),1)
|
||||||
|
|
||||||
PHONY += $(MAKECMDGOALS) sub-make
|
PHONY += $(MAKECMDGOALS) __sub-make
|
||||||
|
|
||||||
$(filter-out _all sub-make $(lastword $(MAKEFILE_LIST)), $(MAKECMDGOALS)) _all: sub-make
|
$(filter-out $(this-makefile), $(MAKECMDGOALS)) __all: __sub-make
|
||||||
@:
|
@:
|
||||||
|
|
||||||
# Invoke a second make in the output directory, passing relevant variables
|
# Invoke a second make in the output directory, passing relevant variables
|
||||||
sub-make:
|
__sub-make:
|
||||||
$(Q)$(MAKE) -C $(abs_objtree) -f $(abs_srctree)/Makefile $(MAKECMDGOALS)
|
$(Q)$(MAKE) -C $(abs_objtree) -f $(abs_srctree)/Makefile $(MAKECMDGOALS)
|
||||||
|
|
||||||
endif # need-sub-make
|
endif # need-sub-make
|
||||||
@@ -213,6 +218,9 @@ ifeq ("$(origin M)", "command line")
|
|||||||
KBUILD_EXTMOD := $(M)
|
KBUILD_EXTMOD := $(M)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
$(if $(word 2, $(KBUILD_EXTMOD)), \
|
||||||
|
$(error building multiple external modules is not supported))
|
||||||
|
|
||||||
export KBUILD_CHECKSRC KBUILD_EXTMOD
|
export KBUILD_CHECKSRC KBUILD_EXTMOD
|
||||||
|
|
||||||
extmod-prefix = $(if $(KBUILD_EXTMOD),$(KBUILD_EXTMOD)/)
|
extmod-prefix = $(if $(KBUILD_EXTMOD),$(KBUILD_EXTMOD)/)
|
||||||
@@ -321,7 +329,7 @@ ifdef mixed-build
|
|||||||
|
|
||||||
PHONY += $(MAKECMDGOALS) __build_one_by_one
|
PHONY += $(MAKECMDGOALS) __build_one_by_one
|
||||||
|
|
||||||
$(filter-out __build_one_by_one, $(MAKECMDGOALS)): __build_one_by_one
|
$(MAKECMDGOALS): __build_one_by_one
|
||||||
@:
|
@:
|
||||||
|
|
||||||
__build_one_by_one:
|
__build_one_by_one:
|
||||||
@@ -406,9 +414,12 @@ else
|
|||||||
HOSTCC = gcc
|
HOSTCC = gcc
|
||||||
HOSTCXX = g++
|
HOSTCXX = g++
|
||||||
endif
|
endif
|
||||||
KBUILD_HOSTCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 \
|
|
||||||
-fomit-frame-pointer -std=gnu89 $(HOST_LFS_CFLAGS) \
|
export KBUILD_USERCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes \
|
||||||
$(HOSTCFLAGS)
|
-O2 -fomit-frame-pointer -std=gnu89
|
||||||
|
export KBUILD_USERLDFLAGS :=
|
||||||
|
|
||||||
|
KBUILD_HOSTCFLAGS := $(KBUILD_USERCFLAGS) $(HOST_LFS_CFLAGS) $(HOSTCFLAGS)
|
||||||
KBUILD_HOSTCXXFLAGS := -Wall -O2 $(HOST_LFS_CFLAGS) $(HOSTCXXFLAGS)
|
KBUILD_HOSTCXXFLAGS := -Wall -O2 $(HOST_LFS_CFLAGS) $(HOSTCXXFLAGS)
|
||||||
KBUILD_HOSTLDFLAGS := $(HOST_LFS_LDFLAGS) $(HOSTLDFLAGS)
|
KBUILD_HOSTLDFLAGS := $(HOST_LFS_LDFLAGS) $(HOSTLDFLAGS)
|
||||||
KBUILD_HOSTLDLIBS := $(HOST_LFS_LIBS) $(HOSTLDLIBS)
|
KBUILD_HOSTLDLIBS := $(HOST_LFS_LIBS) $(HOSTLDLIBS)
|
||||||
@@ -447,6 +458,26 @@ PYTHON = python
|
|||||||
PYTHON3 = python3
|
PYTHON3 = python3
|
||||||
CHECK = sparse
|
CHECK = sparse
|
||||||
BASH = bash
|
BASH = bash
|
||||||
|
GZIP = gzip
|
||||||
|
BZIP2 = bzip2
|
||||||
|
LZOP = lzop
|
||||||
|
LZMA = lzma
|
||||||
|
LZ4 = lz4c
|
||||||
|
XZ = xz
|
||||||
|
|
||||||
|
# GZIP, BZIP2, LZOP env vars are used by the tools. Support them as the command
|
||||||
|
# line interface, but use _GZIP, _BZIP2, _LZOP internally.
|
||||||
|
_GZIP := $(GZIP)
|
||||||
|
_BZIP2 := $(BZIP2)
|
||||||
|
_LZOP := $(LZOP)
|
||||||
|
|
||||||
|
# Reset GZIP, BZIP2, LZOP in this Makefile
|
||||||
|
override GZIP=
|
||||||
|
override BZIP2=
|
||||||
|
override LZOP=
|
||||||
|
|
||||||
|
# Reset GZIP, BZIP2, LZOP in recursive invocations
|
||||||
|
MAKEOVERRIDES += GZIP= BZIP2= LZOP=
|
||||||
|
|
||||||
CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
|
CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
|
||||||
-Wbitwise -Wno-return-void -Wno-unknown-attribute $(CF)
|
-Wbitwise -Wno-return-void -Wno-unknown-attribute $(CF)
|
||||||
@@ -495,6 +526,7 @@ CLANG_FLAGS :=
|
|||||||
export ARCH SRCARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE LD CC
|
export ARCH SRCARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE LD CC
|
||||||
export CPP AR NM STRIP OBJCOPY OBJDUMP OBJSIZE READELF PAHOLE LEX YACC AWK INSTALLKERNEL
|
export CPP AR NM STRIP OBJCOPY OBJDUMP OBJSIZE READELF PAHOLE LEX YACC AWK INSTALLKERNEL
|
||||||
export PERL PYTHON PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX
|
export PERL PYTHON PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX
|
||||||
|
export _GZIP _BZIP2 _LZOP LZMA LZ4 XZ
|
||||||
export KBUILD_HOSTCXXFLAGS KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS LDFLAGS_MODULE
|
export KBUILD_HOSTCXXFLAGS KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS LDFLAGS_MODULE
|
||||||
|
|
||||||
export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS KBUILD_LDFLAGS
|
export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS KBUILD_LDFLAGS
|
||||||
@@ -597,12 +629,12 @@ else #!config-build
|
|||||||
# targets and others. In general all targets except *config targets.
|
# targets and others. In general all targets except *config targets.
|
||||||
|
|
||||||
# If building an external module we do not care about the all: rule
|
# If building an external module we do not care about the all: rule
|
||||||
# but instead _all depend on modules
|
# but instead __all depend on modules
|
||||||
PHONY += all
|
PHONY += all
|
||||||
ifeq ($(KBUILD_EXTMOD),)
|
ifeq ($(KBUILD_EXTMOD),)
|
||||||
_all: all
|
__all: all
|
||||||
else
|
else
|
||||||
_all: modules
|
__all: modules
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Decide whether to build built-in, modular, or both.
|
# Decide whether to build built-in, modular, or both.
|
||||||
@@ -612,19 +644,15 @@ KBUILD_MODULES :=
|
|||||||
KBUILD_BUILTIN := 1
|
KBUILD_BUILTIN := 1
|
||||||
|
|
||||||
# If we have only "make modules", don't compile built-in objects.
|
# If we have only "make modules", don't compile built-in objects.
|
||||||
# When we're building modules with modversions, we need to consider
|
|
||||||
# the built-in objects during the descend as well, in order to
|
|
||||||
# make sure the checksums are up to date before we record them.
|
|
||||||
|
|
||||||
ifeq ($(MAKECMDGOALS),modules)
|
ifeq ($(MAKECMDGOALS),modules)
|
||||||
KBUILD_BUILTIN := $(if $(CONFIG_MODVERSIONS),1)
|
KBUILD_BUILTIN :=
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# If we have "make <whatever> modules", compile modules
|
# If we have "make <whatever> modules", compile modules
|
||||||
# in addition to whatever we do anyway.
|
# in addition to whatever we do anyway.
|
||||||
# Just "make" or "make all" shall build modules as well
|
# Just "make" or "make all" shall build modules as well
|
||||||
|
|
||||||
ifneq ($(filter all _all modules nsdeps,$(MAKECMDGOALS)),)
|
ifneq ($(filter all modules nsdeps,$(MAKECMDGOALS)),)
|
||||||
KBUILD_MODULES := 1
|
KBUILD_MODULES := 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -640,13 +668,11 @@ endif
|
|||||||
|
|
||||||
ifeq ($(KBUILD_EXTMOD),)
|
ifeq ($(KBUILD_EXTMOD),)
|
||||||
# Objects we will link into vmlinux / subdirs we need to visit
|
# Objects we will link into vmlinux / subdirs we need to visit
|
||||||
init-y := init/
|
core-y := init/ usr/
|
||||||
drivers-y := drivers/ sound/
|
drivers-y := drivers/ sound/
|
||||||
drivers-$(CONFIG_SAMPLES) += samples/
|
drivers-$(CONFIG_SAMPLES) += samples/
|
||||||
net-y := net/
|
drivers-y += net/ virt/
|
||||||
libs-y := lib/
|
libs-y := lib/
|
||||||
core-y := usr/
|
|
||||||
virt-y := virt/
|
|
||||||
endif # KBUILD_EXTMOD
|
endif # KBUILD_EXTMOD
|
||||||
|
|
||||||
# The all: target is the default when no target is given on the
|
# The all: target is the default when no target is given on the
|
||||||
@@ -699,7 +725,7 @@ $(KCONFIG_CONFIG):
|
|||||||
# This exploits the 'multi-target pattern rule' trick.
|
# This exploits the 'multi-target pattern rule' trick.
|
||||||
# The syncconfig should be executed only once to make all the targets.
|
# The syncconfig should be executed only once to make all the targets.
|
||||||
# (Note: use the grouped target '&:' when we bump to GNU Make 4.3)
|
# (Note: use the grouped target '&:' when we bump to GNU Make 4.3)
|
||||||
%/auto.conf %/auto.conf.cmd: $(KCONFIG_CONFIG)
|
%/config/auto.conf %/config/auto.conf.cmd %/generated/autoconf.h: $(KCONFIG_CONFIG)
|
||||||
$(Q)$(MAKE) -f $(srctree)/Makefile syncconfig
|
$(Q)$(MAKE) -f $(srctree)/Makefile syncconfig
|
||||||
else # !may-sync-config
|
else # !may-sync-config
|
||||||
# External modules and some install targets need include/generated/autoconf.h
|
# External modules and some install targets need include/generated/autoconf.h
|
||||||
@@ -818,6 +844,12 @@ DEBUG_CFLAGS += $(call cc-option, -femit-struct-debug-baseonly) \
|
|||||||
$(call cc-option,-fno-var-tracking)
|
$(call cc-option,-fno-var-tracking)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifdef CONFIG_DEBUG_INFO_COMPRESSED
|
||||||
|
DEBUG_CFLAGS += -gz=zlib
|
||||||
|
KBUILD_AFLAGS += -Wa,--compress-debug-sections=zlib
|
||||||
|
KBUILD_LDFLAGS += --compress-debug-sections=zlib
|
||||||
|
endif
|
||||||
|
|
||||||
KBUILD_CFLAGS += $(DEBUG_CFLAGS)
|
KBUILD_CFLAGS += $(DEBUG_CFLAGS)
|
||||||
export DEBUG_CFLAGS
|
export DEBUG_CFLAGS
|
||||||
|
|
||||||
@@ -974,6 +1006,10 @@ ifeq ($(CONFIG_RELR),y)
|
|||||||
LDFLAGS_vmlinux += --pack-dyn-relocs=relr
|
LDFLAGS_vmlinux += --pack-dyn-relocs=relr
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Align the bit size of userspace programs with the kernel
|
||||||
|
KBUILD_USERCFLAGS += $(filter -m32 -m64, $(KBUILD_CFLAGS))
|
||||||
|
KBUILD_USERLDFLAGS += $(filter -m32 -m64, $(KBUILD_CFLAGS))
|
||||||
|
|
||||||
# make the checker run with the right architecture
|
# make the checker run with the right architecture
|
||||||
CHECKFLAGS += --arch=$(ARCH)
|
CHECKFLAGS += --arch=$(ARCH)
|
||||||
|
|
||||||
@@ -1035,10 +1071,10 @@ export mod_strip_cmd
|
|||||||
mod_compress_cmd = true
|
mod_compress_cmd = true
|
||||||
ifdef CONFIG_MODULE_COMPRESS
|
ifdef CONFIG_MODULE_COMPRESS
|
||||||
ifdef CONFIG_MODULE_COMPRESS_GZIP
|
ifdef CONFIG_MODULE_COMPRESS_GZIP
|
||||||
mod_compress_cmd = gzip -n -f
|
mod_compress_cmd = $(_GZIP) -n -f
|
||||||
endif # CONFIG_MODULE_COMPRESS_GZIP
|
endif # CONFIG_MODULE_COMPRESS_GZIP
|
||||||
ifdef CONFIG_MODULE_COMPRESS_XZ
|
ifdef CONFIG_MODULE_COMPRESS_XZ
|
||||||
mod_compress_cmd = xz -f
|
mod_compress_cmd = $(XZ) -f
|
||||||
endif # CONFIG_MODULE_COMPRESS_XZ
|
endif # CONFIG_MODULE_COMPRESS_XZ
|
||||||
endif # CONFIG_MODULE_COMPRESS
|
endif # CONFIG_MODULE_COMPRESS
|
||||||
export mod_compress_cmd
|
export mod_compress_cmd
|
||||||
@@ -1073,34 +1109,33 @@ export MODULES_NSDEPS := $(extmod-prefix)modules.nsdeps
|
|||||||
ifeq ($(KBUILD_EXTMOD),)
|
ifeq ($(KBUILD_EXTMOD),)
|
||||||
core-y += kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/
|
core-y += kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/
|
||||||
|
|
||||||
vmlinux-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \
|
vmlinux-dirs := $(patsubst %/,%,$(filter %/, \
|
||||||
$(core-y) $(core-m) $(drivers-y) $(drivers-m) \
|
$(core-y) $(core-m) $(drivers-y) $(drivers-m) \
|
||||||
$(net-y) $(net-m) $(libs-y) $(libs-m) $(virt-y)))
|
$(libs-y) $(libs-m)))
|
||||||
|
|
||||||
vmlinux-alldirs := $(sort $(vmlinux-dirs) Documentation \
|
vmlinux-alldirs := $(sort $(vmlinux-dirs) Documentation \
|
||||||
$(patsubst %/,%,$(filter %/, $(init-) $(core-) \
|
$(patsubst %/,%,$(filter %/, $(core-) \
|
||||||
$(drivers-) $(net-) $(libs-) $(virt-))))
|
$(drivers-) $(libs-))))
|
||||||
|
|
||||||
|
subdir-modorder := $(addsuffix modules.order,$(filter %/, \
|
||||||
|
$(core-y) $(core-m) $(libs-y) $(libs-m) \
|
||||||
|
$(drivers-y) $(drivers-m)))
|
||||||
|
|
||||||
build-dirs := $(vmlinux-dirs)
|
build-dirs := $(vmlinux-dirs)
|
||||||
clean-dirs := $(vmlinux-alldirs)
|
clean-dirs := $(vmlinux-alldirs)
|
||||||
|
|
||||||
init-y := $(patsubst %/, %/built-in.a, $(init-y))
|
|
||||||
core-y := $(patsubst %/, %/built-in.a, $(core-y))
|
|
||||||
drivers-y := $(patsubst %/, %/built-in.a, $(drivers-y))
|
|
||||||
net-y := $(patsubst %/, %/built-in.a, $(net-y))
|
|
||||||
libs-y2 := $(patsubst %/, %/built-in.a, $(filter %/, $(libs-y)))
|
|
||||||
ifdef CONFIG_MODULES
|
|
||||||
libs-y1 := $(filter-out %/, $(libs-y))
|
|
||||||
libs-y2 += $(patsubst %/, %/lib.a, $(filter %/, $(libs-y)))
|
|
||||||
else
|
|
||||||
libs-y1 := $(patsubst %/, %/lib.a, $(libs-y))
|
|
||||||
endif
|
|
||||||
virt-y := $(patsubst %/, %/built-in.a, $(virt-y))
|
|
||||||
|
|
||||||
# Externally visible symbols (used by link-vmlinux.sh)
|
# Externally visible symbols (used by link-vmlinux.sh)
|
||||||
export KBUILD_VMLINUX_OBJS := $(head-y) $(init-y) $(core-y) $(libs-y2) \
|
KBUILD_VMLINUX_OBJS := $(head-y) $(patsubst %/,%/built-in.a, $(core-y))
|
||||||
$(drivers-y) $(net-y) $(virt-y)
|
KBUILD_VMLINUX_OBJS += $(addsuffix built-in.a, $(filter %/, $(libs-y)))
|
||||||
export KBUILD_VMLINUX_LIBS := $(libs-y1)
|
ifdef CONFIG_MODULES
|
||||||
|
KBUILD_VMLINUX_OBJS += $(patsubst %/, %/lib.a, $(filter %/, $(libs-y)))
|
||||||
|
KBUILD_VMLINUX_LIBS := $(filter-out %/, $(libs-y))
|
||||||
|
else
|
||||||
|
KBUILD_VMLINUX_LIBS := $(patsubst %/,%/lib.a, $(libs-y))
|
||||||
|
endif
|
||||||
|
KBUILD_VMLINUX_OBJS += $(patsubst %/,%/built-in.a, $(drivers-y))
|
||||||
|
|
||||||
|
export KBUILD_VMLINUX_OBJS KBUILD_VMLINUX_LIBS
|
||||||
export KBUILD_LDS := arch/$(SRCARCH)/kernel/vmlinux.lds
|
export KBUILD_LDS := arch/$(SRCARCH)/kernel/vmlinux.lds
|
||||||
export LDFLAGS_vmlinux
|
export LDFLAGS_vmlinux
|
||||||
# used by scripts/Makefile.package
|
# used by scripts/Makefile.package
|
||||||
@@ -1111,16 +1146,14 @@ vmlinux-deps := $(KBUILD_LDS) $(KBUILD_VMLINUX_OBJS) $(KBUILD_VMLINUX_LIBS)
|
|||||||
# Recurse until adjust_autoksyms.sh is satisfied
|
# Recurse until adjust_autoksyms.sh is satisfied
|
||||||
PHONY += autoksyms_recursive
|
PHONY += autoksyms_recursive
|
||||||
ifdef CONFIG_TRIM_UNUSED_KSYMS
|
ifdef CONFIG_TRIM_UNUSED_KSYMS
|
||||||
autoksyms_recursive: descend modules.order
|
|
||||||
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/adjust_autoksyms.sh \
|
|
||||||
"$(MAKE) -f $(srctree)/Makefile vmlinux"
|
|
||||||
endif
|
|
||||||
|
|
||||||
# For the kernel to actually contain only the needed exported symbols,
|
# For the kernel to actually contain only the needed exported symbols,
|
||||||
# we have to build modules as well to determine what those symbols are.
|
# we have to build modules as well to determine what those symbols are.
|
||||||
# (this can be evaluated only once include/config/auto.conf has been included)
|
# (this can be evaluated only once include/config/auto.conf has been included)
|
||||||
ifdef CONFIG_TRIM_UNUSED_KSYMS
|
KBUILD_MODULES := 1
|
||||||
KBUILD_MODULES := 1
|
|
||||||
|
autoksyms_recursive: descend modules.order
|
||||||
|
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/adjust_autoksyms.sh \
|
||||||
|
"$(MAKE) -f $(srctree)/Makefile vmlinux"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
autoksyms_h := $(if $(CONFIG_TRIM_UNUSED_KSYMS), include/generated/autoksyms.h)
|
autoksyms_h := $(if $(CONFIG_TRIM_UNUSED_KSYMS), include/generated/autoksyms.h)
|
||||||
@@ -1146,7 +1179,7 @@ targets := vmlinux
|
|||||||
|
|
||||||
# The actual objects are generated when descending,
|
# The actual objects are generated when descending,
|
||||||
# make sure no implicit rule kicks in
|
# make sure no implicit rule kicks in
|
||||||
$(sort $(vmlinux-deps)): descend ;
|
$(sort $(vmlinux-deps) $(subdir-modorder)): descend ;
|
||||||
|
|
||||||
filechk_kernel.release = \
|
filechk_kernel.release = \
|
||||||
echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))"
|
echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))"
|
||||||
@@ -1171,7 +1204,8 @@ scripts: scripts_basic scripts_dtc
|
|||||||
PHONY += prepare archprepare
|
PHONY += prepare archprepare
|
||||||
|
|
||||||
archprepare: outputmakefile archheaders archscripts scripts include/config/kernel.release \
|
archprepare: outputmakefile archheaders archscripts scripts include/config/kernel.release \
|
||||||
asm-generic $(version_h) $(autoksyms_h) include/generated/utsrelease.h
|
asm-generic $(version_h) $(autoksyms_h) include/generated/utsrelease.h \
|
||||||
|
include/generated/autoconf.h
|
||||||
|
|
||||||
prepare0: archprepare
|
prepare0: archprepare
|
||||||
$(Q)$(MAKE) $(build)=scripts/mod
|
$(Q)$(MAKE) $(build)=scripts/mod
|
||||||
@@ -1339,12 +1373,29 @@ dt_binding_check: scripts_dtc
|
|||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Modules
|
# Modules
|
||||||
|
|
||||||
|
# install modules.builtin regardless of CONFIG_MODULES
|
||||||
|
PHONY += _builtin_inst_
|
||||||
|
_builtin_inst_:
|
||||||
|
@mkdir -p $(MODLIB)/
|
||||||
|
@cp -f modules.builtin $(MODLIB)/
|
||||||
|
@cp -f $(objtree)/modules.builtin.modinfo $(MODLIB)/
|
||||||
|
|
||||||
|
PHONY += install
|
||||||
|
install: _builtin_inst_
|
||||||
|
|
||||||
ifdef CONFIG_MODULES
|
ifdef CONFIG_MODULES
|
||||||
|
|
||||||
# By default, build modules as well
|
# By default, build modules as well
|
||||||
|
|
||||||
all: modules
|
all: modules
|
||||||
|
|
||||||
|
# When we're building modules with modversions, we need to consider
|
||||||
|
# the built-in objects during the descend as well, in order to
|
||||||
|
# make sure the checksums are up to date before we record them.
|
||||||
|
ifdef CONFIG_MODVERSIONS
|
||||||
|
KBUILD_BUILTIN := 1
|
||||||
|
endif
|
||||||
|
|
||||||
# Build modules
|
# Build modules
|
||||||
#
|
#
|
||||||
# A module can be listed more than once in obj-m resulting in
|
# A module can be listed more than once in obj-m resulting in
|
||||||
@@ -1352,12 +1403,19 @@ all: modules
|
|||||||
# using awk while concatenating to the final file.
|
# using awk while concatenating to the final file.
|
||||||
|
|
||||||
PHONY += modules
|
PHONY += modules
|
||||||
modules: $(if $(KBUILD_BUILTIN),vmlinux) modules.order
|
modules: $(if $(KBUILD_BUILTIN),vmlinux) modules_check
|
||||||
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
|
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
|
||||||
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/modules-check.sh
|
|
||||||
|
|
||||||
modules.order: descend
|
PHONY += modules_check
|
||||||
$(Q)$(AWK) '!x[$$0]++' $(addsuffix /$@, $(build-dirs)) > $@
|
modules_check: modules.order
|
||||||
|
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/modules-check.sh $<
|
||||||
|
|
||||||
|
cmd_modules_order = $(AWK) '!x[$$0]++' $(real-prereqs) > $@
|
||||||
|
|
||||||
|
modules.order: $(subdir-modorder) FORCE
|
||||||
|
$(call if_changed,modules_order)
|
||||||
|
|
||||||
|
targets += modules.order
|
||||||
|
|
||||||
# Target to prepare building external modules
|
# Target to prepare building external modules
|
||||||
PHONY += modules_prepare
|
PHONY += modules_prepare
|
||||||
@@ -1368,7 +1426,7 @@ PHONY += modules_install
|
|||||||
modules_install: _modinst_ _modinst_post
|
modules_install: _modinst_ _modinst_post
|
||||||
|
|
||||||
PHONY += _modinst_
|
PHONY += _modinst_
|
||||||
_modinst_:
|
_modinst_: _builtin_inst_
|
||||||
@rm -rf $(MODLIB)/kernel
|
@rm -rf $(MODLIB)/kernel
|
||||||
@rm -f $(MODLIB)/source
|
@rm -f $(MODLIB)/source
|
||||||
@mkdir -p $(MODLIB)/kernel
|
@mkdir -p $(MODLIB)/kernel
|
||||||
@@ -1378,8 +1436,6 @@ _modinst_:
|
|||||||
ln -s $(CURDIR) $(MODLIB)/build ; \
|
ln -s $(CURDIR) $(MODLIB)/build ; \
|
||||||
fi
|
fi
|
||||||
@sed 's:^:kernel/:' modules.order > $(MODLIB)/modules.order
|
@sed 's:^:kernel/:' modules.order > $(MODLIB)/modules.order
|
||||||
@cp -f modules.builtin $(MODLIB)/
|
|
||||||
@cp -f $(objtree)/modules.builtin.modinfo $(MODLIB)/
|
|
||||||
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst
|
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst
|
||||||
|
|
||||||
# This depmod is only for convenience to give the initial
|
# This depmod is only for convenience to give the initial
|
||||||
@@ -1419,14 +1475,14 @@ endif # CONFIG_MODULES
|
|||||||
# make distclean Remove editor backup files, patch leftover files and the like
|
# make distclean Remove editor backup files, patch leftover files and the like
|
||||||
|
|
||||||
# Directories & files removed with 'make clean'
|
# Directories & files removed with 'make clean'
|
||||||
CLEAN_DIRS += include/ksym
|
CLEAN_FILES += include/ksym vmlinux.symvers \
|
||||||
CLEAN_FILES += modules.builtin modules.builtin.modinfo modules.nsdeps
|
modules.builtin modules.builtin.modinfo modules.nsdeps
|
||||||
|
|
||||||
# Directories & files removed with 'make mrproper'
|
# Directories & files removed with 'make mrproper'
|
||||||
MRPROPER_DIRS += include/config include/generated \
|
MRPROPER_FILES += include/config include/generated \
|
||||||
arch/$(SRCARCH)/include/generated .tmp_objdiff \
|
arch/$(SRCARCH)/include/generated .tmp_objdiff \
|
||||||
debian/ snap/ tar-install/
|
debian snap tar-install \
|
||||||
MRPROPER_FILES += .config .config.old .version \
|
.config .config.old .version \
|
||||||
Module.symvers \
|
Module.symvers \
|
||||||
signing_key.pem signing_key.priv signing_key.x509 \
|
signing_key.pem signing_key.priv signing_key.x509 \
|
||||||
x509.genkey extra_certificates signing_key.x509.keyid \
|
x509.genkey extra_certificates signing_key.x509.keyid \
|
||||||
@@ -1434,12 +1490,10 @@ MRPROPER_FILES += .config .config.old .version \
|
|||||||
*.spec
|
*.spec
|
||||||
|
|
||||||
# Directories & files removed with 'make distclean'
|
# Directories & files removed with 'make distclean'
|
||||||
DISTCLEAN_DIRS +=
|
|
||||||
DISTCLEAN_FILES += tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS
|
DISTCLEAN_FILES += tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS
|
||||||
|
|
||||||
# clean - Delete most, but leave enough to build external modules
|
# clean - Delete most, but leave enough to build external modules
|
||||||
#
|
#
|
||||||
clean: rm-dirs := $(CLEAN_DIRS)
|
|
||||||
clean: rm-files := $(CLEAN_FILES)
|
clean: rm-files := $(CLEAN_FILES)
|
||||||
|
|
||||||
PHONY += archclean vmlinuxclean
|
PHONY += archclean vmlinuxclean
|
||||||
@@ -1452,7 +1506,6 @@ clean: archclean vmlinuxclean
|
|||||||
|
|
||||||
# mrproper - Delete all generated files, including .config
|
# mrproper - Delete all generated files, including .config
|
||||||
#
|
#
|
||||||
mrproper: rm-dirs := $(wildcard $(MRPROPER_DIRS))
|
|
||||||
mrproper: rm-files := $(wildcard $(MRPROPER_FILES))
|
mrproper: rm-files := $(wildcard $(MRPROPER_FILES))
|
||||||
mrproper-dirs := $(addprefix _mrproper_,scripts)
|
mrproper-dirs := $(addprefix _mrproper_,scripts)
|
||||||
|
|
||||||
@@ -1461,18 +1514,15 @@ $(mrproper-dirs):
|
|||||||
$(Q)$(MAKE) $(clean)=$(patsubst _mrproper_%,%,$@)
|
$(Q)$(MAKE) $(clean)=$(patsubst _mrproper_%,%,$@)
|
||||||
|
|
||||||
mrproper: clean $(mrproper-dirs)
|
mrproper: clean $(mrproper-dirs)
|
||||||
$(call cmd,rmdirs)
|
|
||||||
$(call cmd,rmfiles)
|
$(call cmd,rmfiles)
|
||||||
|
|
||||||
# distclean
|
# distclean
|
||||||
#
|
#
|
||||||
distclean: rm-dirs := $(wildcard $(DISTCLEAN_DIRS))
|
|
||||||
distclean: rm-files := $(wildcard $(DISTCLEAN_FILES))
|
distclean: rm-files := $(wildcard $(DISTCLEAN_FILES))
|
||||||
|
|
||||||
PHONY += distclean
|
PHONY += distclean
|
||||||
|
|
||||||
distclean: mrproper
|
distclean: mrproper
|
||||||
$(call cmd,rmdirs)
|
|
||||||
$(call cmd,rmfiles)
|
$(call cmd,rmfiles)
|
||||||
@find $(srctree) $(RCS_FIND_IGNORE) \
|
@find $(srctree) $(RCS_FIND_IGNORE) \
|
||||||
\( -name '*.orig' -o -name '*.rej' -o -name '*~' \
|
\( -name '*.orig' -o -name '*.rej' -o -name '*~' \
|
||||||
@@ -1658,17 +1708,9 @@ else # KBUILD_EXTMOD
|
|||||||
# We are always building modules
|
# We are always building modules
|
||||||
KBUILD_MODULES := 1
|
KBUILD_MODULES := 1
|
||||||
|
|
||||||
PHONY += $(objtree)/Module.symvers
|
|
||||||
$(objtree)/Module.symvers:
|
|
||||||
@test -e $(objtree)/Module.symvers || ( \
|
|
||||||
echo; \
|
|
||||||
echo " WARNING: Symbol version dump $(objtree)/Module.symvers"; \
|
|
||||||
echo " is missing; modules will have no dependencies and modversions."; \
|
|
||||||
echo )
|
|
||||||
|
|
||||||
build-dirs := $(KBUILD_EXTMOD)
|
build-dirs := $(KBUILD_EXTMOD)
|
||||||
PHONY += modules
|
PHONY += modules
|
||||||
modules: descend $(objtree)/Module.symvers
|
modules: descend
|
||||||
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
|
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
|
||||||
|
|
||||||
PHONY += modules_install
|
PHONY += modules_install
|
||||||
@@ -1687,10 +1729,6 @@ _emodinst_post: _emodinst_
|
|||||||
clean-dirs := $(KBUILD_EXTMOD)
|
clean-dirs := $(KBUILD_EXTMOD)
|
||||||
clean: rm-files := $(KBUILD_EXTMOD)/Module.symvers $(KBUILD_EXTMOD)/modules.nsdeps
|
clean: rm-files := $(KBUILD_EXTMOD)/Module.symvers $(KBUILD_EXTMOD)/modules.nsdeps
|
||||||
|
|
||||||
PHONY += /
|
|
||||||
/:
|
|
||||||
@echo >&2 '"$(MAKE) /" is no longer supported. Please use "$(MAKE) ./" instead.'
|
|
||||||
|
|
||||||
PHONY += help
|
PHONY += help
|
||||||
help:
|
help:
|
||||||
@echo ' Building external modules.'
|
@echo ' Building external modules.'
|
||||||
@@ -1748,6 +1786,10 @@ build-dirs := $(foreach d, $(build-dirs), \
|
|||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifndef CONFIG_MODULES
|
||||||
|
KBUILD_MODULES :=
|
||||||
|
endif
|
||||||
|
|
||||||
# Handle descending into subdirectories listed in $(build-dirs)
|
# Handle descending into subdirectories listed in $(build-dirs)
|
||||||
# Preset locale variables to speed up the build process. Limit locale
|
# Preset locale variables to speed up the build process. Limit locale
|
||||||
# tweaks to this spot to avoid wrong language settings when running
|
# tweaks to this spot to avoid wrong language settings when running
|
||||||
@@ -1766,7 +1808,6 @@ $(clean-dirs):
|
|||||||
$(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@)
|
$(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@)
|
||||||
|
|
||||||
clean: $(clean-dirs)
|
clean: $(clean-dirs)
|
||||||
$(call cmd,rmdirs)
|
|
||||||
$(call cmd,rmfiles)
|
$(call cmd,rmfiles)
|
||||||
@find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \
|
@find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \
|
||||||
\( -name '*.[aios]' -o -name '*.ko' -o -name '.*.cmd' \
|
\( -name '*.[aios]' -o -name '*.ko' -o -name '.*.cmd' \
|
||||||
@@ -1861,14 +1902,8 @@ tools/%: FORCE
|
|||||||
$(Q)mkdir -p $(objtree)/tools
|
$(Q)mkdir -p $(objtree)/tools
|
||||||
$(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(abspath $(objtree)) subdir=tools -C $(srctree)/tools/ $*
|
$(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(abspath $(objtree)) subdir=tools -C $(srctree)/tools/ $*
|
||||||
|
|
||||||
# FIXME Should go into a make.lib or something
|
|
||||||
# ===========================================================================
|
|
||||||
|
|
||||||
quiet_cmd_rmdirs = $(if $(wildcard $(rm-dirs)),CLEAN $(wildcard $(rm-dirs)))
|
|
||||||
cmd_rmdirs = rm -rf $(rm-dirs)
|
|
||||||
|
|
||||||
quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files)))
|
quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files)))
|
||||||
cmd_rmfiles = rm -f $(rm-files)
|
cmd_rmfiles = rm -rf $(rm-files)
|
||||||
|
|
||||||
# Run depmod only if we have System.map and depmod is executable
|
# Run depmod only if we have System.map and depmod is executable
|
||||||
quiet_cmd_depmod = DEPMOD $(KERNELRELEASE)
|
quiet_cmd_depmod = DEPMOD $(KERNELRELEASE)
|
||||||
|
@@ -45,12 +45,10 @@ endif
|
|||||||
ifeq ($(CONFIG_CPU_BIG_ENDIAN),y)
|
ifeq ($(CONFIG_CPU_BIG_ENDIAN),y)
|
||||||
KBUILD_CPPFLAGS += -mbig-endian
|
KBUILD_CPPFLAGS += -mbig-endian
|
||||||
CHECKFLAGS += -D__ARMEB__
|
CHECKFLAGS += -D__ARMEB__
|
||||||
AS += -EB
|
|
||||||
KBUILD_LDFLAGS += -EB
|
KBUILD_LDFLAGS += -EB
|
||||||
else
|
else
|
||||||
KBUILD_CPPFLAGS += -mlittle-endian
|
KBUILD_CPPFLAGS += -mlittle-endian
|
||||||
CHECKFLAGS += -D__ARMEL__
|
CHECKFLAGS += -D__ARMEL__
|
||||||
AS += -EL
|
|
||||||
KBUILD_LDFLAGS += -EL
|
KBUILD_LDFLAGS += -EL
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@@ -56,7 +56,7 @@ trap 'rm -f "$XIPIMAGE.tmp"; exit 1' 1 2 3
|
|||||||
# substitute the data section by a compressed version
|
# substitute the data section by a compressed version
|
||||||
$DD if="$XIPIMAGE" count=$data_start iflag=count_bytes of="$XIPIMAGE.tmp"
|
$DD if="$XIPIMAGE" count=$data_start iflag=count_bytes of="$XIPIMAGE.tmp"
|
||||||
$DD if="$XIPIMAGE" skip=$data_start iflag=skip_bytes |
|
$DD if="$XIPIMAGE" skip=$data_start iflag=skip_bytes |
|
||||||
gzip -9 >> "$XIPIMAGE.tmp"
|
$_GZIP -9 >> "$XIPIMAGE.tmp"
|
||||||
|
|
||||||
# replace kernel binary
|
# replace kernel binary
|
||||||
mv -f "$XIPIMAGE.tmp" "$XIPIMAGE"
|
mv -f "$XIPIMAGE.tmp" "$XIPIMAGE"
|
||||||
|
@@ -94,7 +94,6 @@ endif
|
|||||||
ifeq ($(CONFIG_CPU_BIG_ENDIAN), y)
|
ifeq ($(CONFIG_CPU_BIG_ENDIAN), y)
|
||||||
KBUILD_CPPFLAGS += -mbig-endian
|
KBUILD_CPPFLAGS += -mbig-endian
|
||||||
CHECKFLAGS += -D__AARCH64EB__
|
CHECKFLAGS += -D__AARCH64EB__
|
||||||
AS += -EB
|
|
||||||
# Prefer the baremetal ELF build target, but not all toolchains include
|
# Prefer the baremetal ELF build target, but not all toolchains include
|
||||||
# it so fall back to the standard linux version if needed.
|
# it so fall back to the standard linux version if needed.
|
||||||
KBUILD_LDFLAGS += -EB $(call ld-option, -maarch64elfb, -maarch64linuxb)
|
KBUILD_LDFLAGS += -EB $(call ld-option, -maarch64elfb, -maarch64linuxb)
|
||||||
@@ -102,7 +101,6 @@ UTS_MACHINE := aarch64_be
|
|||||||
else
|
else
|
||||||
KBUILD_CPPFLAGS += -mlittle-endian
|
KBUILD_CPPFLAGS += -mlittle-endian
|
||||||
CHECKFLAGS += -D__AARCH64EL__
|
CHECKFLAGS += -D__AARCH64EL__
|
||||||
AS += -EL
|
|
||||||
# Same as above, prefer ELF but fall back to linux target if needed.
|
# Same as above, prefer ELF but fall back to linux target if needed.
|
||||||
KBUILD_LDFLAGS += -EL $(call ld-option, -maarch64elf, -maarch64linux)
|
KBUILD_LDFLAGS += -EL $(call ld-option, -maarch64elf, -maarch64linux)
|
||||||
UTS_MACHINE := aarch64
|
UTS_MACHINE := aarch64
|
||||||
|
@@ -117,7 +117,7 @@ pci_acpi_setup_ecam_mapping(struct acpi_pci_root *root)
|
|||||||
struct device *dev = &root->device->dev;
|
struct device *dev = &root->device->dev;
|
||||||
struct resource *bus_res = &root->secondary;
|
struct resource *bus_res = &root->secondary;
|
||||||
u16 seg = root->segment;
|
u16 seg = root->segment;
|
||||||
struct pci_ecam_ops *ecam_ops;
|
const struct pci_ecam_ops *ecam_ops;
|
||||||
struct resource cfgres;
|
struct resource cfgres;
|
||||||
struct acpi_device *adev;
|
struct acpi_device *adev;
|
||||||
struct pci_config_window *cfg;
|
struct pci_config_window *cfg;
|
||||||
@@ -185,7 +185,7 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
|
|||||||
|
|
||||||
root_ops->release_info = pci_acpi_generic_release_info;
|
root_ops->release_info = pci_acpi_generic_release_info;
|
||||||
root_ops->prepare_resources = pci_acpi_root_prepare_resources;
|
root_ops->prepare_resources = pci_acpi_root_prepare_resources;
|
||||||
root_ops->pci_ops = &ri->cfg->ops->pci_ops;
|
root_ops->pci_ops = (struct pci_ops *)&ri->cfg->ops->pci_ops;
|
||||||
bus = acpi_pci_root_create(root, root_ops, &ri->common, ri->cfg);
|
bus = acpi_pci_root_create(root, root_ops, &ri->common, ri->cfg);
|
||||||
if (!bus)
|
if (!bus)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@@ -18,7 +18,7 @@ CONFIG_MEMORY_START ?= 0x00400000
|
|||||||
CONFIG_BOOT_LINK_OFFSET ?= 0x00280000
|
CONFIG_BOOT_LINK_OFFSET ?= 0x00280000
|
||||||
IMAGE_OFFSET := $(shell printf "0x%08x" $$(($(CONFIG_MEMORY_START)+$(CONFIG_BOOT_LINK_OFFSET))))
|
IMAGE_OFFSET := $(shell printf "0x%08x" $$(($(CONFIG_MEMORY_START)+$(CONFIG_BOOT_LINK_OFFSET))))
|
||||||
|
|
||||||
LIBGCC := $(shell $(CROSS-COMPILE)$(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
|
LIBGCC := $(shell $(CROSS-COMPILE)$(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name 2>/dev/null)
|
||||||
LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -estartup -T $(obj)/vmlinux.lds \
|
LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -estartup -T $(obj)/vmlinux.lds \
|
||||||
--defsym output=$(CONFIG_MEMORY_START)
|
--defsym output=$(CONFIG_MEMORY_START)
|
||||||
|
|
||||||
|
@@ -30,7 +30,7 @@ TIR_NAME := r19
|
|||||||
KBUILD_CFLAGS += -ffixed-$(TIR_NAME) -DTHREADINFO_REG=$(TIR_NAME) -D__linux__
|
KBUILD_CFLAGS += -ffixed-$(TIR_NAME) -DTHREADINFO_REG=$(TIR_NAME) -D__linux__
|
||||||
KBUILD_AFLAGS += -DTHREADINFO_REG=$(TIR_NAME)
|
KBUILD_AFLAGS += -DTHREADINFO_REG=$(TIR_NAME)
|
||||||
|
|
||||||
LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
|
LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name 2>/dev/null)
|
||||||
libs-y += $(LIBGCC)
|
libs-y += $(LIBGCC)
|
||||||
|
|
||||||
head-y := arch/hexagon/kernel/head.o
|
head-y := arch/hexagon/kernel/head.o
|
||||||
|
@@ -40,7 +40,7 @@ $(error Sorry, you need a newer version of the assember, one that is built from
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
quiet_cmd_gzip = GZIP $@
|
quiet_cmd_gzip = GZIP $@
|
||||||
cmd_gzip = cat $(real-prereqs) | gzip -n -f -9 > $@
|
cmd_gzip = cat $(real-prereqs) | $(_GZIP) -n -f -9 > $@
|
||||||
|
|
||||||
quiet_cmd_objcopy = OBJCOPY $@
|
quiet_cmd_objcopy = OBJCOPY $@
|
||||||
cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@
|
cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@
|
||||||
|
@@ -135,10 +135,10 @@ vmlinux.gz: vmlinux
|
|||||||
ifndef CONFIG_KGDB
|
ifndef CONFIG_KGDB
|
||||||
cp vmlinux vmlinux.tmp
|
cp vmlinux vmlinux.tmp
|
||||||
$(STRIP) vmlinux.tmp
|
$(STRIP) vmlinux.tmp
|
||||||
gzip -9c vmlinux.tmp >vmlinux.gz
|
$(_GZIP) -9c vmlinux.tmp >vmlinux.gz
|
||||||
rm vmlinux.tmp
|
rm vmlinux.tmp
|
||||||
else
|
else
|
||||||
gzip -9c vmlinux >vmlinux.gz
|
$(_GZIP) -9c vmlinux >vmlinux.gz
|
||||||
endif
|
endif
|
||||||
|
|
||||||
bzImage: vmlinux.bz2
|
bzImage: vmlinux.bz2
|
||||||
@@ -148,10 +148,10 @@ vmlinux.bz2: vmlinux
|
|||||||
ifndef CONFIG_KGDB
|
ifndef CONFIG_KGDB
|
||||||
cp vmlinux vmlinux.tmp
|
cp vmlinux vmlinux.tmp
|
||||||
$(STRIP) vmlinux.tmp
|
$(STRIP) vmlinux.tmp
|
||||||
bzip2 -1c vmlinux.tmp >vmlinux.bz2
|
$(_BZIP2) -1c vmlinux.tmp >vmlinux.bz2
|
||||||
rm vmlinux.tmp
|
rm vmlinux.tmp
|
||||||
else
|
else
|
||||||
bzip2 -1c vmlinux >vmlinux.bz2
|
$(_BZIP2) -1c vmlinux >vmlinux.bz2
|
||||||
endif
|
endif
|
||||||
|
|
||||||
archclean:
|
archclean:
|
||||||
|
@@ -162,7 +162,7 @@ vmlinuz: bzImage
|
|||||||
$(OBJCOPY) $(boot)/bzImage $@
|
$(OBJCOPY) $(boot)/bzImage $@
|
||||||
else
|
else
|
||||||
vmlinuz: vmlinux
|
vmlinuz: vmlinux
|
||||||
@gzip -cf -9 $< > $@
|
@$(_GZIP) -cf -9 $< > $@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
install:
|
install:
|
||||||
|
@@ -53,15 +53,6 @@ config SUPERH
|
|||||||
select HAVE_NMI
|
select HAVE_NMI
|
||||||
select NEED_SG_DMA_LENGTH
|
select NEED_SG_DMA_LENGTH
|
||||||
select ARCH_HAS_GIGANTIC_PAGE
|
select ARCH_HAS_GIGANTIC_PAGE
|
||||||
|
|
||||||
help
|
|
||||||
The SuperH is a RISC processor targeted for use in embedded systems
|
|
||||||
and consumer electronics; it was also used in the Sega Dreamcast
|
|
||||||
gaming console. The SuperH port has a home page at
|
|
||||||
<http://www.linux-sh.org/>.
|
|
||||||
|
|
||||||
config SUPERH32
|
|
||||||
def_bool "$(ARCH)" = "sh"
|
|
||||||
select ARCH_32BIT_OFF_T
|
select ARCH_32BIT_OFF_T
|
||||||
select GUP_GET_PTE_LOW_HIGH if X2TLB
|
select GUP_GET_PTE_LOW_HIGH if X2TLB
|
||||||
select HAVE_KPROBES
|
select HAVE_KPROBES
|
||||||
@@ -79,19 +70,15 @@ config SUPERH32
|
|||||||
select ARCH_HIBERNATION_POSSIBLE if MMU
|
select ARCH_HIBERNATION_POSSIBLE if MMU
|
||||||
select SPARSE_IRQ
|
select SPARSE_IRQ
|
||||||
select HAVE_STACKPROTECTOR
|
select HAVE_STACKPROTECTOR
|
||||||
|
help
|
||||||
config SUPERH64
|
The SuperH is a RISC processor targeted for use in embedded systems
|
||||||
def_bool "$(ARCH)" = "sh64"
|
and consumer electronics; it was also used in the Sega Dreamcast
|
||||||
select HAVE_EXIT_THREAD
|
gaming console. The SuperH port has a home page at
|
||||||
select KALLSYMS
|
<http://www.linux-sh.org/>.
|
||||||
|
|
||||||
config GENERIC_BUG
|
config GENERIC_BUG
|
||||||
def_bool y
|
def_bool y
|
||||||
depends on BUG && SUPERH32
|
depends on BUG
|
||||||
|
|
||||||
config GENERIC_CSUM
|
|
||||||
def_bool y
|
|
||||||
depends on SUPERH64
|
|
||||||
|
|
||||||
config GENERIC_HWEIGHT
|
config GENERIC_HWEIGHT
|
||||||
def_bool y
|
def_bool y
|
||||||
@@ -201,12 +188,6 @@ config CPU_SH4AL_DSP
|
|||||||
select CPU_SH4A
|
select CPU_SH4A
|
||||||
select CPU_HAS_DSP
|
select CPU_HAS_DSP
|
||||||
|
|
||||||
config CPU_SH5
|
|
||||||
bool
|
|
||||||
select CPU_HAS_FPU
|
|
||||||
select SYS_SUPPORTS_SH_TMU
|
|
||||||
select SYS_SUPPORTS_HUGETLBFS if MMU
|
|
||||||
|
|
||||||
config CPU_SHX2
|
config CPU_SHX2
|
||||||
bool
|
bool
|
||||||
|
|
||||||
@@ -226,8 +207,6 @@ config CPU_HAS_PMU
|
|||||||
default y
|
default y
|
||||||
bool
|
bool
|
||||||
|
|
||||||
if SUPERH32
|
|
||||||
|
|
||||||
choice
|
choice
|
||||||
prompt "Processor sub-type selection"
|
prompt "Processor sub-type selection"
|
||||||
|
|
||||||
@@ -516,27 +495,6 @@ config CPU_SUBTYPE_SH7366
|
|||||||
|
|
||||||
endchoice
|
endchoice
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
if SUPERH64
|
|
||||||
|
|
||||||
choice
|
|
||||||
prompt "Processor sub-type selection"
|
|
||||||
|
|
||||||
# SH-5 Processor Support
|
|
||||||
|
|
||||||
config CPU_SUBTYPE_SH5_101
|
|
||||||
bool "Support SH5-101 processor"
|
|
||||||
select CPU_SH5
|
|
||||||
|
|
||||||
config CPU_SUBTYPE_SH5_103
|
|
||||||
bool "Support SH5-103 processor"
|
|
||||||
select CPU_SH5
|
|
||||||
|
|
||||||
endchoice
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
source "arch/sh/mm/Kconfig"
|
source "arch/sh/mm/Kconfig"
|
||||||
|
|
||||||
source "arch/sh/Kconfig.cpu"
|
source "arch/sh/Kconfig.cpu"
|
||||||
@@ -590,7 +548,7 @@ source "kernel/Kconfig.hz"
|
|||||||
|
|
||||||
config KEXEC
|
config KEXEC
|
||||||
bool "kexec system call (EXPERIMENTAL)"
|
bool "kexec system call (EXPERIMENTAL)"
|
||||||
depends on SUPERH32 && MMU
|
depends on MMU
|
||||||
select KEXEC_CORE
|
select KEXEC_CORE
|
||||||
help
|
help
|
||||||
kexec is a system call that implements the ability to shutdown your
|
kexec is a system call that implements the ability to shutdown your
|
||||||
@@ -608,7 +566,7 @@ config KEXEC
|
|||||||
|
|
||||||
config CRASH_DUMP
|
config CRASH_DUMP
|
||||||
bool "kernel crash dumps (EXPERIMENTAL)"
|
bool "kernel crash dumps (EXPERIMENTAL)"
|
||||||
depends on SUPERH32 && BROKEN_ON_SMP
|
depends on BROKEN_ON_SMP
|
||||||
help
|
help
|
||||||
Generate crash dump after being started by kexec.
|
Generate crash dump after being started by kexec.
|
||||||
This should be normally only set in special crash dump kernels
|
This should be normally only set in special crash dump kernels
|
||||||
@@ -622,7 +580,7 @@ config CRASH_DUMP
|
|||||||
|
|
||||||
config KEXEC_JUMP
|
config KEXEC_JUMP
|
||||||
bool "kexec jump (EXPERIMENTAL)"
|
bool "kexec jump (EXPERIMENTAL)"
|
||||||
depends on SUPERH32 && KEXEC && HIBERNATION
|
depends on KEXEC && HIBERNATION
|
||||||
help
|
help
|
||||||
Jump between original kernel and kexeced kernel and invoke
|
Jump between original kernel and kexeced kernel and invoke
|
||||||
code via KEXEC
|
code via KEXEC
|
||||||
@@ -699,7 +657,7 @@ config HOTPLUG_CPU
|
|||||||
|
|
||||||
config GUSA
|
config GUSA
|
||||||
def_bool y
|
def_bool y
|
||||||
depends on !SMP && SUPERH32
|
depends on !SMP
|
||||||
help
|
help
|
||||||
This enables support for gUSA (general UserSpace Atomicity).
|
This enables support for gUSA (general UserSpace Atomicity).
|
||||||
This is the default implementation for both UP and non-ll/sc
|
This is the default implementation for both UP and non-ll/sc
|
||||||
|
@@ -13,7 +13,6 @@ config CPU_LITTLE_ENDIAN
|
|||||||
|
|
||||||
config CPU_BIG_ENDIAN
|
config CPU_BIG_ENDIAN
|
||||||
bool "Big Endian"
|
bool "Big Endian"
|
||||||
depends on !CPU_SH5
|
|
||||||
|
|
||||||
endchoice
|
endchoice
|
||||||
|
|
||||||
@@ -27,10 +26,6 @@ config SH_FPU
|
|||||||
|
|
||||||
This option must be set in order to enable the FPU.
|
This option must be set in order to enable the FPU.
|
||||||
|
|
||||||
config SH64_FPU_DENORM_FLUSH
|
|
||||||
bool "Flush floating point denorms to zero"
|
|
||||||
depends on SH_FPU && SUPERH64
|
|
||||||
|
|
||||||
config SH_FPU_EMU
|
config SH_FPU_EMU
|
||||||
def_bool n
|
def_bool n
|
||||||
prompt "FPU emulation support"
|
prompt "FPU emulation support"
|
||||||
@@ -77,10 +72,6 @@ config SPECULATIVE_EXECUTION
|
|||||||
|
|
||||||
If unsure, say N.
|
If unsure, say N.
|
||||||
|
|
||||||
config SH64_ID2815_WORKAROUND
|
|
||||||
bool "Include workaround for SH5-101 cut2 silicon defect ID2815"
|
|
||||||
depends on CPU_SUBTYPE_SH5_101
|
|
||||||
|
|
||||||
config CPU_HAS_INTEVT
|
config CPU_HAS_INTEVT
|
||||||
bool
|
bool
|
||||||
|
|
||||||
|
@@ -5,7 +5,6 @@ config TRACE_IRQFLAGS_SUPPORT
|
|||||||
|
|
||||||
config SH_STANDARD_BIOS
|
config SH_STANDARD_BIOS
|
||||||
bool "Use LinuxSH standard BIOS"
|
bool "Use LinuxSH standard BIOS"
|
||||||
depends on SUPERH32
|
|
||||||
help
|
help
|
||||||
Say Y here if your target has the gdb-sh-stub
|
Say Y here if your target has the gdb-sh-stub
|
||||||
package from www.m17n.org (or any conforming standard LinuxSH BIOS)
|
package from www.m17n.org (or any conforming standard LinuxSH BIOS)
|
||||||
@@ -19,7 +18,7 @@ config SH_STANDARD_BIOS
|
|||||||
|
|
||||||
config STACK_DEBUG
|
config STACK_DEBUG
|
||||||
bool "Check for stack overflows"
|
bool "Check for stack overflows"
|
||||||
depends on DEBUG_KERNEL && SUPERH32
|
depends on DEBUG_KERNEL
|
||||||
help
|
help
|
||||||
This option will cause messages to be printed if free stack space
|
This option will cause messages to be printed if free stack space
|
||||||
drops below a certain limit. Saying Y here will add overhead to
|
drops below a certain limit. Saying Y here will add overhead to
|
||||||
@@ -38,7 +37,7 @@ config 4KSTACKS
|
|||||||
|
|
||||||
config IRQSTACKS
|
config IRQSTACKS
|
||||||
bool "Use separate kernel stacks when processing interrupts"
|
bool "Use separate kernel stacks when processing interrupts"
|
||||||
depends on DEBUG_KERNEL && SUPERH32 && BROKEN
|
depends on DEBUG_KERNEL && BROKEN
|
||||||
help
|
help
|
||||||
If you say Y here the kernel will use separate kernel stacks
|
If you say Y here the kernel will use separate kernel stacks
|
||||||
for handling hard and soft interrupts. This can help avoid
|
for handling hard and soft interrupts. This can help avoid
|
||||||
@@ -46,7 +45,7 @@ config IRQSTACKS
|
|||||||
|
|
||||||
config DUMP_CODE
|
config DUMP_CODE
|
||||||
bool "Show disassembly of nearby code in register dumps"
|
bool "Show disassembly of nearby code in register dumps"
|
||||||
depends on DEBUG_KERNEL && SUPERH32
|
depends on DEBUG_KERNEL
|
||||||
default y if DEBUG_BUGVERBOSE
|
default y if DEBUG_BUGVERBOSE
|
||||||
default n
|
default n
|
||||||
help
|
help
|
||||||
@@ -59,7 +58,6 @@ config DUMP_CODE
|
|||||||
config DWARF_UNWINDER
|
config DWARF_UNWINDER
|
||||||
bool "Enable the DWARF unwinder for stacktraces"
|
bool "Enable the DWARF unwinder for stacktraces"
|
||||||
select FRAME_POINTER
|
select FRAME_POINTER
|
||||||
depends on SUPERH32
|
|
||||||
default n
|
default n
|
||||||
help
|
help
|
||||||
Enabling this option will make stacktraces more accurate, at
|
Enabling this option will make stacktraces more accurate, at
|
||||||
@@ -77,11 +75,6 @@ config SH_NO_BSS_INIT
|
|||||||
For all other cases, say N. If this option seems perplexing, or
|
For all other cases, say N. If this option seems perplexing, or
|
||||||
you aren't sure, say N.
|
you aren't sure, say N.
|
||||||
|
|
||||||
config SH64_SR_WATCH
|
|
||||||
bool "Debug: set SR.WATCH to enable hardware watchpoints and trace"
|
|
||||||
depends on SUPERH64
|
|
||||||
|
|
||||||
config MCOUNT
|
config MCOUNT
|
||||||
def_bool y
|
def_bool y
|
||||||
depends on SUPERH32
|
|
||||||
depends on STACK_DEBUG || FUNCTION_TRACER
|
depends on STACK_DEBUG || FUNCTION_TRACER
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
#
|
#
|
||||||
ifneq ($(SUBARCH),$(ARCH))
|
ifneq ($(SUBARCH),$(ARCH))
|
||||||
ifeq ($(CROSS_COMPILE),)
|
ifeq ($(CROSS_COMPILE),)
|
||||||
CROSS_COMPILE := $(call cc-cross-prefix, $(UTS_MACHINE)-linux- $(UTS_MACHINE)-linux-gnu- $(UTS_MACHINE)-unknown-linux-gnu-)
|
CROSS_COMPILE := $(call cc-cross-prefix, sh-linux- sh-linux-gnu- sh-unknown-linux-gnu-)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -29,12 +29,9 @@ isa-$(CONFIG_CPU_SH3) := sh3
|
|||||||
isa-$(CONFIG_CPU_SH4) := sh4
|
isa-$(CONFIG_CPU_SH4) := sh4
|
||||||
isa-$(CONFIG_CPU_SH4A) := sh4a
|
isa-$(CONFIG_CPU_SH4A) := sh4a
|
||||||
isa-$(CONFIG_CPU_SH4AL_DSP) := sh4al
|
isa-$(CONFIG_CPU_SH4AL_DSP) := sh4al
|
||||||
isa-$(CONFIG_CPU_SH5) := shmedia
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_SUPERH32),y)
|
|
||||||
isa-$(CONFIG_SH_DSP) := $(isa-y)-dsp
|
isa-$(CONFIG_SH_DSP) := $(isa-y)-dsp
|
||||||
isa-y := $(isa-y)-up
|
isa-y := $(isa-y)-up
|
||||||
endif
|
|
||||||
|
|
||||||
cflags-$(CONFIG_CPU_SH2) := $(call cc-option,-m2,)
|
cflags-$(CONFIG_CPU_SH2) := $(call cc-option,-m2,)
|
||||||
cflags-$(CONFIG_CPU_J2) += $(call cc-option,-mj2,)
|
cflags-$(CONFIG_CPU_J2) += $(call cc-option,-mj2,)
|
||||||
@@ -47,7 +44,6 @@ cflags-$(CONFIG_CPU_SH4) := $(call cc-option,-m4,) \
|
|||||||
cflags-$(CONFIG_CPU_SH4A) += $(call cc-option,-m4a,) \
|
cflags-$(CONFIG_CPU_SH4A) += $(call cc-option,-m4a,) \
|
||||||
$(call cc-option,-m4a-nofpu,)
|
$(call cc-option,-m4a-nofpu,)
|
||||||
cflags-$(CONFIG_CPU_SH4AL_DSP) += $(call cc-option,-m4al,)
|
cflags-$(CONFIG_CPU_SH4AL_DSP) += $(call cc-option,-m4al,)
|
||||||
cflags-$(CONFIG_CPU_SH5) := $(call cc-option,-m5-32media-nofpu,)
|
|
||||||
|
|
||||||
ifeq ($(cflags-y),)
|
ifeq ($(cflags-y),)
|
||||||
#
|
#
|
||||||
@@ -88,7 +84,7 @@ OBJCOPYFLAGS := -O binary -R .note -R .note.gnu.build-id -R .comment \
|
|||||||
-R .stab -R .stabstr -S
|
-R .stab -R .stabstr -S
|
||||||
|
|
||||||
# Give the various platforms the opportunity to set default image types
|
# Give the various platforms the opportunity to set default image types
|
||||||
defaultimage-$(CONFIG_SUPERH32) := zImage
|
defaultimage-y := zImage
|
||||||
defaultimage-$(CONFIG_SH_SH7785LCR) := uImage
|
defaultimage-$(CONFIG_SH_SH7785LCR) := uImage
|
||||||
defaultimage-$(CONFIG_SH_RSK) := uImage
|
defaultimage-$(CONFIG_SH_RSK) := uImage
|
||||||
defaultimage-$(CONFIG_SH_URQUELL) := uImage
|
defaultimage-$(CONFIG_SH_URQUELL) := uImage
|
||||||
@@ -107,31 +103,22 @@ KBUILD_IMAGE := $(boot)/$(defaultimage-y)
|
|||||||
# Choosing incompatible machines durings configuration will result in
|
# Choosing incompatible machines durings configuration will result in
|
||||||
# error messages during linking.
|
# error messages during linking.
|
||||||
#
|
#
|
||||||
ifdef CONFIG_SUPERH32
|
|
||||||
UTS_MACHINE := sh
|
UTS_MACHINE := sh
|
||||||
BITS := 32
|
|
||||||
LDFLAGS_vmlinux += -e _stext
|
LDFLAGS_vmlinux += -e _stext
|
||||||
else
|
|
||||||
UTS_MACHINE := sh64
|
|
||||||
BITS := 64
|
|
||||||
LDFLAGS_vmlinux += --defsym phys_stext=_stext-$(CONFIG_PAGE_OFFSET) \
|
|
||||||
--defsym phys_stext_shmedia=phys_stext+1 \
|
|
||||||
-e phys_stext_shmedia
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef CONFIG_CPU_LITTLE_ENDIAN
|
ifdef CONFIG_CPU_LITTLE_ENDIAN
|
||||||
ld-bfd := elf32-$(UTS_MACHINE)-linux
|
ld-bfd := elf32-sh-linux
|
||||||
LDFLAGS_vmlinux += --defsym jiffies=jiffies_64 --oformat $(ld-bfd)
|
LDFLAGS_vmlinux += --defsym jiffies=jiffies_64 --oformat $(ld-bfd)
|
||||||
KBUILD_LDFLAGS += -EL
|
KBUILD_LDFLAGS += -EL
|
||||||
else
|
else
|
||||||
ld-bfd := elf32-$(UTS_MACHINE)big-linux
|
ld-bfd := elf32-shbig-linux
|
||||||
LDFLAGS_vmlinux += --defsym jiffies=jiffies_64+4 --oformat $(ld-bfd)
|
LDFLAGS_vmlinux += --defsym jiffies=jiffies_64+4 --oformat $(ld-bfd)
|
||||||
KBUILD_LDFLAGS += -EB
|
KBUILD_LDFLAGS += -EB
|
||||||
endif
|
endif
|
||||||
|
|
||||||
export ld-bfd BITS
|
export ld-bfd
|
||||||
|
|
||||||
head-y := arch/sh/kernel/head_$(BITS).o
|
head-y := arch/sh/kernel/head_32.o
|
||||||
|
|
||||||
core-y += arch/sh/kernel/ arch/sh/mm/ arch/sh/boards/
|
core-y += arch/sh/kernel/ arch/sh/mm/ arch/sh/boards/
|
||||||
core-$(CONFIG_SH_FPU_EMU) += arch/sh/math-emu/
|
core-$(CONFIG_SH_FPU_EMU) += arch/sh/math-emu/
|
||||||
@@ -185,7 +172,6 @@ cpuincdir-$(CONFIG_CPU_SH2) += cpu-sh2
|
|||||||
cpuincdir-$(CONFIG_CPU_SH3) += cpu-sh3
|
cpuincdir-$(CONFIG_CPU_SH3) += cpu-sh3
|
||||||
cpuincdir-$(CONFIG_CPU_SH4A) += cpu-sh4a
|
cpuincdir-$(CONFIG_CPU_SH4A) += cpu-sh4a
|
||||||
cpuincdir-$(CONFIG_CPU_SH4) += cpu-sh4
|
cpuincdir-$(CONFIG_CPU_SH4) += cpu-sh4
|
||||||
cpuincdir-$(CONFIG_CPU_SH5) += cpu-sh5
|
|
||||||
cpuincdir-y += cpu-common # Must be last
|
cpuincdir-y += cpu-common # Must be last
|
||||||
|
|
||||||
drivers-y += arch/sh/drivers/
|
drivers-y += arch/sh/drivers/
|
||||||
@@ -206,8 +192,7 @@ ifeq ($(CONFIG_DWARF_UNWINDER),y)
|
|||||||
KBUILD_CFLAGS += -fasynchronous-unwind-tables
|
KBUILD_CFLAGS += -fasynchronous-unwind-tables
|
||||||
endif
|
endif
|
||||||
|
|
||||||
libs-$(CONFIG_SUPERH32) := arch/sh/lib/ $(libs-y)
|
libs-y := arch/sh/lib/ $(libs-y)
|
||||||
libs-$(CONFIG_SUPERH64) := arch/sh/lib64/ $(libs-y)
|
|
||||||
|
|
||||||
BOOT_TARGETS = uImage uImage.bz2 uImage.gz uImage.lzma uImage.xz uImage.lzo \
|
BOOT_TARGETS = uImage uImage.bz2 uImage.gz uImage.lzma uImage.xz uImage.lzo \
|
||||||
uImage.srec uImage.bin zImage vmlinux.bin vmlinux.srec \
|
uImage.srec uImage.bin zImage vmlinux.bin vmlinux.srec \
|
||||||
|
@@ -8,9 +8,9 @@
|
|||||||
targets := vmlinux vmlinux.bin vmlinux.bin.gz \
|
targets := vmlinux vmlinux.bin vmlinux.bin.gz \
|
||||||
vmlinux.bin.bz2 vmlinux.bin.lzma \
|
vmlinux.bin.bz2 vmlinux.bin.lzma \
|
||||||
vmlinux.bin.xz vmlinux.bin.lzo \
|
vmlinux.bin.xz vmlinux.bin.lzo \
|
||||||
head_$(BITS).o misc.o piggy.o
|
head_32.o misc.o piggy.o
|
||||||
|
|
||||||
OBJECTS = $(obj)/head_$(BITS).o $(obj)/misc.o $(obj)/cache.o
|
OBJECTS = $(obj)/head_32.o $(obj)/misc.o $(obj)/cache.o
|
||||||
|
|
||||||
GCOV_PROFILE := n
|
GCOV_PROFILE := n
|
||||||
|
|
||||||
@@ -39,15 +39,11 @@ LDFLAGS_vmlinux := --oformat $(ld-bfd) -Ttext $(IMAGE_OFFSET) -e startup \
|
|||||||
#
|
#
|
||||||
# Pull in the necessary libgcc bits from the in-kernel implementation.
|
# Pull in the necessary libgcc bits from the in-kernel implementation.
|
||||||
#
|
#
|
||||||
lib1funcs-$(CONFIG_SUPERH32) := ashiftrt.S ashldi3.c ashrsi3.S ashlsi3.S \
|
lib1funcs-y := ashiftrt.S ashldi3.c ashrsi3.S ashlsi3.S lshrsi3.S
|
||||||
lshrsi3.S
|
lib1funcs-obj := \
|
||||||
lib1funcs-obj := \
|
|
||||||
$(addsuffix .o, $(basename $(addprefix $(obj)/, $(lib1funcs-y))))
|
$(addsuffix .o, $(basename $(addprefix $(obj)/, $(lib1funcs-y))))
|
||||||
|
|
||||||
lib1funcs-dir := $(srctree)/arch/$(SRCARCH)/lib
|
lib1funcs-dir := $(srctree)/arch/$(SRCARCH)/lib
|
||||||
ifeq ($(BITS),64)
|
|
||||||
lib1funcs-dir := $(addsuffix $(BITS), $(lib1funcs-dir))
|
|
||||||
endif
|
|
||||||
|
|
||||||
KBUILD_CFLAGS += -I$(lib1funcs-dir) -DDISABLE_BRANCH_PROFILING
|
KBUILD_CFLAGS += -I$(lib1funcs-dir) -DDISABLE_BRANCH_PROFILING
|
||||||
|
|
||||||
|
@@ -116,11 +116,7 @@ void ftrace_stub(void)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_SUPERH64
|
|
||||||
#define stackalign 8
|
|
||||||
#else
|
|
||||||
#define stackalign 4
|
#define stackalign 4
|
||||||
#endif
|
|
||||||
|
|
||||||
#define STACK_SIZE (4096)
|
#define STACK_SIZE (4096)
|
||||||
long __attribute__ ((aligned(stackalign))) user_stack[STACK_SIZE];
|
long __attribute__ ((aligned(stackalign))) user_stack[STACK_SIZE];
|
||||||
@@ -130,13 +126,9 @@ void decompress_kernel(void)
|
|||||||
{
|
{
|
||||||
unsigned long output_addr;
|
unsigned long output_addr;
|
||||||
|
|
||||||
#ifdef CONFIG_SUPERH64
|
|
||||||
output_addr = (CONFIG_MEMORY_START + 0x2000);
|
|
||||||
#else
|
|
||||||
output_addr = __pa((unsigned long)&_text+PAGE_SIZE);
|
output_addr = __pa((unsigned long)&_text+PAGE_SIZE);
|
||||||
#if defined(CONFIG_29BIT)
|
#if defined(CONFIG_29BIT)
|
||||||
output_addr |= P2SEG;
|
output_addr |= P2SEG;
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
output = (unsigned char *)output_addr;
|
output = (unsigned char *)output_addr;
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
SECTIONS
|
SECTIONS
|
||||||
{
|
{
|
||||||
.rodata..compressed : {
|
.rodata..compressed : ALIGN(8) {
|
||||||
input_len = .;
|
input_len = .;
|
||||||
LONG(input_data_end - input_data) input_data = .;
|
LONG(input_data_end - input_data) input_data = .;
|
||||||
*(.data)
|
*(.data)
|
||||||
|
@@ -20,7 +20,8 @@ CONFIG_PROFILING=y
|
|||||||
CONFIG_MODULES=y
|
CONFIG_MODULES=y
|
||||||
CONFIG_MODULE_UNLOAD=y
|
CONFIG_MODULE_UNLOAD=y
|
||||||
# CONFIG_BLK_DEV_BSG is not set
|
# CONFIG_BLK_DEV_BSG is not set
|
||||||
CONFIG_CFQ_GROUP_IOSCHED=y
|
CONFIG_IOSCHED_BFQ=y
|
||||||
|
CONFIG_BFQ_GROUP_IOSCHED=y
|
||||||
CONFIG_CPU_SUBTYPE_SH7786=y
|
CONFIG_CPU_SUBTYPE_SH7786=y
|
||||||
CONFIG_MEMORY_SIZE=0x10000000
|
CONFIG_MEMORY_SIZE=0x10000000
|
||||||
CONFIG_HUGETLB_PAGE_SIZE_1MB=y
|
CONFIG_HUGETLB_PAGE_SIZE_1MB=y
|
||||||
|
@@ -10,8 +10,6 @@ CONFIG_SLAB=y
|
|||||||
CONFIG_MODULES=y
|
CONFIG_MODULES=y
|
||||||
CONFIG_MODULE_UNLOAD=y
|
CONFIG_MODULE_UNLOAD=y
|
||||||
# CONFIG_BLK_DEV_BSG is not set
|
# CONFIG_BLK_DEV_BSG is not set
|
||||||
# CONFIG_IOSCHED_DEADLINE is not set
|
|
||||||
# CONFIG_IOSCHED_CFQ is not set
|
|
||||||
CONFIG_CPU_SUBTYPE_SH7724=y
|
CONFIG_CPU_SUBTYPE_SH7724=y
|
||||||
CONFIG_MEMORY_SIZE=0x08000000
|
CONFIG_MEMORY_SIZE=0x08000000
|
||||||
CONFIG_FLATMEM_MANUAL=y
|
CONFIG_FLATMEM_MANUAL=y
|
||||||
|
@@ -14,8 +14,6 @@ CONFIG_MODULE_UNLOAD=y
|
|||||||
CONFIG_MODVERSIONS=y
|
CONFIG_MODVERSIONS=y
|
||||||
CONFIG_MODULE_SRCVERSION_ALL=y
|
CONFIG_MODULE_SRCVERSION_ALL=y
|
||||||
# CONFIG_BLK_DEV_BSG is not set
|
# CONFIG_BLK_DEV_BSG is not set
|
||||||
# CONFIG_IOSCHED_DEADLINE is not set
|
|
||||||
# CONFIG_IOSCHED_CFQ is not set
|
|
||||||
CONFIG_CPU_SUBTYPE_SH7720=y
|
CONFIG_CPU_SUBTYPE_SH7720=y
|
||||||
CONFIG_MEMORY_START=0x0C000000
|
CONFIG_MEMORY_START=0x0C000000
|
||||||
CONFIG_MEMORY_SIZE=0x03F00000
|
CONFIG_MEMORY_SIZE=0x03F00000
|
||||||
|
@@ -12,7 +12,6 @@ CONFIG_MODULES=y
|
|||||||
CONFIG_MODULE_UNLOAD=y
|
CONFIG_MODULE_UNLOAD=y
|
||||||
CONFIG_MODVERSIONS=y
|
CONFIG_MODVERSIONS=y
|
||||||
# CONFIG_BLK_DEV_BSG is not set
|
# CONFIG_BLK_DEV_BSG is not set
|
||||||
# CONFIG_IOSCHED_DEADLINE is not set
|
|
||||||
CONFIG_CPU_SUBTYPE_SH7709=y
|
CONFIG_CPU_SUBTYPE_SH7709=y
|
||||||
CONFIG_MEMORY_START=0x0C000000
|
CONFIG_MEMORY_START=0x0C000000
|
||||||
CONFIG_FLATMEM_MANUAL=y
|
CONFIG_FLATMEM_MANUAL=y
|
||||||
|
@@ -12,8 +12,6 @@ CONFIG_OPROFILE=m
|
|||||||
CONFIG_MODULES=y
|
CONFIG_MODULES=y
|
||||||
CONFIG_MODULE_UNLOAD=y
|
CONFIG_MODULE_UNLOAD=y
|
||||||
# CONFIG_BLK_DEV_BSG is not set
|
# CONFIG_BLK_DEV_BSG is not set
|
||||||
# CONFIG_IOSCHED_DEADLINE is not set
|
|
||||||
# CONFIG_IOSCHED_CFQ is not set
|
|
||||||
CONFIG_CPU_SUBTYPE_SH7780=y
|
CONFIG_CPU_SUBTYPE_SH7780=y
|
||||||
CONFIG_MEMORY_SIZE=0x08000000
|
CONFIG_MEMORY_SIZE=0x08000000
|
||||||
CONFIG_FLATMEM_MANUAL=y
|
CONFIG_FLATMEM_MANUAL=y
|
||||||
|
@@ -15,8 +15,6 @@ CONFIG_KPROBES=y
|
|||||||
CONFIG_MODULES=y
|
CONFIG_MODULES=y
|
||||||
CONFIG_MODULE_UNLOAD=y
|
CONFIG_MODULE_UNLOAD=y
|
||||||
# CONFIG_BLK_DEV_BSG is not set
|
# CONFIG_BLK_DEV_BSG is not set
|
||||||
# CONFIG_IOSCHED_DEADLINE is not set
|
|
||||||
# CONFIG_IOSCHED_CFQ is not set
|
|
||||||
CONFIG_CPU_SUBTYPE_SH7785=y
|
CONFIG_CPU_SUBTYPE_SH7785=y
|
||||||
CONFIG_MEMORY_SIZE=0x08000000
|
CONFIG_MEMORY_SIZE=0x08000000
|
||||||
CONFIG_HUGETLB_PAGE_SIZE_1MB=y
|
CONFIG_HUGETLB_PAGE_SIZE_1MB=y
|
||||||
|
@@ -15,8 +15,6 @@ CONFIG_PROFILING=y
|
|||||||
CONFIG_OPROFILE=y
|
CONFIG_OPROFILE=y
|
||||||
CONFIG_MODULES=y
|
CONFIG_MODULES=y
|
||||||
# CONFIG_BLK_DEV_BSG is not set
|
# CONFIG_BLK_DEV_BSG is not set
|
||||||
# CONFIG_IOSCHED_DEADLINE is not set
|
|
||||||
# CONFIG_IOSCHED_CFQ is not set
|
|
||||||
CONFIG_CPU_SUBTYPE_SH7201=y
|
CONFIG_CPU_SUBTYPE_SH7201=y
|
||||||
CONFIG_MEMORY_SIZE=0x01000000
|
CONFIG_MEMORY_SIZE=0x01000000
|
||||||
CONFIG_FLATMEM_MANUAL=y
|
CONFIG_FLATMEM_MANUAL=y
|
||||||
|
@@ -16,8 +16,6 @@ CONFIG_PROFILING=y
|
|||||||
CONFIG_OPROFILE=y
|
CONFIG_OPROFILE=y
|
||||||
CONFIG_MODULES=y
|
CONFIG_MODULES=y
|
||||||
# CONFIG_BLK_DEV_BSG is not set
|
# CONFIG_BLK_DEV_BSG is not set
|
||||||
# CONFIG_IOSCHED_DEADLINE is not set
|
|
||||||
# CONFIG_IOSCHED_CFQ is not set
|
|
||||||
CONFIG_CPU_SUBTYPE_SH7203=y
|
CONFIG_CPU_SUBTYPE_SH7203=y
|
||||||
CONFIG_MEMORY_START=0x0c000000
|
CONFIG_MEMORY_START=0x0c000000
|
||||||
CONFIG_MEMORY_SIZE=0x01000000
|
CONFIG_MEMORY_SIZE=0x01000000
|
||||||
|
@@ -17,8 +17,6 @@ CONFIG_MMAP_ALLOW_UNINITIALIZED=y
|
|||||||
CONFIG_PROFILING=y
|
CONFIG_PROFILING=y
|
||||||
# CONFIG_BLK_DEV_BSG is not set
|
# CONFIG_BLK_DEV_BSG is not set
|
||||||
CONFIG_PARTITION_ADVANCED=y
|
CONFIG_PARTITION_ADVANCED=y
|
||||||
# CONFIG_IOSCHED_DEADLINE is not set
|
|
||||||
# CONFIG_IOSCHED_CFQ is not set
|
|
||||||
CONFIG_CPU_SUBTYPE_SH7264=y
|
CONFIG_CPU_SUBTYPE_SH7264=y
|
||||||
CONFIG_MEMORY_START=0x0c000000
|
CONFIG_MEMORY_START=0x0c000000
|
||||||
CONFIG_FLATMEM_MANUAL=y
|
CONFIG_FLATMEM_MANUAL=y
|
||||||
|
@@ -4,8 +4,6 @@ CONFIG_EMBEDDED=y
|
|||||||
# CONFIG_VM_EVENT_COUNTERS is not set
|
# CONFIG_VM_EVENT_COUNTERS is not set
|
||||||
CONFIG_SLAB=y
|
CONFIG_SLAB=y
|
||||||
# CONFIG_BLK_DEV_BSG is not set
|
# CONFIG_BLK_DEV_BSG is not set
|
||||||
# CONFIG_IOSCHED_DEADLINE is not set
|
|
||||||
# CONFIG_IOSCHED_CFQ is not set
|
|
||||||
CONFIG_SWAP_IO_SPACE=y
|
CONFIG_SWAP_IO_SPACE=y
|
||||||
CONFIG_CPU_SUBTYPE_SH7269=y
|
CONFIG_CPU_SUBTYPE_SH7269=y
|
||||||
CONFIG_MEMORY_START=0x0c000000
|
CONFIG_MEMORY_START=0x0c000000
|
||||||
|
@@ -39,7 +39,8 @@ CONFIG_OPROFILE=m
|
|||||||
CONFIG_KPROBES=y
|
CONFIG_KPROBES=y
|
||||||
CONFIG_MODULES=y
|
CONFIG_MODULES=y
|
||||||
CONFIG_MODULE_UNLOAD=y
|
CONFIG_MODULE_UNLOAD=y
|
||||||
CONFIG_CFQ_GROUP_IOSCHED=y
|
CONFIG_IOSCHED_BFQ=y
|
||||||
|
CONFIG_BFQ_GROUP_IOSCHED=y
|
||||||
CONFIG_CPU_SUBTYPE_SH7786=y
|
CONFIG_CPU_SUBTYPE_SH7786=y
|
||||||
CONFIG_MEMORY_START=0x40000000
|
CONFIG_MEMORY_START=0x40000000
|
||||||
CONFIG_MEMORY_SIZE=0x20000000
|
CONFIG_MEMORY_SIZE=0x20000000
|
||||||
|
@@ -28,8 +28,6 @@ CONFIG_OPROFILE=y
|
|||||||
CONFIG_MODULES=y
|
CONFIG_MODULES=y
|
||||||
CONFIG_MODULE_UNLOAD=y
|
CONFIG_MODULE_UNLOAD=y
|
||||||
# CONFIG_BLK_DEV_BSG is not set
|
# CONFIG_BLK_DEV_BSG is not set
|
||||||
# CONFIG_IOSCHED_DEADLINE is not set
|
|
||||||
# CONFIG_IOSCHED_CFQ is not set
|
|
||||||
CONFIG_CPU_SUBTYPE_SH7206=y
|
CONFIG_CPU_SUBTYPE_SH7206=y
|
||||||
CONFIG_MEMORY_START=0x0c000000
|
CONFIG_MEMORY_START=0x0c000000
|
||||||
CONFIG_FLATMEM_MANUAL=y
|
CONFIG_FLATMEM_MANUAL=y
|
||||||
|
@@ -11,7 +11,6 @@ CONFIG_MODULES=y
|
|||||||
CONFIG_MODULE_UNLOAD=y
|
CONFIG_MODULE_UNLOAD=y
|
||||||
CONFIG_MODULE_FORCE_UNLOAD=y
|
CONFIG_MODULE_FORCE_UNLOAD=y
|
||||||
# CONFIG_BLK_DEV_BSG is not set
|
# CONFIG_BLK_DEV_BSG is not set
|
||||||
# CONFIG_IOSCHED_CFQ is not set
|
|
||||||
CONFIG_CPU_SUBTYPE_SH7343=y
|
CONFIG_CPU_SUBTYPE_SH7343=y
|
||||||
CONFIG_MEMORY_START=0x0c000000
|
CONFIG_MEMORY_START=0x0c000000
|
||||||
CONFIG_MEMORY_SIZE=0x01000000
|
CONFIG_MEMORY_SIZE=0x01000000
|
||||||
|
@@ -11,8 +11,6 @@ CONFIG_LOG_BUF_SHIFT=14
|
|||||||
# CONFIG_VM_EVENT_COUNTERS is not set
|
# CONFIG_VM_EVENT_COUNTERS is not set
|
||||||
CONFIG_SLAB=y
|
CONFIG_SLAB=y
|
||||||
# CONFIG_BLK_DEV_BSG is not set
|
# CONFIG_BLK_DEV_BSG is not set
|
||||||
# CONFIG_IOSCHED_DEADLINE is not set
|
|
||||||
# CONFIG_IOSCHED_CFQ is not set
|
|
||||||
CONFIG_MEMORY_START=0x0c000000
|
CONFIG_MEMORY_START=0x0c000000
|
||||||
CONFIG_FLATMEM_MANUAL=y
|
CONFIG_FLATMEM_MANUAL=y
|
||||||
CONFIG_CPU_BIG_ENDIAN=y
|
CONFIG_CPU_BIG_ENDIAN=y
|
||||||
|
@@ -8,8 +8,6 @@ CONFIG_BLK_DEV_INITRD=y
|
|||||||
CONFIG_SLAB=y
|
CONFIG_SLAB=y
|
||||||
CONFIG_MODULES=y
|
CONFIG_MODULES=y
|
||||||
# CONFIG_BLK_DEV_BSG is not set
|
# CONFIG_BLK_DEV_BSG is not set
|
||||||
# CONFIG_IOSCHED_DEADLINE is not set
|
|
||||||
# CONFIG_IOSCHED_CFQ is not set
|
|
||||||
CONFIG_CPU_SUBTYPE_SH7705=y
|
CONFIG_CPU_SUBTYPE_SH7705=y
|
||||||
CONFIG_MEMORY_START=0x0c000000
|
CONFIG_MEMORY_START=0x0c000000
|
||||||
CONFIG_MEMORY_SIZE=0x02000000
|
CONFIG_MEMORY_SIZE=0x02000000
|
||||||
|
@@ -12,8 +12,6 @@ CONFIG_KALLSYMS_ALL=y
|
|||||||
CONFIG_SLAB=y
|
CONFIG_SLAB=y
|
||||||
CONFIG_MODULES=y
|
CONFIG_MODULES=y
|
||||||
# CONFIG_BLK_DEV_BSG is not set
|
# CONFIG_BLK_DEV_BSG is not set
|
||||||
# CONFIG_IOSCHED_DEADLINE is not set
|
|
||||||
# CONFIG_IOSCHED_CFQ is not set
|
|
||||||
CONFIG_CPU_SUBTYPE_SH7712=y
|
CONFIG_CPU_SUBTYPE_SH7712=y
|
||||||
CONFIG_MEMORY_START=0x0c000000
|
CONFIG_MEMORY_START=0x0c000000
|
||||||
CONFIG_MEMORY_SIZE=0x02000000
|
CONFIG_MEMORY_SIZE=0x02000000
|
||||||
|
@@ -12,8 +12,6 @@ CONFIG_KALLSYMS_ALL=y
|
|||||||
CONFIG_SLAB=y
|
CONFIG_SLAB=y
|
||||||
CONFIG_MODULES=y
|
CONFIG_MODULES=y
|
||||||
# CONFIG_BLK_DEV_BSG is not set
|
# CONFIG_BLK_DEV_BSG is not set
|
||||||
# CONFIG_IOSCHED_DEADLINE is not set
|
|
||||||
# CONFIG_IOSCHED_CFQ is not set
|
|
||||||
CONFIG_CPU_SUBTYPE_SH7721=y
|
CONFIG_CPU_SUBTYPE_SH7721=y
|
||||||
CONFIG_MEMORY_START=0x0c000000
|
CONFIG_MEMORY_START=0x0c000000
|
||||||
CONFIG_MEMORY_SIZE=0x02000000
|
CONFIG_MEMORY_SIZE=0x02000000
|
||||||
|
@@ -8,8 +8,6 @@ CONFIG_PROFILING=y
|
|||||||
CONFIG_MODULES=y
|
CONFIG_MODULES=y
|
||||||
CONFIG_MODULE_UNLOAD=y
|
CONFIG_MODULE_UNLOAD=y
|
||||||
# CONFIG_BLK_DEV_BSG is not set
|
# CONFIG_BLK_DEV_BSG is not set
|
||||||
# CONFIG_IOSCHED_DEADLINE is not set
|
|
||||||
# CONFIG_IOSCHED_CFQ is not set
|
|
||||||
CONFIG_CPU_SUBTYPE_SH7722=y
|
CONFIG_CPU_SUBTYPE_SH7722=y
|
||||||
CONFIG_MEMORY_START=0x0c000000
|
CONFIG_MEMORY_START=0x0c000000
|
||||||
CONFIG_NUMA=y
|
CONFIG_NUMA=y
|
||||||
|
@@ -9,7 +9,6 @@ CONFIG_LOG_BUF_SHIFT=14
|
|||||||
CONFIG_SLAB=y
|
CONFIG_SLAB=y
|
||||||
CONFIG_MODULES=y
|
CONFIG_MODULES=y
|
||||||
CONFIG_MODULE_UNLOAD=y
|
CONFIG_MODULE_UNLOAD=y
|
||||||
# CONFIG_IOSCHED_CFQ is not set
|
|
||||||
CONFIG_CPU_SUBTYPE_SH7780=y
|
CONFIG_CPU_SUBTYPE_SH7780=y
|
||||||
CONFIG_MEMORY_SIZE=0x08000000
|
CONFIG_MEMORY_SIZE=0x08000000
|
||||||
CONFIG_SH_7780_SOLUTION_ENGINE=y
|
CONFIG_SH_7780_SOLUTION_ENGINE=y
|
||||||
|
@@ -11,7 +11,6 @@ CONFIG_MODULES=y
|
|||||||
CONFIG_MODULE_UNLOAD=y
|
CONFIG_MODULE_UNLOAD=y
|
||||||
CONFIG_MODULE_FORCE_UNLOAD=y
|
CONFIG_MODULE_FORCE_UNLOAD=y
|
||||||
# CONFIG_BLK_DEV_BSG is not set
|
# CONFIG_BLK_DEV_BSG is not set
|
||||||
# CONFIG_IOSCHED_CFQ is not set
|
|
||||||
CONFIG_CPU_SUBTYPE_SH7710=y
|
CONFIG_CPU_SUBTYPE_SH7710=y
|
||||||
CONFIG_MEMORY_START=0x0c000000
|
CONFIG_MEMORY_START=0x0c000000
|
||||||
CONFIG_MEMORY_SIZE=0x00800000
|
CONFIG_MEMORY_SIZE=0x00800000
|
||||||
|
@@ -36,7 +36,7 @@ CONFIG_IPV6=y
|
|||||||
# CONFIG_FW_LOADER is not set
|
# CONFIG_FW_LOADER is not set
|
||||||
CONFIG_MTD=y
|
CONFIG_MTD=y
|
||||||
CONFIG_MTD_BLOCK=y
|
CONFIG_MTD_BLOCK=y
|
||||||
CONFIG_MTD_M25P80=y
|
CONFIG_MTD_SPI_NOR=y
|
||||||
CONFIG_BLK_DEV_RAM=y
|
CONFIG_BLK_DEV_RAM=y
|
||||||
CONFIG_SCSI=y
|
CONFIG_SCSI=y
|
||||||
CONFIG_BLK_DEV_SD=y
|
CONFIG_BLK_DEV_SD=y
|
||||||
|
@@ -12,8 +12,6 @@ CONFIG_LOG_BUF_SHIFT=14
|
|||||||
# CONFIG_SHMEM is not set
|
# CONFIG_SHMEM is not set
|
||||||
CONFIG_SLOB=y
|
CONFIG_SLOB=y
|
||||||
# CONFIG_BLK_DEV_BSG is not set
|
# CONFIG_BLK_DEV_BSG is not set
|
||||||
# CONFIG_IOSCHED_DEADLINE is not set
|
|
||||||
# CONFIG_IOSCHED_CFQ is not set
|
|
||||||
CONFIG_CPU_SUBTYPE_SH7706=y
|
CONFIG_CPU_SUBTYPE_SH7706=y
|
||||||
CONFIG_MEMORY_START=0x0c000000
|
CONFIG_MEMORY_START=0x0c000000
|
||||||
CONFIG_MEMORY_SIZE=0x00800000
|
CONFIG_MEMORY_SIZE=0x00800000
|
||||||
|
@@ -8,8 +8,6 @@ CONFIG_PROFILING=y
|
|||||||
CONFIG_MODULES=y
|
CONFIG_MODULES=y
|
||||||
CONFIG_MODULE_UNLOAD=y
|
CONFIG_MODULE_UNLOAD=y
|
||||||
# CONFIG_BLK_DEV_BSG is not set
|
# CONFIG_BLK_DEV_BSG is not set
|
||||||
# CONFIG_IOSCHED_DEADLINE is not set
|
|
||||||
# CONFIG_IOSCHED_CFQ is not set
|
|
||||||
CONFIG_CPU_SUBTYPE_SH7366=y
|
CONFIG_CPU_SUBTYPE_SH7366=y
|
||||||
CONFIG_MEMORY_SIZE=0x01f00000
|
CONFIG_MEMORY_SIZE=0x01f00000
|
||||||
CONFIG_NUMA=y
|
CONFIG_NUMA=y
|
||||||
|
@@ -10,7 +10,6 @@ obj-$(CONFIG_CPU_SUBTYPE_SH7763) += pci-sh7780.o ops-sh4.o
|
|||||||
obj-$(CONFIG_CPU_SUBTYPE_SH7780) += pci-sh7780.o ops-sh4.o
|
obj-$(CONFIG_CPU_SUBTYPE_SH7780) += pci-sh7780.o ops-sh4.o
|
||||||
obj-$(CONFIG_CPU_SUBTYPE_SH7785) += pci-sh7780.o ops-sh4.o
|
obj-$(CONFIG_CPU_SUBTYPE_SH7785) += pci-sh7780.o ops-sh4.o
|
||||||
obj-$(CONFIG_CPU_SUBTYPE_SH7786) += pcie-sh7786.o ops-sh7786.o
|
obj-$(CONFIG_CPU_SUBTYPE_SH7786) += pcie-sh7786.o ops-sh7786.o
|
||||||
obj-$(CONFIG_CPU_SH5) += pci-sh5.o ops-sh5.o
|
|
||||||
|
|
||||||
obj-$(CONFIG_SH_DREAMCAST) += ops-dreamcast.o fixups-dreamcast.o \
|
obj-$(CONFIG_SH_DREAMCAST) += ops-dreamcast.o fixups-dreamcast.o \
|
||||||
pci-dreamcast.o
|
pci-dreamcast.o
|
||||||
|
@@ -1,65 +0,0 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0
|
|
||||||
/*
|
|
||||||
* Support functions for the SH5 PCI hardware.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2001 David J. Mckay (david.mckay@st.com)
|
|
||||||
* Copyright (C) 2003, 2004 Paul Mundt
|
|
||||||
* Copyright (C) 2004 Richard Curnow
|
|
||||||
*/
|
|
||||||
#include <linux/kernel.h>
|
|
||||||
#include <linux/rwsem.h>
|
|
||||||
#include <linux/smp.h>
|
|
||||||
#include <linux/interrupt.h>
|
|
||||||
#include <linux/init.h>
|
|
||||||
#include <linux/errno.h>
|
|
||||||
#include <linux/pci.h>
|
|
||||||
#include <linux/delay.h>
|
|
||||||
#include <linux/types.h>
|
|
||||||
#include <linux/irq.h>
|
|
||||||
#include <asm/io.h>
|
|
||||||
#include "pci-sh5.h"
|
|
||||||
|
|
||||||
static int sh5pci_read(struct pci_bus *bus, unsigned int devfn, int where,
|
|
||||||
int size, u32 *val)
|
|
||||||
{
|
|
||||||
SH5PCI_WRITE(PAR, CONFIG_CMD(bus, devfn, where));
|
|
||||||
|
|
||||||
switch (size) {
|
|
||||||
case 1:
|
|
||||||
*val = (u8)SH5PCI_READ_BYTE(PDR + (where & 3));
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
*val = (u16)SH5PCI_READ_SHORT(PDR + (where & 2));
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
*val = SH5PCI_READ(PDR);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return PCIBIOS_SUCCESSFUL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int sh5pci_write(struct pci_bus *bus, unsigned int devfn, int where,
|
|
||||||
int size, u32 val)
|
|
||||||
{
|
|
||||||
SH5PCI_WRITE(PAR, CONFIG_CMD(bus, devfn, where));
|
|
||||||
|
|
||||||
switch (size) {
|
|
||||||
case 1:
|
|
||||||
SH5PCI_WRITE_BYTE(PDR + (where & 3), (u8)val);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
SH5PCI_WRITE_SHORT(PDR + (where & 2), (u16)val);
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
SH5PCI_WRITE(PDR, val);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return PCIBIOS_SUCCESSFUL;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct pci_ops sh5_pci_ops = {
|
|
||||||
.read = sh5pci_read,
|
|
||||||
.write = sh5pci_write,
|
|
||||||
};
|
|
@@ -1,217 +0,0 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0
|
|
||||||
/*
|
|
||||||
* Copyright (C) 2001 David J. Mckay (david.mckay@st.com)
|
|
||||||
* Copyright (C) 2003, 2004 Paul Mundt
|
|
||||||
* Copyright (C) 2004 Richard Curnow
|
|
||||||
*
|
|
||||||
* Support functions for the SH5 PCI hardware.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <linux/kernel.h>
|
|
||||||
#include <linux/rwsem.h>
|
|
||||||
#include <linux/smp.h>
|
|
||||||
#include <linux/interrupt.h>
|
|
||||||
#include <linux/init.h>
|
|
||||||
#include <linux/errno.h>
|
|
||||||
#include <linux/pci.h>
|
|
||||||
#include <linux/delay.h>
|
|
||||||
#include <linux/types.h>
|
|
||||||
#include <linux/irq.h>
|
|
||||||
#include <cpu/irq.h>
|
|
||||||
#include <asm/io.h>
|
|
||||||
#include "pci-sh5.h"
|
|
||||||
|
|
||||||
unsigned long pcicr_virt;
|
|
||||||
unsigned long PCI_IO_AREA;
|
|
||||||
|
|
||||||
/* Rounds a number UP to the nearest power of two. Used for
|
|
||||||
* sizing the PCI window.
|
|
||||||
*/
|
|
||||||
static u32 __init r2p2(u32 num)
|
|
||||||
{
|
|
||||||
int i = 31;
|
|
||||||
u32 tmp = num;
|
|
||||||
|
|
||||||
if (num == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
do {
|
|
||||||
if (tmp & (1 << 31))
|
|
||||||
break;
|
|
||||||
i--;
|
|
||||||
tmp <<= 1;
|
|
||||||
} while (i >= 0);
|
|
||||||
|
|
||||||
tmp = 1 << i;
|
|
||||||
/* If the original number isn't a power of 2, round it up */
|
|
||||||
if (tmp != num)
|
|
||||||
tmp <<= 1;
|
|
||||||
|
|
||||||
return tmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
static irqreturn_t pcish5_err_irq(int irq, void *dev_id)
|
|
||||||
{
|
|
||||||
struct pt_regs *regs = get_irq_regs();
|
|
||||||
unsigned pci_int, pci_air, pci_cir, pci_aint;
|
|
||||||
|
|
||||||
pci_int = SH5PCI_READ(INT);
|
|
||||||
pci_cir = SH5PCI_READ(CIR);
|
|
||||||
pci_air = SH5PCI_READ(AIR);
|
|
||||||
|
|
||||||
if (pci_int) {
|
|
||||||
printk("PCI INTERRUPT (at %08llx)!\n", regs->pc);
|
|
||||||
printk("PCI INT -> 0x%x\n", pci_int & 0xffff);
|
|
||||||
printk("PCI AIR -> 0x%x\n", pci_air);
|
|
||||||
printk("PCI CIR -> 0x%x\n", pci_cir);
|
|
||||||
SH5PCI_WRITE(INT, ~0);
|
|
||||||
}
|
|
||||||
|
|
||||||
pci_aint = SH5PCI_READ(AINT);
|
|
||||||
if (pci_aint) {
|
|
||||||
printk("PCI ARB INTERRUPT!\n");
|
|
||||||
printk("PCI AINT -> 0x%x\n", pci_aint);
|
|
||||||
printk("PCI AIR -> 0x%x\n", pci_air);
|
|
||||||
printk("PCI CIR -> 0x%x\n", pci_cir);
|
|
||||||
SH5PCI_WRITE(AINT, ~0);
|
|
||||||
}
|
|
||||||
|
|
||||||
return IRQ_HANDLED;
|
|
||||||
}
|
|
||||||
|
|
||||||
static irqreturn_t pcish5_serr_irq(int irq, void *dev_id)
|
|
||||||
{
|
|
||||||
printk("SERR IRQ\n");
|
|
||||||
|
|
||||||
return IRQ_NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct resource sh5_pci_resources[2];
|
|
||||||
|
|
||||||
static struct pci_channel sh5pci_controller = {
|
|
||||||
.pci_ops = &sh5_pci_ops,
|
|
||||||
.resources = sh5_pci_resources,
|
|
||||||
.nr_resources = ARRAY_SIZE(sh5_pci_resources),
|
|
||||||
.mem_offset = 0x00000000,
|
|
||||||
.io_offset = 0x00000000,
|
|
||||||
};
|
|
||||||
|
|
||||||
static int __init sh5pci_init(void)
|
|
||||||
{
|
|
||||||
unsigned long memStart = __pa(memory_start);
|
|
||||||
unsigned long memSize = __pa(memory_end) - memStart;
|
|
||||||
u32 lsr0;
|
|
||||||
u32 uval;
|
|
||||||
|
|
||||||
if (request_irq(IRQ_ERR, pcish5_err_irq,
|
|
||||||
0, "PCI Error",NULL) < 0) {
|
|
||||||
printk(KERN_ERR "PCISH5: Cannot hook PCI_PERR interrupt\n");
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (request_irq(IRQ_SERR, pcish5_serr_irq,
|
|
||||||
0, "PCI SERR interrupt", NULL) < 0) {
|
|
||||||
printk(KERN_ERR "PCISH5: Cannot hook PCI_SERR interrupt\n");
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
pcicr_virt = (unsigned long)ioremap(SH5PCI_ICR_BASE, 1024);
|
|
||||||
if (!pcicr_virt) {
|
|
||||||
panic("Unable to remap PCICR\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
PCI_IO_AREA = (unsigned long)ioremap(SH5PCI_IO_BASE, 0x10000);
|
|
||||||
if (!PCI_IO_AREA) {
|
|
||||||
panic("Unable to remap PCIIO\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Clear snoop registers */
|
|
||||||
SH5PCI_WRITE(CSCR0, 0);
|
|
||||||
SH5PCI_WRITE(CSCR1, 0);
|
|
||||||
|
|
||||||
/* Switch off interrupts */
|
|
||||||
SH5PCI_WRITE(INTM, 0);
|
|
||||||
SH5PCI_WRITE(AINTM, 0);
|
|
||||||
SH5PCI_WRITE(PINTM, 0);
|
|
||||||
|
|
||||||
/* Set bus active, take it out of reset */
|
|
||||||
uval = SH5PCI_READ(CR);
|
|
||||||
|
|
||||||
/* Set command Register */
|
|
||||||
SH5PCI_WRITE(CR, uval | CR_LOCK_MASK | CR_CFINT| CR_FTO | CR_PFE |
|
|
||||||
CR_PFCS | CR_BMAM);
|
|
||||||
|
|
||||||
uval=SH5PCI_READ(CR);
|
|
||||||
|
|
||||||
/* Allow it to be a master */
|
|
||||||
/* NB - WE DISABLE I/O ACCESS to stop overlap */
|
|
||||||
/* set WAIT bit to enable stepping, an attempt to improve stability */
|
|
||||||
SH5PCI_WRITE_SHORT(CSR_CMD,
|
|
||||||
PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER |
|
|
||||||
PCI_COMMAND_WAIT);
|
|
||||||
|
|
||||||
/*
|
|
||||||
** Set translation mapping memory in order to convert the address
|
|
||||||
** used for the main bus, to the PCI internal address.
|
|
||||||
*/
|
|
||||||
SH5PCI_WRITE(MBR,0x40000000);
|
|
||||||
|
|
||||||
/* Always set the max size 512M */
|
|
||||||
SH5PCI_WRITE(MBMR, PCISH5_MEM_SIZCONV(512*1024*1024));
|
|
||||||
|
|
||||||
/*
|
|
||||||
** I/O addresses are mapped at internal PCI specific address
|
|
||||||
** as is described into the configuration bridge table.
|
|
||||||
** These are changed to 0, to allow cards that have legacy
|
|
||||||
** io such as vga to function correctly. We set the SH5 IOBAR to
|
|
||||||
** 256K, which is a bit big as we can only have 64K of address space
|
|
||||||
*/
|
|
||||||
|
|
||||||
SH5PCI_WRITE(IOBR,0x0);
|
|
||||||
|
|
||||||
/* Set up a 256K window. Totally pointless waste of address space */
|
|
||||||
SH5PCI_WRITE(IOBMR,0);
|
|
||||||
|
|
||||||
/* The SH5 has a HUGE 256K I/O region, which breaks the PCI spec.
|
|
||||||
* Ideally, we would want to map the I/O region somewhere, but it
|
|
||||||
* is so big this is not that easy!
|
|
||||||
*/
|
|
||||||
SH5PCI_WRITE(CSR_IBAR0,~0);
|
|
||||||
/* Set memory size value */
|
|
||||||
memSize = memory_end - memory_start;
|
|
||||||
|
|
||||||
/* Now we set up the mbars so the PCI bus can see the memory of
|
|
||||||
* the machine */
|
|
||||||
if (memSize < (1024 * 1024)) {
|
|
||||||
printk(KERN_ERR "PCISH5: Ridiculous memory size of 0x%lx?\n",
|
|
||||||
memSize);
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Set LSR 0 */
|
|
||||||
lsr0 = (memSize > (512 * 1024 * 1024)) ? 0x1ff00001 :
|
|
||||||
((r2p2(memSize) - 0x100000) | 0x1);
|
|
||||||
SH5PCI_WRITE(LSR0, lsr0);
|
|
||||||
|
|
||||||
/* Set MBAR 0 */
|
|
||||||
SH5PCI_WRITE(CSR_MBAR0, memory_start);
|
|
||||||
SH5PCI_WRITE(LAR0, memory_start);
|
|
||||||
|
|
||||||
SH5PCI_WRITE(CSR_MBAR1,0);
|
|
||||||
SH5PCI_WRITE(LAR1,0);
|
|
||||||
SH5PCI_WRITE(LSR1,0);
|
|
||||||
|
|
||||||
/* Enable the PCI interrupts on the device */
|
|
||||||
SH5PCI_WRITE(INTM, ~0);
|
|
||||||
SH5PCI_WRITE(AINTM, ~0);
|
|
||||||
SH5PCI_WRITE(PINTM, ~0);
|
|
||||||
|
|
||||||
sh5_pci_resources[0].start = PCI_IO_AREA;
|
|
||||||
sh5_pci_resources[0].end = PCI_IO_AREA + 0x10000;
|
|
||||||
|
|
||||||
sh5_pci_resources[1].start = memStart;
|
|
||||||
sh5_pci_resources[1].end = memStart + memSize;
|
|
||||||
|
|
||||||
return register_pci_controller(&sh5pci_controller);
|
|
||||||
}
|
|
||||||
arch_initcall(sh5pci_init);
|
|
@@ -1,108 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0
|
|
||||||
*
|
|
||||||
* Copyright (C) 2001 David J. Mckay (david.mckay@st.com)
|
|
||||||
*
|
|
||||||
* Definitions for the SH5 PCI hardware.
|
|
||||||
*/
|
|
||||||
#ifndef __PCI_SH5_H
|
|
||||||
#define __PCI_SH5_H
|
|
||||||
|
|
||||||
/* Product ID */
|
|
||||||
#define PCISH5_PID 0x350d
|
|
||||||
|
|
||||||
/* vendor ID */
|
|
||||||
#define PCISH5_VID 0x1054
|
|
||||||
|
|
||||||
/* Configuration types */
|
|
||||||
#define ST_TYPE0 0x00 /* Configuration cycle type 0 */
|
|
||||||
#define ST_TYPE1 0x01 /* Configuration cycle type 1 */
|
|
||||||
|
|
||||||
/* VCR data */
|
|
||||||
#define PCISH5_VCR_STATUS 0x00
|
|
||||||
#define PCISH5_VCR_VERSION 0x08
|
|
||||||
|
|
||||||
/*
|
|
||||||
** ICR register offsets and bits
|
|
||||||
*/
|
|
||||||
#define PCISH5_ICR_CR 0x100 /* PCI control register values */
|
|
||||||
#define CR_PBAM (1<<12)
|
|
||||||
#define CR_PFCS (1<<11)
|
|
||||||
#define CR_FTO (1<<10)
|
|
||||||
#define CR_PFE (1<<9)
|
|
||||||
#define CR_TBS (1<<8)
|
|
||||||
#define CR_SPUE (1<<7)
|
|
||||||
#define CR_BMAM (1<<6)
|
|
||||||
#define CR_HOST (1<<5)
|
|
||||||
#define CR_CLKEN (1<<4)
|
|
||||||
#define CR_SOCS (1<<3)
|
|
||||||
#define CR_IOCS (1<<2)
|
|
||||||
#define CR_RSTCTL (1<<1)
|
|
||||||
#define CR_CFINT (1<<0)
|
|
||||||
#define CR_LOCK_MASK 0xa5000000
|
|
||||||
|
|
||||||
#define PCISH5_ICR_INT 0x114 /* Interrupt registert values */
|
|
||||||
#define INT_MADIM (1<<2)
|
|
||||||
|
|
||||||
#define PCISH5_ICR_LSR0 0X104 /* Local space register values */
|
|
||||||
#define PCISH5_ICR_LSR1 0X108 /* Local space register values */
|
|
||||||
#define PCISH5_ICR_LAR0 0x10c /* Local address register values */
|
|
||||||
#define PCISH5_ICR_LAR1 0x110 /* Local address register values */
|
|
||||||
#define PCISH5_ICR_INTM 0x118 /* Interrupt mask register values */
|
|
||||||
#define PCISH5_ICR_AIR 0x11c /* Interrupt error address information register values */
|
|
||||||
#define PCISH5_ICR_CIR 0x120 /* Interrupt error command information register values */
|
|
||||||
#define PCISH5_ICR_AINT 0x130 /* Interrupt error arbiter interrupt register values */
|
|
||||||
#define PCISH5_ICR_AINTM 0x134 /* Interrupt error arbiter interrupt mask register values */
|
|
||||||
#define PCISH5_ICR_BMIR 0x138 /* Interrupt error info register of bus master values */
|
|
||||||
#define PCISH5_ICR_PAR 0x1c0 /* Pio address register values */
|
|
||||||
#define PCISH5_ICR_MBR 0x1c4 /* Memory space bank register values */
|
|
||||||
#define PCISH5_ICR_IOBR 0x1c8 /* I/O space bank register values */
|
|
||||||
#define PCISH5_ICR_PINT 0x1cc /* power management interrupt register values */
|
|
||||||
#define PCISH5_ICR_PINTM 0x1d0 /* power management interrupt mask register values */
|
|
||||||
#define PCISH5_ICR_MBMR 0x1d8 /* memory space bank mask register values */
|
|
||||||
#define PCISH5_ICR_IOBMR 0x1dc /* I/O space bank mask register values */
|
|
||||||
#define PCISH5_ICR_CSCR0 0x210 /* PCI cache snoop control register 0 */
|
|
||||||
#define PCISH5_ICR_CSCR1 0x214 /* PCI cache snoop control register 1 */
|
|
||||||
#define PCISH5_ICR_PDR 0x220 /* Pio data register values */
|
|
||||||
|
|
||||||
/* These are configs space registers */
|
|
||||||
#define PCISH5_ICR_CSR_VID 0x000 /* Vendor id */
|
|
||||||
#define PCISH5_ICR_CSR_DID 0x002 /* Device id */
|
|
||||||
#define PCISH5_ICR_CSR_CMD 0x004 /* Command register */
|
|
||||||
#define PCISH5_ICR_CSR_STATUS 0x006 /* Stautus */
|
|
||||||
#define PCISH5_ICR_CSR_IBAR0 0x010 /* I/O base address register */
|
|
||||||
#define PCISH5_ICR_CSR_MBAR0 0x014 /* First Memory base address register */
|
|
||||||
#define PCISH5_ICR_CSR_MBAR1 0x018 /* Second Memory base address register */
|
|
||||||
|
|
||||||
/* Base address of registers */
|
|
||||||
#define SH5PCI_ICR_BASE (PHYS_PCI_BLOCK + 0x00040000)
|
|
||||||
#define SH5PCI_IO_BASE (PHYS_PCI_BLOCK + 0x00800000)
|
|
||||||
/* #define SH5PCI_VCR_BASE (P2SEG_PCICB_BLOCK + P2SEG) */
|
|
||||||
|
|
||||||
extern unsigned long pcicr_virt;
|
|
||||||
/* Register selection macro */
|
|
||||||
#define PCISH5_ICR_REG(x) ( pcicr_virt + (PCISH5_ICR_##x))
|
|
||||||
/* #define PCISH5_VCR_REG(x) ( SH5PCI_VCR_BASE (PCISH5_VCR_##x)) */
|
|
||||||
|
|
||||||
/* Write I/O functions */
|
|
||||||
#define SH5PCI_WRITE(reg,val) __raw_writel((u32)(val),PCISH5_ICR_REG(reg))
|
|
||||||
#define SH5PCI_WRITE_SHORT(reg,val) __raw_writew((u16)(val),PCISH5_ICR_REG(reg))
|
|
||||||
#define SH5PCI_WRITE_BYTE(reg,val) __raw_writeb((u8)(val),PCISH5_ICR_REG(reg))
|
|
||||||
|
|
||||||
/* Read I/O functions */
|
|
||||||
#define SH5PCI_READ(reg) __raw_readl(PCISH5_ICR_REG(reg))
|
|
||||||
#define SH5PCI_READ_SHORT(reg) __raw_readw(PCISH5_ICR_REG(reg))
|
|
||||||
#define SH5PCI_READ_BYTE(reg) __raw_readb(PCISH5_ICR_REG(reg))
|
|
||||||
|
|
||||||
/* Set PCI config bits */
|
|
||||||
#define SET_CONFIG_BITS(bus,devfn,where) ((((bus) << 16) | ((devfn) << 8) | ((where) & ~3)) | 0x80000000)
|
|
||||||
|
|
||||||
/* Set PCI command register */
|
|
||||||
#define CONFIG_CMD(bus, devfn, where) SET_CONFIG_BITS(bus->number,devfn,where)
|
|
||||||
|
|
||||||
/* Size converters */
|
|
||||||
#define PCISH5_MEM_SIZCONV(x) (((x / 0x40000) - 1) << 18)
|
|
||||||
#define PCISH5_IO_SIZCONV(x) (((x / 0x40000) - 1) << 18)
|
|
||||||
|
|
||||||
extern struct pci_ops sh5_pci_ops;
|
|
||||||
|
|
||||||
#endif /* __PCI_SH5_H */
|
|
@@ -6,7 +6,7 @@
|
|||||||
#ifndef __ASM_SH_BARRIER_H
|
#ifndef __ASM_SH_BARRIER_H
|
||||||
#define __ASM_SH_BARRIER_H
|
#define __ASM_SH_BARRIER_H
|
||||||
|
|
||||||
#if defined(CONFIG_CPU_SH4A) || defined(CONFIG_CPU_SH5)
|
#if defined(CONFIG_CPU_SH4A)
|
||||||
#include <asm/cache_insns.h>
|
#include <asm/cache_insns.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
* Historically we have only done this type of barrier for the MMUCR, but
|
* Historically we have only done this type of barrier for the MMUCR, but
|
||||||
* it's also necessary for the CCR, so we make it generic here instead.
|
* it's also necessary for the CCR, so we make it generic here instead.
|
||||||
*/
|
*/
|
||||||
#if defined(CONFIG_CPU_SH4A) || defined(CONFIG_CPU_SH5)
|
#if defined(CONFIG_CPU_SH4A)
|
||||||
#define mb() __asm__ __volatile__ ("synco": : :"memory")
|
#define mb() __asm__ __volatile__ ("synco": : :"memory")
|
||||||
#define rmb() mb()
|
#define rmb() mb()
|
||||||
#define wmb() mb()
|
#define wmb() mb()
|
||||||
|
@@ -26,7 +26,6 @@
|
|||||||
#include <asm-generic/bitops/non-atomic.h>
|
#include <asm-generic/bitops/non-atomic.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_SUPERH32
|
|
||||||
static inline unsigned long ffz(unsigned long word)
|
static inline unsigned long ffz(unsigned long word)
|
||||||
{
|
{
|
||||||
unsigned long result;
|
unsigned long result;
|
||||||
@@ -60,31 +59,6 @@ static inline unsigned long __ffs(unsigned long word)
|
|||||||
: "t");
|
: "t");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
static inline unsigned long ffz(unsigned long word)
|
|
||||||
{
|
|
||||||
unsigned long result, __d2, __d3;
|
|
||||||
|
|
||||||
__asm__("gettr tr0, %2\n\t"
|
|
||||||
"pta $+32, tr0\n\t"
|
|
||||||
"andi %1, 1, %3\n\t"
|
|
||||||
"beq %3, r63, tr0\n\t"
|
|
||||||
"pta $+4, tr0\n"
|
|
||||||
"0:\n\t"
|
|
||||||
"shlri.l %1, 1, %1\n\t"
|
|
||||||
"addi %0, 1, %0\n\t"
|
|
||||||
"andi %1, 1, %3\n\t"
|
|
||||||
"beqi %3, 1, tr0\n"
|
|
||||||
"1:\n\t"
|
|
||||||
"ptabs %2, tr0\n\t"
|
|
||||||
: "=r" (result), "=r" (word), "=r" (__d2), "=r" (__d3)
|
|
||||||
: "0" (0L), "1" (word));
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
#include <asm-generic/bitops/__ffs.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <asm-generic/bitops/find.h>
|
#include <asm-generic/bitops/find.h>
|
||||||
#include <asm-generic/bitops/ffs.h>
|
#include <asm-generic/bitops/ffs.h>
|
||||||
|
@@ -1,11 +1,2 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0 */
|
/* SPDX-License-Identifier: GPL-2.0 */
|
||||||
#ifndef __ASM_SH_BL_BIT_H
|
#include <asm/bl_bit_32.h>
|
||||||
#define __ASM_SH_BL_BIT_H
|
|
||||||
|
|
||||||
#ifdef CONFIG_SUPERH32
|
|
||||||
# include <asm/bl_bit_32.h>
|
|
||||||
#else
|
|
||||||
# include <asm/bl_bit_64.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* __ASM_SH_BL_BIT_H */
|
|
||||||
|
@@ -1,37 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0
|
|
||||||
*
|
|
||||||
* Copyright (C) 2000, 2001 Paolo Alberelli
|
|
||||||
* Copyright (C) 2003 Paul Mundt
|
|
||||||
* Copyright (C) 2004 Richard Curnow
|
|
||||||
*/
|
|
||||||
#ifndef __ASM_SH_BL_BIT_64_H
|
|
||||||
#define __ASM_SH_BL_BIT_64_H
|
|
||||||
|
|
||||||
#include <asm/processor.h>
|
|
||||||
|
|
||||||
#define SR_BL_LL 0x0000000010000000LL
|
|
||||||
|
|
||||||
static inline void set_bl_bit(void)
|
|
||||||
{
|
|
||||||
unsigned long long __dummy0, __dummy1 = SR_BL_LL;
|
|
||||||
|
|
||||||
__asm__ __volatile__("getcon " __SR ", %0\n\t"
|
|
||||||
"or %0, %1, %0\n\t"
|
|
||||||
"putcon %0, " __SR "\n\t"
|
|
||||||
: "=&r" (__dummy0)
|
|
||||||
: "r" (__dummy1));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void clear_bl_bit(void)
|
|
||||||
{
|
|
||||||
unsigned long long __dummy0, __dummy1 = ~SR_BL_LL;
|
|
||||||
|
|
||||||
__asm__ __volatile__("getcon " __SR ", %0\n\t"
|
|
||||||
"and %0, %1, %0\n\t"
|
|
||||||
"putcon %0, " __SR "\n\t"
|
|
||||||
: "=&r" (__dummy0)
|
|
||||||
: "r" (__dummy1));
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* __ASM_SH_BL_BIT_64_H */
|
|
@@ -53,10 +53,6 @@ static void __init check_bugs(void)
|
|||||||
*p++ = 's';
|
*p++ = 's';
|
||||||
*p++ = 'p';
|
*p++ = 'p';
|
||||||
break;
|
break;
|
||||||
case CPU_FAMILY_SH5:
|
|
||||||
*p++ = '6';
|
|
||||||
*p++ = '4';
|
|
||||||
break;
|
|
||||||
case CPU_FAMILY_UNKNOWN:
|
case CPU_FAMILY_UNKNOWN:
|
||||||
/*
|
/*
|
||||||
* Specifically use CPU_FAMILY_UNKNOWN rather than
|
* Specifically use CPU_FAMILY_UNKNOWN rather than
|
||||||
|
@@ -1,12 +1,2 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0 */
|
/* SPDX-License-Identifier: GPL-2.0 */
|
||||||
#ifndef __ASM_SH_CACHE_INSNS_H
|
#include <asm/cache_insns_32.h>
|
||||||
#define __ASM_SH_CACHE_INSNS_H
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef CONFIG_SUPERH32
|
|
||||||
# include <asm/cache_insns_32.h>
|
|
||||||
#else
|
|
||||||
# include <asm/cache_insns_64.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* __ASM_SH_CACHE_INSNS_H */
|
|
||||||
|
@@ -1,20 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0
|
|
||||||
*
|
|
||||||
* Copyright (C) 2000, 2001 Paolo Alberelli
|
|
||||||
* Copyright (C) 2003 Paul Mundt
|
|
||||||
* Copyright (C) 2004 Richard Curnow
|
|
||||||
*/
|
|
||||||
#ifndef __ASM_SH_CACHE_INSNS_64_H
|
|
||||||
#define __ASM_SH_CACHE_INSNS_64_H
|
|
||||||
|
|
||||||
#define __icbi(addr) __asm__ __volatile__ ( "icbi %0, 0\n\t" : : "r" (addr))
|
|
||||||
#define __ocbp(addr) __asm__ __volatile__ ( "ocbp %0, 0\n\t" : : "r" (addr))
|
|
||||||
#define __ocbi(addr) __asm__ __volatile__ ( "ocbi %0, 0\n\t" : : "r" (addr))
|
|
||||||
#define __ocbwb(addr) __asm__ __volatile__ ( "ocbwb %0, 0\n\t" : : "r" (addr))
|
|
||||||
|
|
||||||
static inline reg_size_t register_align(void *val)
|
|
||||||
{
|
|
||||||
return (unsigned long long)(signed long long)(signed long)val;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* __ASM_SH_CACHE_INSNS_64_H */
|
|
@@ -1,6 +1,2 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0 */
|
/* SPDX-License-Identifier: GPL-2.0 */
|
||||||
#ifdef CONFIG_SUPERH32
|
#include <asm/checksum_32.h>
|
||||||
# include <asm/checksum_32.h>
|
|
||||||
#else
|
|
||||||
# include <asm-generic/checksum.h>
|
|
||||||
#endif
|
|
||||||
|
@@ -133,28 +133,6 @@ typedef struct user_fpu_struct elf_fpregset_t;
|
|||||||
|
|
||||||
#define ELF_PLATFORM (utsname()->machine)
|
#define ELF_PLATFORM (utsname()->machine)
|
||||||
|
|
||||||
#ifdef __SH5__
|
|
||||||
#define ELF_PLAT_INIT(_r, load_addr) \
|
|
||||||
do { _r->regs[0]=0; _r->regs[1]=0; _r->regs[2]=0; _r->regs[3]=0; \
|
|
||||||
_r->regs[4]=0; _r->regs[5]=0; _r->regs[6]=0; _r->regs[7]=0; \
|
|
||||||
_r->regs[8]=0; _r->regs[9]=0; _r->regs[10]=0; _r->regs[11]=0; \
|
|
||||||
_r->regs[12]=0; _r->regs[13]=0; _r->regs[14]=0; _r->regs[15]=0; \
|
|
||||||
_r->regs[16]=0; _r->regs[17]=0; _r->regs[18]=0; _r->regs[19]=0; \
|
|
||||||
_r->regs[20]=0; _r->regs[21]=0; _r->regs[22]=0; _r->regs[23]=0; \
|
|
||||||
_r->regs[24]=0; _r->regs[25]=0; _r->regs[26]=0; _r->regs[27]=0; \
|
|
||||||
_r->regs[28]=0; _r->regs[29]=0; _r->regs[30]=0; _r->regs[31]=0; \
|
|
||||||
_r->regs[32]=0; _r->regs[33]=0; _r->regs[34]=0; _r->regs[35]=0; \
|
|
||||||
_r->regs[36]=0; _r->regs[37]=0; _r->regs[38]=0; _r->regs[39]=0; \
|
|
||||||
_r->regs[40]=0; _r->regs[41]=0; _r->regs[42]=0; _r->regs[43]=0; \
|
|
||||||
_r->regs[44]=0; _r->regs[45]=0; _r->regs[46]=0; _r->regs[47]=0; \
|
|
||||||
_r->regs[48]=0; _r->regs[49]=0; _r->regs[50]=0; _r->regs[51]=0; \
|
|
||||||
_r->regs[52]=0; _r->regs[53]=0; _r->regs[54]=0; _r->regs[55]=0; \
|
|
||||||
_r->regs[56]=0; _r->regs[57]=0; _r->regs[58]=0; _r->regs[59]=0; \
|
|
||||||
_r->regs[60]=0; _r->regs[61]=0; _r->regs[62]=0; \
|
|
||||||
_r->tregs[0]=0; _r->tregs[1]=0; _r->tregs[2]=0; _r->tregs[3]=0; \
|
|
||||||
_r->tregs[4]=0; _r->tregs[5]=0; _r->tregs[6]=0; _r->tregs[7]=0; \
|
|
||||||
_r->sr = SR_FD | SR_MMU; } while (0)
|
|
||||||
#else
|
|
||||||
#define ELF_PLAT_INIT(_r, load_addr) \
|
#define ELF_PLAT_INIT(_r, load_addr) \
|
||||||
do { _r->regs[0]=0; _r->regs[1]=0; _r->regs[2]=0; _r->regs[3]=0; \
|
do { _r->regs[0]=0; _r->regs[1]=0; _r->regs[2]=0; _r->regs[3]=0; \
|
||||||
_r->regs[4]=0; _r->regs[5]=0; _r->regs[6]=0; _r->regs[7]=0; \
|
_r->regs[4]=0; _r->regs[5]=0; _r->regs[6]=0; _r->regs[7]=0; \
|
||||||
@@ -182,7 +160,6 @@ do { \
|
|||||||
_r->regs[14] = 0; \
|
_r->regs[14] = 0; \
|
||||||
_r->sr = SR_FD; \
|
_r->sr = SR_FD; \
|
||||||
} while (0)
|
} while (0)
|
||||||
#endif
|
|
||||||
|
|
||||||
#define SET_PERSONALITY(ex) \
|
#define SET_PERSONALITY(ex) \
|
||||||
set_personality(PER_LINUX_32BIT | (current->personality & (~PER_MASK)))
|
set_personality(PER_LINUX_32BIT | (current->personality & (~PER_MASK)))
|
||||||
|
@@ -4,8 +4,4 @@
|
|||||||
|
|
||||||
#include <asm-generic/extable.h>
|
#include <asm-generic/extable.h>
|
||||||
|
|
||||||
#if defined(CONFIG_SUPERH64) && defined(CONFIG_MMU)
|
|
||||||
#define ARCH_HAS_SEARCH_EXTABLE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -83,11 +83,7 @@ extern void __clear_fixmap(enum fixed_addresses idx, pgprot_t flags);
|
|||||||
* the start of the fixmap, and leave one page empty
|
* the start of the fixmap, and leave one page empty
|
||||||
* at the top of mem..
|
* at the top of mem..
|
||||||
*/
|
*/
|
||||||
#ifdef CONFIG_SUPERH32
|
|
||||||
#define FIXADDR_TOP (P4SEG - PAGE_SIZE)
|
#define FIXADDR_TOP (P4SEG - PAGE_SIZE)
|
||||||
#else
|
|
||||||
#define FIXADDR_TOP ((unsigned long)(-PAGE_SIZE))
|
|
||||||
#endif
|
|
||||||
#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
|
#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
|
||||||
#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
|
#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
|
||||||
|
|
||||||
|
@@ -115,12 +115,8 @@ static inline void pfx##reads##bwlq(volatile void __iomem *mem, \
|
|||||||
__BUILD_MEMORY_STRING(__raw_, b, u8)
|
__BUILD_MEMORY_STRING(__raw_, b, u8)
|
||||||
__BUILD_MEMORY_STRING(__raw_, w, u16)
|
__BUILD_MEMORY_STRING(__raw_, w, u16)
|
||||||
|
|
||||||
#ifdef CONFIG_SUPERH32
|
|
||||||
void __raw_writesl(void __iomem *addr, const void *data, int longlen);
|
void __raw_writesl(void __iomem *addr, const void *data, int longlen);
|
||||||
void __raw_readsl(const void __iomem *addr, void *data, int longlen);
|
void __raw_readsl(const void __iomem *addr, void *data, int longlen);
|
||||||
#else
|
|
||||||
__BUILD_MEMORY_STRING(__raw_, l, u32)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
__BUILD_MEMORY_STRING(__raw_, q, u64)
|
__BUILD_MEMORY_STRING(__raw_, q, u64)
|
||||||
|
|
||||||
@@ -328,7 +324,7 @@ __ioremap_mode(phys_addr_t offset, unsigned long size, pgprot_t prot)
|
|||||||
#else
|
#else
|
||||||
#define __ioremap(offset, size, prot) ((void __iomem *)(offset))
|
#define __ioremap(offset, size, prot) ((void __iomem *)(offset))
|
||||||
#define __ioremap_mode(offset, size, prot) ((void __iomem *)(offset))
|
#define __ioremap_mode(offset, size, prot) ((void __iomem *)(offset))
|
||||||
#define iounmap(addr) do { } while (0)
|
static inline void iounmap(void __iomem *addr) {}
|
||||||
#endif /* CONFIG_MMU */
|
#endif /* CONFIG_MMU */
|
||||||
|
|
||||||
static inline void __iomem *ioremap(phys_addr_t offset, unsigned long size)
|
static inline void __iomem *ioremap(phys_addr_t offset, unsigned long size)
|
||||||
|
@@ -53,12 +53,34 @@ static inline void ioport_unmap(void __iomem *addr)
|
|||||||
#define outw_p(x, addr) outw((x), (addr))
|
#define outw_p(x, addr) outw((x), (addr))
|
||||||
#define outl_p(x, addr) outl((x), (addr))
|
#define outl_p(x, addr) outl((x), (addr))
|
||||||
|
|
||||||
#define insb(a, b, c) BUG()
|
static inline void insb(unsigned long port, void *dst, unsigned long count)
|
||||||
#define insw(a, b, c) BUG()
|
{
|
||||||
#define insl(a, b, c) BUG()
|
BUG();
|
||||||
|
}
|
||||||
|
|
||||||
#define outsb(a, b, c) BUG()
|
static inline void insw(unsigned long port, void *dst, unsigned long count)
|
||||||
#define outsw(a, b, c) BUG()
|
{
|
||||||
#define outsl(a, b, c) BUG()
|
BUG();
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void insl(unsigned long port, void *dst, unsigned long count)
|
||||||
|
{
|
||||||
|
BUG();
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void outsb(unsigned long port, const void *src, unsigned long count)
|
||||||
|
{
|
||||||
|
BUG();
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void outsw(unsigned long port, const void *src, unsigned long count)
|
||||||
|
{
|
||||||
|
BUG();
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void outsl(unsigned long port, const void *src, unsigned long count)
|
||||||
|
{
|
||||||
|
BUG();
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* __ASM_SH_IO_NOIOPORT_H */
|
#endif /* __ASM_SH_IO_NOIOPORT_H */
|
||||||
|
@@ -66,8 +66,5 @@ extern void irq_finish(unsigned int irq);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <asm-generic/irq.h>
|
#include <asm-generic/irq.h>
|
||||||
#ifdef CONFIG_CPU_SH5
|
|
||||||
#include <cpu/irq.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* __ASM_SH_IRQ_H */
|
#endif /* __ASM_SH_IRQ_H */
|
||||||
|
@@ -48,11 +48,7 @@
|
|||||||
*/
|
*/
|
||||||
#define MMU_VPN_MASK 0xfffff000
|
#define MMU_VPN_MASK 0xfffff000
|
||||||
|
|
||||||
#if defined(CONFIG_SUPERH32)
|
|
||||||
#include <asm/mmu_context_32.h>
|
#include <asm/mmu_context_32.h>
|
||||||
#else
|
|
||||||
#include <asm/mmu_context_64.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get MMU context if needed.
|
* Get MMU context if needed.
|
||||||
@@ -74,14 +70,6 @@ static inline void get_mmu_context(struct mm_struct *mm, unsigned int cpu)
|
|||||||
*/
|
*/
|
||||||
local_flush_tlb_all();
|
local_flush_tlb_all();
|
||||||
|
|
||||||
#ifdef CONFIG_SUPERH64
|
|
||||||
/*
|
|
||||||
* The SH-5 cache uses the ASIDs, requiring both the I and D
|
|
||||||
* cache to be flushed when the ASID is exhausted. Weak.
|
|
||||||
*/
|
|
||||||
flush_cache_all();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Fix version; Note that we avoid version #0
|
* Fix version; Note that we avoid version #0
|
||||||
* to distinguish NO_CONTEXT.
|
* to distinguish NO_CONTEXT.
|
||||||
|
@@ -1,75 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0 */
|
|
||||||
#ifndef __ASM_SH_MMU_CONTEXT_64_H
|
|
||||||
#define __ASM_SH_MMU_CONTEXT_64_H
|
|
||||||
|
|
||||||
/*
|
|
||||||
* sh64-specific mmu_context interface.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2000, 2001 Paolo Alberelli
|
|
||||||
* Copyright (C) 2003 - 2007 Paul Mundt
|
|
||||||
*/
|
|
||||||
#include <cpu/registers.h>
|
|
||||||
#include <asm/cacheflush.h>
|
|
||||||
|
|
||||||
#define SR_ASID_MASK 0xffffffffff00ffffULL
|
|
||||||
#define SR_ASID_SHIFT 16
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Destroy context related info for an mm_struct that is about
|
|
||||||
* to be put to rest.
|
|
||||||
*/
|
|
||||||
static inline void destroy_context(struct mm_struct *mm)
|
|
||||||
{
|
|
||||||
/* Well, at least free TLB entries */
|
|
||||||
flush_tlb_mm(mm);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline unsigned long get_asid(void)
|
|
||||||
{
|
|
||||||
unsigned long long sr;
|
|
||||||
|
|
||||||
asm volatile ("getcon " __SR ", %0\n\t"
|
|
||||||
: "=r" (sr));
|
|
||||||
|
|
||||||
sr = (sr >> SR_ASID_SHIFT) & MMU_CONTEXT_ASID_MASK;
|
|
||||||
return (unsigned long) sr;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Set ASID into SR */
|
|
||||||
static inline void set_asid(unsigned long asid)
|
|
||||||
{
|
|
||||||
unsigned long long sr, pc;
|
|
||||||
|
|
||||||
asm volatile ("getcon " __SR ", %0" : "=r" (sr));
|
|
||||||
|
|
||||||
sr = (sr & SR_ASID_MASK) | (asid << SR_ASID_SHIFT);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* It is possible that this function may be inlined and so to avoid
|
|
||||||
* the assembler reporting duplicate symbols we make use of the
|
|
||||||
* gas trick of generating symbols using numerics and forward
|
|
||||||
* reference.
|
|
||||||
*/
|
|
||||||
asm volatile ("movi 1, %1\n\t"
|
|
||||||
"shlli %1, 28, %1\n\t"
|
|
||||||
"or %0, %1, %1\n\t"
|
|
||||||
"putcon %1, " __SR "\n\t"
|
|
||||||
"putcon %0, " __SSR "\n\t"
|
|
||||||
"movi 1f, %1\n\t"
|
|
||||||
"ori %1, 1 , %1\n\t"
|
|
||||||
"putcon %1, " __SPC "\n\t"
|
|
||||||
"rte\n"
|
|
||||||
"1:\n\t"
|
|
||||||
: "=r" (sr), "=r" (pc) : "0" (sr));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* arch/sh/kernel/cpu/sh5/entry.S */
|
|
||||||
extern unsigned long switch_and_save_asid(unsigned long new_asid);
|
|
||||||
|
|
||||||
/* No spare register to twiddle, so use a software cache */
|
|
||||||
extern pgd_t *mmu_pdtp_cache;
|
|
||||||
|
|
||||||
#define set_TTB(pgd) (mmu_pdtp_cache = (pgd))
|
|
||||||
#define get_TTB() (mmu_pdtp_cache)
|
|
||||||
|
|
||||||
#endif /* __ASM_SH_MMU_CONTEXT_64_H */
|
|
@@ -35,8 +35,6 @@
|
|||||||
#define HPAGE_SHIFT 22
|
#define HPAGE_SHIFT 22
|
||||||
#elif defined(CONFIG_HUGETLB_PAGE_SIZE_64MB)
|
#elif defined(CONFIG_HUGETLB_PAGE_SIZE_64MB)
|
||||||
#define HPAGE_SHIFT 26
|
#define HPAGE_SHIFT 26
|
||||||
#elif defined(CONFIG_HUGETLB_PAGE_SIZE_512MB)
|
|
||||||
#define HPAGE_SHIFT 29
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_HUGETLB_PAGE
|
#ifdef CONFIG_HUGETLB_PAGE
|
||||||
@@ -82,18 +80,12 @@ typedef struct { unsigned long long pgd; } pgd_t;
|
|||||||
((x).pte_low | ((unsigned long long)(x).pte_high << 32))
|
((x).pte_low | ((unsigned long long)(x).pte_high << 32))
|
||||||
#define __pte(x) \
|
#define __pte(x) \
|
||||||
({ pte_t __pte = {(x), ((unsigned long long)(x)) >> 32}; __pte; })
|
({ pte_t __pte = {(x), ((unsigned long long)(x)) >> 32}; __pte; })
|
||||||
#elif defined(CONFIG_SUPERH32)
|
#else
|
||||||
typedef struct { unsigned long pte_low; } pte_t;
|
typedef struct { unsigned long pte_low; } pte_t;
|
||||||
typedef struct { unsigned long pgprot; } pgprot_t;
|
typedef struct { unsigned long pgprot; } pgprot_t;
|
||||||
typedef struct { unsigned long pgd; } pgd_t;
|
typedef struct { unsigned long pgd; } pgd_t;
|
||||||
#define pte_val(x) ((x).pte_low)
|
#define pte_val(x) ((x).pte_low)
|
||||||
#define __pte(x) ((pte_t) { (x) } )
|
#define __pte(x) ((pte_t) { (x) } )
|
||||||
#else
|
|
||||||
typedef struct { unsigned long long pte_low; } pte_t;
|
|
||||||
typedef struct { unsigned long long pgprot; } pgprot_t;
|
|
||||||
typedef struct { unsigned long pgd; } pgd_t;
|
|
||||||
#define pte_val(x) ((x).pte_low)
|
|
||||||
#define __pte(x) ((pte_t) { (x) } )
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define pgd_val(x) ((x).pgd)
|
#define pgd_val(x) ((x).pgd)
|
||||||
@@ -191,15 +183,4 @@ typedef struct page *pgtable_t;
|
|||||||
*/
|
*/
|
||||||
#define ARCH_DMA_MINALIGN L1_CACHE_BYTES
|
#define ARCH_DMA_MINALIGN L1_CACHE_BYTES
|
||||||
|
|
||||||
#ifdef CONFIG_SUPERH64
|
|
||||||
/*
|
|
||||||
* While BYTES_PER_WORD == 4 on the current sh64 ABI, GCC will still
|
|
||||||
* happily generate {ld/st}.q pairs, requiring us to have 8-byte
|
|
||||||
* alignment to avoid traps. The kmalloc alignment is guaranteed by
|
|
||||||
* virtue of L1_CACHE_BYTES, requiring this to only be special cased
|
|
||||||
* for slab caches.
|
|
||||||
*/
|
|
||||||
#define ARCH_SLAB_MINALIGN 8
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* __ASM_SH_PAGE_H */
|
#endif /* __ASM_SH_PAGE_H */
|
||||||
|
@@ -76,18 +76,10 @@ static inline unsigned long phys_addr_mask(void)
|
|||||||
#define PTE_PHYS_MASK (phys_addr_mask() & PAGE_MASK)
|
#define PTE_PHYS_MASK (phys_addr_mask() & PAGE_MASK)
|
||||||
#define PTE_FLAGS_MASK (~(PTE_PHYS_MASK) << PAGE_SHIFT)
|
#define PTE_FLAGS_MASK (~(PTE_PHYS_MASK) << PAGE_SHIFT)
|
||||||
|
|
||||||
#ifdef CONFIG_SUPERH32
|
|
||||||
#define VMALLOC_START (P3SEG)
|
#define VMALLOC_START (P3SEG)
|
||||||
#else
|
|
||||||
#define VMALLOC_START (0xf0000000)
|
|
||||||
#endif
|
|
||||||
#define VMALLOC_END (FIXADDR_START-2*PAGE_SIZE)
|
#define VMALLOC_END (FIXADDR_START-2*PAGE_SIZE)
|
||||||
|
|
||||||
#if defined(CONFIG_SUPERH32)
|
|
||||||
#include <asm/pgtable_32.h>
|
#include <asm/pgtable_32.h>
|
||||||
#else
|
|
||||||
#include <asm/pgtable_64.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* SH-X and lower (legacy) SuperH parts (SH-3, SH-4, some SH-4A) can't do page
|
* SH-X and lower (legacy) SuperH parts (SH-3, SH-4, some SH-4A) can't do page
|
||||||
@@ -159,15 +151,6 @@ static inline bool pte_access_permitted(pte_t pte, bool write)
|
|||||||
prot |= _PAGE_EXT(_PAGE_EXT_KERN_WRITE | _PAGE_EXT_USER_WRITE);
|
prot |= _PAGE_EXT(_PAGE_EXT_KERN_WRITE | _PAGE_EXT_USER_WRITE);
|
||||||
return __pte_access_permitted(pte, prot);
|
return __pte_access_permitted(pte, prot);
|
||||||
}
|
}
|
||||||
#elif defined(CONFIG_SUPERH64)
|
|
||||||
static inline bool pte_access_permitted(pte_t pte, bool write)
|
|
||||||
{
|
|
||||||
u64 prot = _PAGE_PRESENT | _PAGE_USER | _PAGE_READ;
|
|
||||||
|
|
||||||
if (write)
|
|
||||||
prot |= _PAGE_WRITE;
|
|
||||||
return __pte_access_permitted(pte, prot);
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
static inline bool pte_access_permitted(pte_t pte, bool write)
|
static inline bool pte_access_permitted(pte_t pte, bool write)
|
||||||
{
|
{
|
||||||
|
@@ -1,306 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0 */
|
|
||||||
#ifndef __ASM_SH_PGTABLE_64_H
|
|
||||||
#define __ASM_SH_PGTABLE_64_H
|
|
||||||
|
|
||||||
/*
|
|
||||||
* include/asm-sh/pgtable_64.h
|
|
||||||
*
|
|
||||||
* This file contains the functions and defines necessary to modify and use
|
|
||||||
* the SuperH page table tree.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2000, 2001 Paolo Alberelli
|
|
||||||
* Copyright (C) 2003, 2004 Paul Mundt
|
|
||||||
* Copyright (C) 2003, 2004 Richard Curnow
|
|
||||||
*/
|
|
||||||
#include <linux/threads.h>
|
|
||||||
#include <asm/processor.h>
|
|
||||||
#include <asm/page.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Error outputs.
|
|
||||||
*/
|
|
||||||
#define pte_ERROR(e) \
|
|
||||||
printk("%s:%d: bad pte %016Lx.\n", __FILE__, __LINE__, pte_val(e))
|
|
||||||
#define pgd_ERROR(e) \
|
|
||||||
printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Table setting routines. Used within arch/mm only.
|
|
||||||
*/
|
|
||||||
#define set_pmd(pmdptr, pmdval) (*(pmdptr) = pmdval)
|
|
||||||
|
|
||||||
static __inline__ void set_pte(pte_t *pteptr, pte_t pteval)
|
|
||||||
{
|
|
||||||
unsigned long long x = ((unsigned long long) pteval.pte_low);
|
|
||||||
unsigned long long *xp = (unsigned long long *) pteptr;
|
|
||||||
/*
|
|
||||||
* Sign-extend based on NPHYS.
|
|
||||||
*/
|
|
||||||
*(xp) = (x & NPHYS_SIGN) ? (x | NPHYS_MASK) : x;
|
|
||||||
}
|
|
||||||
#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
|
|
||||||
|
|
||||||
/*
|
|
||||||
* PGD defines. Top level.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* To find an entry in a generic PGD. */
|
|
||||||
#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
|
|
||||||
#define pgd_offset(mm, address) ((mm)->pgd+pgd_index(address))
|
|
||||||
|
|
||||||
/* To find an entry in a kernel PGD. */
|
|
||||||
#define pgd_offset_k(address) pgd_offset(&init_mm, address)
|
|
||||||
|
|
||||||
#define pud_index(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1))
|
|
||||||
/* #define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* PMD level access routines. Same notes as above.
|
|
||||||
*/
|
|
||||||
#define _PMD_EMPTY 0x0
|
|
||||||
/* Either the PMD is empty or present, it's not paged out */
|
|
||||||
#define pmd_present(pmd_entry) (pmd_val(pmd_entry) & _PAGE_PRESENT)
|
|
||||||
#define pmd_clear(pmd_entry_p) (set_pmd((pmd_entry_p), __pmd(_PMD_EMPTY)))
|
|
||||||
#define pmd_none(pmd_entry) (pmd_val((pmd_entry)) == _PMD_EMPTY)
|
|
||||||
#define pmd_bad(pmd_entry) ((pmd_val(pmd_entry) & (~PAGE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE)
|
|
||||||
|
|
||||||
#define pmd_page_vaddr(pmd_entry) \
|
|
||||||
((unsigned long) __va(pmd_val(pmd_entry) & PAGE_MASK))
|
|
||||||
|
|
||||||
#define pmd_page(pmd) \
|
|
||||||
(virt_to_page(pmd_val(pmd)))
|
|
||||||
|
|
||||||
/* PMD to PTE dereferencing */
|
|
||||||
#define pte_index(address) \
|
|
||||||
((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
|
|
||||||
|
|
||||||
#define __pte_offset(address) pte_index(address)
|
|
||||||
|
|
||||||
#define pte_offset_kernel(dir, addr) \
|
|
||||||
((pte_t *) ((pmd_val(*(dir))) & PAGE_MASK) + pte_index((addr)))
|
|
||||||
|
|
||||||
#define pte_offset_map(dir,addr) pte_offset_kernel(dir, addr)
|
|
||||||
#define pte_unmap(pte) do { } while (0)
|
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
|
||||||
/*
|
|
||||||
* PTEL coherent flags.
|
|
||||||
* See Chapter 17 ST50 CPU Core Volume 1, Architecture.
|
|
||||||
*/
|
|
||||||
/* The bits that are required in the SH-5 TLB are placed in the h/w-defined
|
|
||||||
positions, to avoid expensive bit shuffling on every refill. The remaining
|
|
||||||
bits are used for s/w purposes and masked out on each refill.
|
|
||||||
|
|
||||||
Note, the PTE slots are used to hold data of type swp_entry_t when a page is
|
|
||||||
swapped out. Only the _PAGE_PRESENT flag is significant when the page is
|
|
||||||
swapped out, and it must be placed so that it doesn't overlap either the
|
|
||||||
type or offset fields of swp_entry_t. For x86, offset is at [31:8] and type
|
|
||||||
at [6:1], with _PAGE_PRESENT at bit 0 for both pte_t and swp_entry_t. This
|
|
||||||
scheme doesn't map to SH-5 because bit [0] controls cacheability. So bit
|
|
||||||
[2] is used for _PAGE_PRESENT and the type field of swp_entry_t is split
|
|
||||||
into 2 pieces. That is handled by SWP_ENTRY and SWP_TYPE below. */
|
|
||||||
#define _PAGE_WT 0x001 /* CB0: if cacheable, 1->write-thru, 0->write-back */
|
|
||||||
#define _PAGE_DEVICE 0x001 /* CB0: if uncacheable, 1->device (i.e. no write-combining or reordering at bus level) */
|
|
||||||
#define _PAGE_CACHABLE 0x002 /* CB1: uncachable/cachable */
|
|
||||||
#define _PAGE_PRESENT 0x004 /* software: page referenced */
|
|
||||||
#define _PAGE_SIZE0 0x008 /* SZ0-bit : size of page */
|
|
||||||
#define _PAGE_SIZE1 0x010 /* SZ1-bit : size of page */
|
|
||||||
#define _PAGE_SHARED 0x020 /* software: reflects PTEH's SH */
|
|
||||||
#define _PAGE_READ 0x040 /* PR0-bit : read access allowed */
|
|
||||||
#define _PAGE_EXECUTE 0x080 /* PR1-bit : execute access allowed */
|
|
||||||
#define _PAGE_WRITE 0x100 /* PR2-bit : write access allowed */
|
|
||||||
#define _PAGE_USER 0x200 /* PR3-bit : user space access allowed */
|
|
||||||
#define _PAGE_DIRTY 0x400 /* software: page accessed in write */
|
|
||||||
#define _PAGE_ACCESSED 0x800 /* software: page referenced */
|
|
||||||
|
|
||||||
/* Wrapper for extended mode pgprot twiddling */
|
|
||||||
#define _PAGE_EXT(x) ((unsigned long long)(x) << 32)
|
|
||||||
|
|
||||||
/*
|
|
||||||
* We can use the sign-extended bits in the PTEL to get 32 bits of
|
|
||||||
* software flags. This works for now because no implementations uses
|
|
||||||
* anything above the PPN field.
|
|
||||||
*/
|
|
||||||
#define _PAGE_WIRED _PAGE_EXT(0x001) /* software: wire the tlb entry */
|
|
||||||
#define _PAGE_SPECIAL _PAGE_EXT(0x002)
|
|
||||||
|
|
||||||
#define _PAGE_CLEAR_FLAGS (_PAGE_PRESENT | _PAGE_SHARED | \
|
|
||||||
_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_WIRED)
|
|
||||||
|
|
||||||
/* Mask which drops software flags */
|
|
||||||
#define _PAGE_FLAGS_HARDWARE_MASK (NEFF_MASK & ~(_PAGE_CLEAR_FLAGS))
|
|
||||||
|
|
||||||
/*
|
|
||||||
* HugeTLB support
|
|
||||||
*/
|
|
||||||
#if defined(CONFIG_HUGETLB_PAGE_SIZE_64K)
|
|
||||||
#define _PAGE_SZHUGE (_PAGE_SIZE0)
|
|
||||||
#elif defined(CONFIG_HUGETLB_PAGE_SIZE_1MB)
|
|
||||||
#define _PAGE_SZHUGE (_PAGE_SIZE1)
|
|
||||||
#elif defined(CONFIG_HUGETLB_PAGE_SIZE_512MB)
|
|
||||||
#define _PAGE_SZHUGE (_PAGE_SIZE0 | _PAGE_SIZE1)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Stub out _PAGE_SZHUGE if we don't have a good definition for it,
|
|
||||||
* to make pte_mkhuge() happy.
|
|
||||||
*/
|
|
||||||
#ifndef _PAGE_SZHUGE
|
|
||||||
# define _PAGE_SZHUGE (0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Default flags for a Kernel page.
|
|
||||||
* This is fundametally also SHARED because the main use of this define
|
|
||||||
* (other than for PGD/PMD entries) is for the VMALLOC pool which is
|
|
||||||
* contextless.
|
|
||||||
*
|
|
||||||
* _PAGE_EXECUTE is required for modules
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#define _KERNPG_TABLE (_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | \
|
|
||||||
_PAGE_EXECUTE | \
|
|
||||||
_PAGE_CACHABLE | _PAGE_ACCESSED | _PAGE_DIRTY | \
|
|
||||||
_PAGE_SHARED)
|
|
||||||
|
|
||||||
/* Default flags for a User page */
|
|
||||||
#define _PAGE_TABLE (_KERNPG_TABLE | _PAGE_USER)
|
|
||||||
|
|
||||||
#define _PAGE_CHG_MASK (PTE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | \
|
|
||||||
_PAGE_SPECIAL)
|
|
||||||
|
|
||||||
/*
|
|
||||||
* We have full permissions (Read/Write/Execute/Shared).
|
|
||||||
*/
|
|
||||||
#define _PAGE_COMMON (_PAGE_PRESENT | _PAGE_USER | \
|
|
||||||
_PAGE_CACHABLE | _PAGE_ACCESSED)
|
|
||||||
|
|
||||||
#define PAGE_NONE __pgprot(_PAGE_CACHABLE | _PAGE_ACCESSED)
|
|
||||||
#define PAGE_SHARED __pgprot(_PAGE_COMMON | _PAGE_READ | _PAGE_WRITE | \
|
|
||||||
_PAGE_SHARED)
|
|
||||||
#define PAGE_EXECREAD __pgprot(_PAGE_COMMON | _PAGE_READ | _PAGE_EXECUTE)
|
|
||||||
|
|
||||||
/*
|
|
||||||
* We need to include PAGE_EXECUTE in PAGE_COPY because it is the default
|
|
||||||
* protection mode for the stack.
|
|
||||||
*/
|
|
||||||
#define PAGE_COPY PAGE_EXECREAD
|
|
||||||
|
|
||||||
#define PAGE_READONLY __pgprot(_PAGE_COMMON | _PAGE_READ)
|
|
||||||
#define PAGE_WRITEONLY __pgprot(_PAGE_COMMON | _PAGE_WRITE)
|
|
||||||
#define PAGE_RWX __pgprot(_PAGE_COMMON | _PAGE_READ | \
|
|
||||||
_PAGE_WRITE | _PAGE_EXECUTE)
|
|
||||||
#define PAGE_KERNEL __pgprot(_KERNPG_TABLE)
|
|
||||||
|
|
||||||
#define PAGE_KERNEL_NOCACHE \
|
|
||||||
__pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | \
|
|
||||||
_PAGE_EXECUTE | _PAGE_ACCESSED | \
|
|
||||||
_PAGE_DIRTY | _PAGE_SHARED)
|
|
||||||
|
|
||||||
/* Make it a device mapping for maximum safety (e.g. for mapping device
|
|
||||||
registers into user-space via /dev/map). */
|
|
||||||
#define pgprot_noncached(x) __pgprot(((x).pgprot & ~(_PAGE_CACHABLE)) | _PAGE_DEVICE)
|
|
||||||
#define pgprot_writecombine(prot) __pgprot(pgprot_val(prot) & ~_PAGE_CACHABLE)
|
|
||||||
|
|
||||||
/*
|
|
||||||
* PTE level access routines.
|
|
||||||
*
|
|
||||||
* Note1:
|
|
||||||
* It's the tree walk leaf. This is physical address to be stored.
|
|
||||||
*
|
|
||||||
* Note 2:
|
|
||||||
* Regarding the choice of _PTE_EMPTY:
|
|
||||||
|
|
||||||
We must choose a bit pattern that cannot be valid, whether or not the page
|
|
||||||
is present. bit[2]==1 => present, bit[2]==0 => swapped out. If swapped
|
|
||||||
out, bits [31:8], [6:3], [1:0] are under swapper control, so only bit[7] is
|
|
||||||
left for us to select. If we force bit[7]==0 when swapped out, we could use
|
|
||||||
the combination bit[7,2]=2'b10 to indicate an empty PTE. Alternatively, if
|
|
||||||
we force bit[7]==1 when swapped out, we can use all zeroes to indicate
|
|
||||||
empty. This is convenient, because the page tables get cleared to zero
|
|
||||||
when they are allocated.
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define _PTE_EMPTY 0x0
|
|
||||||
#define pte_present(x) (pte_val(x) & _PAGE_PRESENT)
|
|
||||||
#define pte_clear(mm,addr,xp) (set_pte_at(mm, addr, xp, __pte(_PTE_EMPTY)))
|
|
||||||
#define pte_none(x) (pte_val(x) == _PTE_EMPTY)
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Some definitions to translate between mem_map, PTEs, and page
|
|
||||||
* addresses:
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Given a PTE, return the index of the mem_map[] entry corresponding
|
|
||||||
* to the page frame the PTE. Get the absolute physical address, make
|
|
||||||
* a relative physical address and translate it to an index.
|
|
||||||
*/
|
|
||||||
#define pte_pagenr(x) (((unsigned long) (pte_val(x)) - \
|
|
||||||
__MEMORY_START) >> PAGE_SHIFT)
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Given a PTE, return the "struct page *".
|
|
||||||
*/
|
|
||||||
#define pte_page(x) (mem_map + pte_pagenr(x))
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Return number of (down rounded) MB corresponding to x pages.
|
|
||||||
*/
|
|
||||||
#define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT))
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following have defined behavior only work if pte_present() is true.
|
|
||||||
*/
|
|
||||||
static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; }
|
|
||||||
static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; }
|
|
||||||
static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_WRITE; }
|
|
||||||
static inline int pte_special(pte_t pte){ return pte_val(pte) & _PAGE_SPECIAL; }
|
|
||||||
|
|
||||||
static inline pte_t pte_wrprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_WRITE)); return pte; }
|
|
||||||
static inline pte_t pte_mkclean(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); return pte; }
|
|
||||||
static inline pte_t pte_mkold(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_ACCESSED)); return pte; }
|
|
||||||
static inline pte_t pte_mkwrite(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_WRITE)); return pte; }
|
|
||||||
static inline pte_t pte_mkdirty(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; }
|
|
||||||
static inline pte_t pte_mkyoung(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; }
|
|
||||||
static inline pte_t pte_mkhuge(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_SZHUGE)); return pte; }
|
|
||||||
static inline pte_t pte_mkspecial(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_SPECIAL)); return pte; }
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Conversion functions: convert a page and protection to a page entry.
|
|
||||||
*
|
|
||||||
* extern pte_t mk_pte(struct page *page, pgprot_t pgprot)
|
|
||||||
*/
|
|
||||||
#define mk_pte(page,pgprot) \
|
|
||||||
({ \
|
|
||||||
pte_t __pte; \
|
|
||||||
\
|
|
||||||
set_pte(&__pte, __pte((((page)-mem_map) << PAGE_SHIFT) | \
|
|
||||||
__MEMORY_START | pgprot_val((pgprot)))); \
|
|
||||||
__pte; \
|
|
||||||
})
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This takes a (absolute) physical page address that is used
|
|
||||||
* by the remapping functions
|
|
||||||
*/
|
|
||||||
#define mk_pte_phys(physpage, pgprot) \
|
|
||||||
({ pte_t __pte; set_pte(&__pte, __pte(physpage | pgprot_val(pgprot))); __pte; })
|
|
||||||
|
|
||||||
static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
|
|
||||||
{ set_pte(&pte, __pte((pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot))); return pte; }
|
|
||||||
|
|
||||||
/* Encode and decode a swap entry */
|
|
||||||
#define __swp_type(x) (((x).val & 3) + (((x).val >> 1) & 0x3c))
|
|
||||||
#define __swp_offset(x) ((x).val >> 8)
|
|
||||||
#define __swp_entry(type, offset) ((swp_entry_t) { ((offset << 8) + ((type & 0x3c) << 1) + (type & 3)) })
|
|
||||||
#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
|
|
||||||
#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
|
|
||||||
|
|
||||||
#endif /* !__ASSEMBLY__ */
|
|
||||||
|
|
||||||
#define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
|
|
||||||
#define pfn_pmd(pfn, prot) __pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
|
|
||||||
|
|
||||||
#endif /* __ASM_SH_PGTABLE_64_H */
|
|
@@ -1,6 +1,2 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0 */
|
/* SPDX-License-Identifier: GPL-2.0 */
|
||||||
# ifdef CONFIG_SUPERH32
|
#include <asm/posix_types_32.h>
|
||||||
# include <asm/posix_types_32.h>
|
|
||||||
# else
|
|
||||||
# include <asm/posix_types_64.h>
|
|
||||||
# endif
|
|
||||||
|
@@ -39,9 +39,6 @@ enum cpu_type {
|
|||||||
/* SH4AL-DSP types */
|
/* SH4AL-DSP types */
|
||||||
CPU_SH7343, CPU_SH7722, CPU_SH7366, CPU_SH7372,
|
CPU_SH7343, CPU_SH7722, CPU_SH7366, CPU_SH7372,
|
||||||
|
|
||||||
/* SH-5 types */
|
|
||||||
CPU_SH5_101, CPU_SH5_103,
|
|
||||||
|
|
||||||
/* Unknown subtype */
|
/* Unknown subtype */
|
||||||
CPU_SH_NONE
|
CPU_SH_NONE
|
||||||
};
|
};
|
||||||
@@ -53,7 +50,6 @@ enum cpu_family {
|
|||||||
CPU_FAMILY_SH4,
|
CPU_FAMILY_SH4,
|
||||||
CPU_FAMILY_SH4A,
|
CPU_FAMILY_SH4A,
|
||||||
CPU_FAMILY_SH4AL_DSP,
|
CPU_FAMILY_SH4AL_DSP,
|
||||||
CPU_FAMILY_SH5,
|
|
||||||
CPU_FAMILY_UNKNOWN,
|
CPU_FAMILY_UNKNOWN,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -167,18 +163,12 @@ int vsyscall_init(void);
|
|||||||
*/
|
*/
|
||||||
#ifdef CONFIG_CPU_SH2A
|
#ifdef CONFIG_CPU_SH2A
|
||||||
extern unsigned int instruction_size(unsigned int insn);
|
extern unsigned int instruction_size(unsigned int insn);
|
||||||
#elif defined(CONFIG_SUPERH32)
|
|
||||||
#define instruction_size(insn) (2)
|
|
||||||
#else
|
#else
|
||||||
#define instruction_size(insn) (4)
|
#define instruction_size(insn) (2)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* __ASSEMBLY__ */
|
#endif /* __ASSEMBLY__ */
|
||||||
|
|
||||||
#ifdef CONFIG_SUPERH32
|
#include <asm/processor_32.h>
|
||||||
# include <asm/processor_32.h>
|
|
||||||
#else
|
|
||||||
# include <asm/processor_64.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* __ASM_SH_PROCESSOR_H */
|
#endif /* __ASM_SH_PROCESSOR_H */
|
||||||
|
@@ -1,212 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0 */
|
|
||||||
#ifndef __ASM_SH_PROCESSOR_64_H
|
|
||||||
#define __ASM_SH_PROCESSOR_64_H
|
|
||||||
|
|
||||||
/*
|
|
||||||
* include/asm-sh/processor_64.h
|
|
||||||
*
|
|
||||||
* Copyright (C) 2000, 2001 Paolo Alberelli
|
|
||||||
* Copyright (C) 2003 Paul Mundt
|
|
||||||
* Copyright (C) 2004 Richard Curnow
|
|
||||||
*/
|
|
||||||
#ifndef __ASSEMBLY__
|
|
||||||
|
|
||||||
#include <linux/compiler.h>
|
|
||||||
#include <asm/page.h>
|
|
||||||
#include <asm/types.h>
|
|
||||||
#include <cpu/registers.h>
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* User space process size: 2GB - 4k.
|
|
||||||
*/
|
|
||||||
#define TASK_SIZE 0x7ffff000UL
|
|
||||||
|
|
||||||
#define STACK_TOP TASK_SIZE
|
|
||||||
#define STACK_TOP_MAX STACK_TOP
|
|
||||||
|
|
||||||
/* This decides where the kernel will search for a free chunk of vm
|
|
||||||
* space during mmap's.
|
|
||||||
*/
|
|
||||||
#define TASK_UNMAPPED_BASE PAGE_ALIGN(TASK_SIZE / 3)
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Bit of SR register
|
|
||||||
*
|
|
||||||
* FD-bit:
|
|
||||||
* When it's set, it means the processor doesn't have right to use FPU,
|
|
||||||
* and it results exception when the floating operation is executed.
|
|
||||||
*
|
|
||||||
* IMASK-bit:
|
|
||||||
* Interrupt level mask
|
|
||||||
*
|
|
||||||
* STEP-bit:
|
|
||||||
* Single step bit
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#if defined(CONFIG_SH64_SR_WATCH)
|
|
||||||
#define SR_MMU 0x84000000
|
|
||||||
#else
|
|
||||||
#define SR_MMU 0x80000000
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define SR_IMASK 0x000000f0
|
|
||||||
#define SR_FD 0x00008000
|
|
||||||
#define SR_SSTEP 0x08000000
|
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
|
||||||
|
|
||||||
/*
|
|
||||||
* FPU structure and data : require 8-byte alignment as we need to access it
|
|
||||||
with fld.p, fst.p
|
|
||||||
*/
|
|
||||||
|
|
||||||
struct sh_fpu_hard_struct {
|
|
||||||
unsigned long fp_regs[64];
|
|
||||||
unsigned int fpscr;
|
|
||||||
/* long status; * software status information */
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Dummy fpu emulator */
|
|
||||||
struct sh_fpu_soft_struct {
|
|
||||||
unsigned long fp_regs[64];
|
|
||||||
unsigned int fpscr;
|
|
||||||
unsigned char lookahead;
|
|
||||||
unsigned long entry_pc;
|
|
||||||
};
|
|
||||||
|
|
||||||
union thread_xstate {
|
|
||||||
struct sh_fpu_hard_struct hardfpu;
|
|
||||||
struct sh_fpu_soft_struct softfpu;
|
|
||||||
/*
|
|
||||||
* The structure definitions only produce 32 bit alignment, yet we need
|
|
||||||
* to access them using 64 bit load/store as well.
|
|
||||||
*/
|
|
||||||
unsigned long long alignment_dummy;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct thread_struct {
|
|
||||||
unsigned long sp;
|
|
||||||
unsigned long pc;
|
|
||||||
|
|
||||||
/* Various thread flags, see SH_THREAD_xxx */
|
|
||||||
unsigned long flags;
|
|
||||||
|
|
||||||
/* This stores the address of the pt_regs built during a context
|
|
||||||
switch, or of the register save area built for a kernel mode
|
|
||||||
exception. It is used for backtracing the stack of a sleeping task
|
|
||||||
or one that traps in kernel mode. */
|
|
||||||
struct pt_regs *kregs;
|
|
||||||
/* This stores the address of the pt_regs constructed on entry from
|
|
||||||
user mode. It is a fixed value over the lifetime of a process, or
|
|
||||||
NULL for a kernel thread. */
|
|
||||||
struct pt_regs *uregs;
|
|
||||||
|
|
||||||
unsigned long address;
|
|
||||||
/* Hardware debugging registers may come here */
|
|
||||||
|
|
||||||
/* floating point info */
|
|
||||||
union thread_xstate *xstate;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* fpu_counter contains the number of consecutive context switches
|
|
||||||
* that the FPU is used. If this is over a threshold, the lazy fpu
|
|
||||||
* saving becomes unlazy to save the trap. This is an unsigned char
|
|
||||||
* so that after 256 times the counter wraps and the behavior turns
|
|
||||||
* lazy again; this to deal with bursty apps that only use FPU for
|
|
||||||
* a short time
|
|
||||||
*/
|
|
||||||
unsigned char fpu_counter;
|
|
||||||
};
|
|
||||||
|
|
||||||
#define INIT_MMAP \
|
|
||||||
{ &init_mm, 0, 0, NULL, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, 1, NULL, NULL }
|
|
||||||
|
|
||||||
#define INIT_THREAD { \
|
|
||||||
.sp = sizeof(init_stack) + \
|
|
||||||
(long) &init_stack, \
|
|
||||||
.pc = 0, \
|
|
||||||
.kregs = &fake_swapper_regs, \
|
|
||||||
.uregs = NULL, \
|
|
||||||
.address = 0, \
|
|
||||||
.flags = 0, \
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Do necessary setup to start up a newly executed thread.
|
|
||||||
*/
|
|
||||||
#define SR_USER (SR_MMU | SR_FD)
|
|
||||||
|
|
||||||
#define start_thread(_regs, new_pc, new_sp) \
|
|
||||||
_regs->sr = SR_USER; /* User mode. */ \
|
|
||||||
_regs->pc = new_pc - 4; /* Compensate syscall exit */ \
|
|
||||||
_regs->pc |= 1; /* Set SHmedia ! */ \
|
|
||||||
_regs->regs[18] = 0; \
|
|
||||||
_regs->regs[15] = new_sp
|
|
||||||
|
|
||||||
/* Forward declaration, a strange C thing */
|
|
||||||
struct task_struct;
|
|
||||||
struct mm_struct;
|
|
||||||
|
|
||||||
/* Free all resources held by a thread. */
|
|
||||||
extern void release_thread(struct task_struct *);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* FPU lazy state save handling.
|
|
||||||
*/
|
|
||||||
|
|
||||||
static inline void disable_fpu(void)
|
|
||||||
{
|
|
||||||
unsigned long long __dummy;
|
|
||||||
|
|
||||||
/* Set FD flag in SR */
|
|
||||||
__asm__ __volatile__("getcon " __SR ", %0\n\t"
|
|
||||||
"or %0, %1, %0\n\t"
|
|
||||||
"putcon %0, " __SR "\n\t"
|
|
||||||
: "=&r" (__dummy)
|
|
||||||
: "r" (SR_FD));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void enable_fpu(void)
|
|
||||||
{
|
|
||||||
unsigned long long __dummy;
|
|
||||||
|
|
||||||
/* Clear out FD flag in SR */
|
|
||||||
__asm__ __volatile__("getcon " __SR ", %0\n\t"
|
|
||||||
"and %0, %1, %0\n\t"
|
|
||||||
"putcon %0, " __SR "\n\t"
|
|
||||||
: "=&r" (__dummy)
|
|
||||||
: "r" (~SR_FD));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Round to nearest, no exceptions on inexact, overflow, underflow,
|
|
||||||
zero-divide, invalid. Configure option for whether to flush denorms to
|
|
||||||
zero, or except if a denorm is encountered. */
|
|
||||||
#if defined(CONFIG_SH64_FPU_DENORM_FLUSH)
|
|
||||||
#define FPSCR_INIT 0x00040000
|
|
||||||
#else
|
|
||||||
#define FPSCR_INIT 0x00000000
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CONFIG_SH_FPU
|
|
||||||
/* Initialise the FP state of a task */
|
|
||||||
void fpinit(struct sh_fpu_hard_struct *fpregs);
|
|
||||||
#else
|
|
||||||
#define fpinit(fpregs) do { } while (0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern struct task_struct *last_task_used_math;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Return saved PC of a blocked thread.
|
|
||||||
*/
|
|
||||||
#define thread_saved_pc(tsk) (tsk->thread.pc)
|
|
||||||
|
|
||||||
extern unsigned long get_wchan(struct task_struct *p);
|
|
||||||
|
|
||||||
#define KSTK_EIP(tsk) ((tsk)->thread.pc)
|
|
||||||
#define KSTK_ESP(tsk) ((tsk)->thread.sp)
|
|
||||||
|
|
||||||
#endif /* __ASSEMBLY__ */
|
|
||||||
#endif /* __ASM_SH_PROCESSOR_64_H */
|
|
@@ -1,14 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0 */
|
|
||||||
#ifndef __ASM_SH_PTRACE_64_H
|
|
||||||
#define __ASM_SH_PTRACE_64_H
|
|
||||||
|
|
||||||
#include <uapi/asm/ptrace_64.h>
|
|
||||||
|
|
||||||
|
|
||||||
#define MAX_REG_OFFSET offsetof(struct pt_regs, tregs[7])
|
|
||||||
static inline long regs_return_value(struct pt_regs *regs)
|
|
||||||
{
|
|
||||||
return regs->regs[3];
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* __ASM_SH_PTRACE_64_H */
|
|
@@ -1,6 +1,2 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0 */
|
/* SPDX-License-Identifier: GPL-2.0 */
|
||||||
#ifdef CONFIG_SUPERH32
|
#include <asm/string_32.h>
|
||||||
# include <asm/string_32.h>
|
|
||||||
#else
|
|
||||||
# include <asm/string_64.h>
|
|
||||||
#endif
|
|
||||||
|
@@ -1,21 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0 */
|
|
||||||
#ifndef __ASM_SH_STRING_64_H
|
|
||||||
#define __ASM_SH_STRING_64_H
|
|
||||||
|
|
||||||
#ifdef __KERNEL__
|
|
||||||
|
|
||||||
#define __HAVE_ARCH_MEMSET
|
|
||||||
extern void *memset(void *__s, int __c, size_t __count);
|
|
||||||
|
|
||||||
#define __HAVE_ARCH_MEMCPY
|
|
||||||
extern void *memcpy(void *dest, const void *src, size_t count);
|
|
||||||
|
|
||||||
#define __HAVE_ARCH_STRLEN
|
|
||||||
extern size_t strlen(const char *);
|
|
||||||
|
|
||||||
#define __HAVE_ARCH_STRCPY
|
|
||||||
extern char *strcpy(char *__dest, const char *__src);
|
|
||||||
|
|
||||||
#endif /* __KERNEL__ */
|
|
||||||
|
|
||||||
#endif /* __ASM_SH_STRING_64_H */
|
|
@@ -4,13 +4,4 @@
|
|||||||
* Copyright (C) 2003 Paul Mundt
|
* Copyright (C) 2003 Paul Mundt
|
||||||
* Copyright (C) 2004 Richard Curnow
|
* Copyright (C) 2004 Richard Curnow
|
||||||
*/
|
*/
|
||||||
#ifndef __ASM_SH_SWITCH_TO_H
|
#include <asm/switch_to_32.h>
|
||||||
#define __ASM_SH_SWITCH_TO_H
|
|
||||||
|
|
||||||
#ifdef CONFIG_SUPERH32
|
|
||||||
# include <asm/switch_to_32.h>
|
|
||||||
#else
|
|
||||||
# include <asm/switch_to_64.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* __ASM_SH_SWITCH_TO_H */
|
|
||||||
|
@@ -1,32 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0
|
|
||||||
*
|
|
||||||
* Copyright (C) 2000, 2001 Paolo Alberelli
|
|
||||||
* Copyright (C) 2003 Paul Mundt
|
|
||||||
* Copyright (C) 2004 Richard Curnow
|
|
||||||
*/
|
|
||||||
#ifndef __ASM_SH_SWITCH_TO_64_H
|
|
||||||
#define __ASM_SH_SWITCH_TO_64_H
|
|
||||||
|
|
||||||
struct thread_struct;
|
|
||||||
struct task_struct;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* switch_to() should switch tasks to task nr n, first
|
|
||||||
*/
|
|
||||||
struct task_struct *sh64_switch_to(struct task_struct *prev,
|
|
||||||
struct thread_struct *prev_thread,
|
|
||||||
struct task_struct *next,
|
|
||||||
struct thread_struct *next_thread);
|
|
||||||
|
|
||||||
#define switch_to(prev,next,last) \
|
|
||||||
do { \
|
|
||||||
if (last_task_used_math != next) { \
|
|
||||||
struct pt_regs *regs = next->thread.uregs; \
|
|
||||||
if (regs) regs->sr |= SR_FD; \
|
|
||||||
} \
|
|
||||||
last = sh64_switch_to(prev, &prev->thread, next, \
|
|
||||||
&next->thread); \
|
|
||||||
} while (0)
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* __ASM_SH_SWITCH_TO_64_H */
|
|
@@ -4,10 +4,6 @@
|
|||||||
|
|
||||||
extern const unsigned long sys_call_table[];
|
extern const unsigned long sys_call_table[];
|
||||||
|
|
||||||
#ifdef CONFIG_SUPERH32
|
#include <asm/syscall_32.h>
|
||||||
# include <asm/syscall_32.h>
|
|
||||||
#else
|
|
||||||
# include <asm/syscall_64.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* __ASM_SH_SYSCALL_H */
|
#endif /* __ASM_SH_SYSCALL_H */
|
||||||
|
@@ -1,75 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0 */
|
|
||||||
#ifndef __ASM_SH_SYSCALL_64_H
|
|
||||||
#define __ASM_SH_SYSCALL_64_H
|
|
||||||
|
|
||||||
#include <uapi/linux/audit.h>
|
|
||||||
#include <linux/kernel.h>
|
|
||||||
#include <linux/sched.h>
|
|
||||||
#include <asm/ptrace.h>
|
|
||||||
|
|
||||||
/* The system call number is given by the user in R9 */
|
|
||||||
static inline long syscall_get_nr(struct task_struct *task,
|
|
||||||
struct pt_regs *regs)
|
|
||||||
{
|
|
||||||
return (regs->syscall_nr >= 0) ? regs->regs[9] : -1L;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void syscall_rollback(struct task_struct *task,
|
|
||||||
struct pt_regs *regs)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* XXX: This needs some thought. On SH we don't
|
|
||||||
* save away the original R9 value anywhere.
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline long syscall_get_error(struct task_struct *task,
|
|
||||||
struct pt_regs *regs)
|
|
||||||
{
|
|
||||||
return IS_ERR_VALUE(regs->regs[9]) ? regs->regs[9] : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline long syscall_get_return_value(struct task_struct *task,
|
|
||||||
struct pt_regs *regs)
|
|
||||||
{
|
|
||||||
return regs->regs[9];
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void syscall_set_return_value(struct task_struct *task,
|
|
||||||
struct pt_regs *regs,
|
|
||||||
int error, long val)
|
|
||||||
{
|
|
||||||
if (error)
|
|
||||||
regs->regs[9] = -error;
|
|
||||||
else
|
|
||||||
regs->regs[9] = val;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void syscall_get_arguments(struct task_struct *task,
|
|
||||||
struct pt_regs *regs,
|
|
||||||
unsigned long *args)
|
|
||||||
{
|
|
||||||
memcpy(args, ®s->regs[2], 6 * sizeof(args[0]));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void syscall_set_arguments(struct task_struct *task,
|
|
||||||
struct pt_regs *regs,
|
|
||||||
const unsigned long *args)
|
|
||||||
{
|
|
||||||
memcpy(®s->regs[2], args, 6 * sizeof(args[0]));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline int syscall_get_arch(struct task_struct *task)
|
|
||||||
{
|
|
||||||
int arch = AUDIT_ARCH_SH;
|
|
||||||
|
|
||||||
#ifdef CONFIG_64BIT
|
|
||||||
arch |= __AUDIT_ARCH_64BIT;
|
|
||||||
#endif
|
|
||||||
#ifdef CONFIG_CPU_LITTLE_ENDIAN
|
|
||||||
arch |= __AUDIT_ARCH_LE;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return arch;
|
|
||||||
}
|
|
||||||
#endif /* __ASM_SH_SYSCALL_64_H */
|
|
@@ -2,8 +2,6 @@
|
|||||||
#ifndef __ASM_SH_SYSCALLS_H
|
#ifndef __ASM_SH_SYSCALLS_H
|
||||||
#define __ASM_SH_SYSCALLS_H
|
#define __ASM_SH_SYSCALLS_H
|
||||||
|
|
||||||
#ifdef __KERNEL__
|
|
||||||
|
|
||||||
asmlinkage int old_mmap(unsigned long addr, unsigned long len,
|
asmlinkage int old_mmap(unsigned long addr, unsigned long len,
|
||||||
unsigned long prot, unsigned long flags,
|
unsigned long prot, unsigned long flags,
|
||||||
int fd, unsigned long off);
|
int fd, unsigned long off);
|
||||||
@@ -11,11 +9,6 @@ asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
|
|||||||
unsigned long prot, unsigned long flags,
|
unsigned long prot, unsigned long flags,
|
||||||
unsigned long fd, unsigned long pgoff);
|
unsigned long fd, unsigned long pgoff);
|
||||||
|
|
||||||
#ifdef CONFIG_SUPERH32
|
#include <asm/syscalls_32.h>
|
||||||
# include <asm/syscalls_32.h>
|
|
||||||
#else
|
|
||||||
# include <asm/syscalls_64.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* __KERNEL__ */
|
|
||||||
#endif /* __ASM_SH_SYSCALLS_H */
|
#endif /* __ASM_SH_SYSCALLS_H */
|
||||||
|
@@ -1,18 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0 */
|
|
||||||
#ifndef __ASM_SH_SYSCALLS_64_H
|
|
||||||
#define __ASM_SH_SYSCALLS_64_H
|
|
||||||
|
|
||||||
#ifdef __KERNEL__
|
|
||||||
|
|
||||||
#include <linux/compiler.h>
|
|
||||||
#include <linux/linkage.h>
|
|
||||||
#include <linux/types.h>
|
|
||||||
|
|
||||||
struct pt_regs;
|
|
||||||
|
|
||||||
/* Misc syscall related bits */
|
|
||||||
asmlinkage long long do_syscall_trace_enter(struct pt_regs *regs);
|
|
||||||
asmlinkage void do_syscall_trace_leave(struct pt_regs *regs);
|
|
||||||
|
|
||||||
#endif /* __KERNEL__ */
|
|
||||||
#endif /* __ASM_SH_SYSCALLS_64_H */
|
|
@@ -70,9 +70,7 @@ register unsigned long current_stack_pointer asm("r15") __used;
|
|||||||
static inline struct thread_info *current_thread_info(void)
|
static inline struct thread_info *current_thread_info(void)
|
||||||
{
|
{
|
||||||
struct thread_info *ti;
|
struct thread_info *ti;
|
||||||
#if defined(CONFIG_SUPERH64)
|
#if defined(CONFIG_CPU_HAS_SR_RB)
|
||||||
__asm__ __volatile__ ("getcon cr17, %0" : "=r" (ti));
|
|
||||||
#elif defined(CONFIG_CPU_HAS_SR_RB)
|
|
||||||
__asm__ __volatile__ ("stc r7_bank, %0" : "=r" (ti));
|
__asm__ __volatile__ ("stc r7_bank, %0" : "=r" (ti));
|
||||||
#else
|
#else
|
||||||
unsigned long __dummy;
|
unsigned long __dummy;
|
||||||
|
@@ -2,10 +2,6 @@
|
|||||||
#ifndef __ASM_SH_TLB_H
|
#ifndef __ASM_SH_TLB_H
|
||||||
#define __ASM_SH_TLB_H
|
#define __ASM_SH_TLB_H
|
||||||
|
|
||||||
#ifdef CONFIG_SUPERH64
|
|
||||||
# include <asm/tlb_64.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
#include <linux/pagemap.h>
|
#include <linux/pagemap.h>
|
||||||
|
|
||||||
@@ -14,7 +10,7 @@
|
|||||||
|
|
||||||
#include <asm-generic/tlb.h>
|
#include <asm-generic/tlb.h>
|
||||||
|
|
||||||
#if defined(CONFIG_CPU_SH4) || defined(CONFIG_SUPERH64)
|
#if defined(CONFIG_CPU_SH4)
|
||||||
extern void tlb_wire_entry(struct vm_area_struct *, unsigned long, pte_t);
|
extern void tlb_wire_entry(struct vm_area_struct *, unsigned long, pte_t);
|
||||||
extern void tlb_unwire_entry(void);
|
extern void tlb_unwire_entry(void);
|
||||||
#else
|
#else
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user