11 Apr, 2020

1 commit


25 Mar, 2020

1 commit


10 Mar, 2020

1 commit


27 Nov, 2019

1 commit

  • XIP (eXecute In Place) kernel image is the image that can be run
    directly from ROM, using RAM only for writable data.

    XIP xtensa kernel differs from regular xtensa kernel in the following
    ways:
    - it has exception/IRQ vectors merged into text section. No vectors
    relocation takes place at kernel startup.
    - .data/.bss location must be specified in the kernel configuration,
    its content is copied there in the _startup function.
    - .init.text is merged with the rest of text and is executed from ROM.
    - when MMU is used the virtual address where the kernel will be mapped
    must be specified in the kernel configuration. It may be in the KSEG
    or in the KIO, __pa macro is adjusted to be able to handle both.

    Signed-off-by: Max Filippov

    Max Filippov
     

16 Oct, 2019

1 commit

  • virt device tree incorrectly uses 0xf0000000 on both sides of PCI IO
    ports address space mapping. This results in incorrect port address
    assignment in PCI IO BARs and subsequent crash on attempt to access
    them. Use 0 as base address in PCI IO ports address space.

    Signed-off-by: Max Filippov

    Max Filippov
     

02 Sep, 2019

1 commit

  • Move PCI configuration space, MMIO and memory to the KIO range to free
    vmalloc area and use static TLB to access them. Move MMIO to the
    beginning of KIO and define PCI_IOBASE as XCHAL_KIO_BYPASS_VADDR to
    match it. Reduce number of supported PCI buses to 0x3f so that ECAM
    window fits into first 64MB of the KIO. Reduce size of the PCI memory
    window to 128MB so that it fits into KIO.

    Signed-off-by: Max Filippov

    Max Filippov
     

17 Jul, 2019

1 commit

  • Pull Xtensa updates from Max Filippov:

    - clean up PCI support code

    - add defconfig and DTS for the 'virt' board

    - abstract 'entry' and 'retw' uses in xtensa assembly in preparation
    for XEA3/NX pipeline support

    - random small cleanups

    * tag 'xtensa-20190715' of git://github.com/jcmvbkbc/linux-xtensa:
    xtensa: virt: add defconfig and DTS
    xtensa: abstract 'entry' and 'retw' in assembly code
    xtensa: One function call less in bootmem_init()
    xtensa: remove arch/xtensa/include/asm/types.h
    xtensa: use generic pcibios_set_master and pcibios_enable_device
    xtensa: drop dead PCI support code
    xtensa/PCI: Remove unused variable

    Linus Torvalds
     

09 Jul, 2019

1 commit

  • Add defconfig and DTS for a virt board. Defconfig enables PCIe host and
    a number of virtio devices. DTS routes legacy PCI IRQs to the first four
    level-triggered external IRQ lines. CPU core with edge-triggered IRQs
    among the first four may need a custom DTS to work correctly.

    Signed-off-by: Max Filippov

    Max Filippov
     

19 Jun, 2019

1 commit

  • Based on 2 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation #

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 4122 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Enrico Weigelt
    Reviewed-by: Kate Stewart
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

18 May, 2019

1 commit

  • Currently, the Kbuild core manipulates header search paths in a crazy
    way [1].

    To fix this mess, I want all Makefiles to add explicit $(srctree)/ to
    the search paths in the srctree. Some Makefiles are already written in
    that way, but not all. The goal of this work is to make the notation
    consistent, and finally get rid of the gross hacks.

    Having whitespaces after -I does not matter since commit 48f6e3cf5bc6
    ("kbuild: do not drop -I without parameter").

    [1]: https://patchwork.kernel.org/patch/9632347/

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

07 May, 2019

1 commit


26 Jan, 2019

1 commit

  • When building some xtensa config, I hit the following warning:
    drivers/staging/mt7621-dts/Kconfig:4:warning: 'BUILTIN_DTB' has wrong type.
    'select' only accept arguments of bool and tristate type

    It is due to some arch use BUILTIN_DTB as a flag for the need to builtin
    dtb but xtensa use it as a string for which dtb to bulltin.
    But for this (which dtb to build), it is better to use
    BUILTIN_DTB_SOURCE like other arch do.

    Signed-off-by: Corentin Labbe
    Signed-off-by: Max Filippov

    Corentin Labbe
     

06 Dec, 2018

1 commit

  • xtensa assembler is capable of representing register loads with either
    movi + addmi, l32r or const16, depending on the core configuration.
    Don't use '.literal' and 'l32r' directly in the code, use 'movi' and let
    the assembler relax them.

    Signed-off-by: Max Filippov

    Max Filippov
     

05 Dec, 2018

1 commit

  • Rename SPI controller node in the XTFPGA DTS to spi@...
    This fixes the following build warnings:

    arch/xtensa/boot/dts/kc705_nommu.dtb: Warning (spi_bus_bridge):
    /soc/spi-master@0d0a0000: node name for SPI buses should be 'spi'
    arch/xtensa/boot/dts/kc705_nommu.dtb: Warning (spi_bus_reg):
    Failed prerequisite 'spi_bus_bridge'
    arch/xtensa/boot/dts/lx200mx.dtb: Warning (spi_bus_bridge):
    /soc/spi-master@0d0a0000: node name for SPI buses should be 'spi'
    arch/xtensa/boot/dts/lx200mx.dtb: Warning (spi_bus_reg):
    Failed prerequisite 'spi_bus_bridge'
    arch/xtensa/boot/dts/kc705.dtb: Warning (spi_bus_bridge):
    /soc/spi-master@0d0a0000: node name for SPI buses should be 'spi'
    arch/xtensa/boot/dts/kc705.dtb: Warning (spi_bus_reg):
    Failed prerequisite 'spi_bus_bridge'
    arch/xtensa/boot/dts/ml605.dtb: Warning (spi_bus_bridge):
    /soc/spi-master@0d0a0000: node name for SPI buses should be 'spi'
    arch/xtensa/boot/dts/ml605.dtb: Warning (spi_bus_reg):
    Failed prerequisite 'spi_bus_bridge'
    arch/xtensa/boot/dts/lx60.dtb: Warning (spi_bus_bridge):
    /soc/spi-master@0d0a0000: node name for SPI buses should be 'spi'
    arch/xtensa/boot/dts/lx60.dtb: Warning (spi_bus_reg):
    Failed prerequisite 'spi_bus_bridge'

    Signed-off-by: Max Filippov

    Max Filippov
     

30 Oct, 2018

1 commit

  • This section collects all source .note.* sections together in the
    vmlinux image. Without it .note.Linux section may be placed at address
    0, while the rest of the kernel is at its normal address, resulting in a
    huge vmlinux.bin image that may not be linked into the xtensa Image.elf.

    Cc: stable@vger.kernel.org
    Signed-off-by: Max Filippov

    Max Filippov
     

26 Aug, 2018

1 commit

  • Pull more Kbuild updates from Masahiro Yamada:

    - add build_{menu,n,g,x}config targets for compile-testing Kconfig

    - fix and improve recursive dependency detection in Kconfig

    - fix parallel building of menuconfig/nconfig

    - fix syntax error in clang-version.sh

    - suppress distracting log from syncconfig

    - remove obsolete "rpm" target

    - remove VMLINUX_SYMBOL(_STR) macro entirely

    - fix microblaze build with CONFIG_DYNAMIC_FTRACE

    - move compiler test for dead code/data elimination to Kconfig

    - rename well-known LDFLAGS variable to KBUILD_LDFLAGS

    - misc fixes and cleanups

    * tag 'kbuild-v4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
    kbuild: rename LDFLAGS to KBUILD_LDFLAGS
    kbuild: pass LDFLAGS to recordmcount.pl
    kbuild: test dead code/data elimination support in Kconfig
    initramfs: move gen_initramfs_list.sh from scripts/ to usr/
    vmlinux.lds.h: remove stale include
    export.h: remove VMLINUX_SYMBOL() and VMLINUX_SYMBOL_STR()
    Coccinelle: remove pci_alloc_consistent semantic to detect in zalloc-simple.cocci
    kbuild: make sorting initramfs contents independent of locale
    kbuild: remove "rpm" target, which is alias of "rpm-pkg"
    kbuild: Fix LOADLIBES rename in Documentation/kbuild/makefiles.txt
    kconfig: suppress "configuration written to .config" for syncconfig
    kconfig: fix "Can't open ..." in parallel build
    kbuild: Add a space after `!` to prevent parsing as file pattern
    scripts: modpost: check memory allocation results
    kconfig: improve the recursive dependency report
    kconfig: report recursive dependency involving 'imply'
    kconfig: error out when seeing recursive dependency
    kconfig: add build-only configurator targets
    scripts/dtc: consolidate include path options in Makefile

    Linus Torvalds
     

24 Aug, 2018

1 commit

  • Commit a0f97e06a43c ("kbuild: enable 'make CFLAGS=...' to add
    additional options to CC") renamed CFLAGS to KBUILD_CFLAGS.

    Commit 222d394d30e7 ("kbuild: enable 'make AFLAGS=...' to add
    additional options to AS") renamed AFLAGS to KBUILD_AFLAGS.

    Commit 06c5040cdb13 ("kbuild: enable 'make CPPFLAGS=...' to add
    additional options to CPP") renamed CPPFLAGS to KBUILD_CPPFLAGS.

    For some reason, LDFLAGS was not renamed.

    Using a well-known variable like LDFLAGS may result in accidental
    override of the variable.

    Kbuild generally uses KBUILD_ prefixed variables for the internally
    appended options, so here is one more conversion to sanitize the
    naming convention.

    I did not touch Makefiles under tools/ since the tools build system
    is a different world.

    Signed-off-by: Masahiro Yamada
    Acked-by: Kirill A. Shutemov
    Reviewed-by: Palmer Dabbelt

    Masahiro Yamada
     

23 Aug, 2018

1 commit

  • Pull Xtensa updates from Max Filippov:

    - switch xtensa arch to the generic noncoherent direct mapping
    operations

    - add support for DMA_ATTR_NO_KERNEL_MAPPING attribute

    - clean up users of platform/hardware.h in generic Xtensa code

    - fix assembly cache maintenance code for long cache lines

    - rework noMMU cache attributes initialization

    - add big-endian HiFi2 test_kc705_be CPU variant

    * tag 'xtensa-20180820' of git://github.com/jcmvbkbc/linux-xtensa:
    xtensa: add test_kc705_be variant
    xtensa: clean up boot-elf/bootstrap.S
    xtensa: make bootparam parsing optional
    xtensa: drop variant IRQ support
    xtensa: drop unneeded platform/hardware.h headers
    xtensa: move PLATFORM_NR_IRQS to Kconfig
    xtensa: rework {CONFIG,PLATFORM}_DEFAULT_MEM_START
    xtensa: drop unused {CONFIG,PLATFORM}_DEFAULT_MEM_SIZE
    xtensa: rework noMMU cache attributes initialization
    xtensa: increase ranges in ___invalidate_{i,d}cache_all
    xtensa: limit offsets in __loop_cache_{all,page}
    xtensa: platform-specific handling of coherent memory
    xtensa: support DMA_ATTR_NO_KERNEL_MAPPING attribute
    xtensa: use generic dma_noncoherent_ops

    Linus Torvalds
     

21 Aug, 2018

2 commits


09 Aug, 2018

1 commit

  • The host-progs has been kept as an alias of hostprogs-y for a long time
    (at least since the beginning of Git era), with the clear prompt:
    Usage of host-progs is deprecated. Please replace with hostprogs-y!

    Enough time for the migration has passed.

    Signed-off-by: Masahiro Yamada
    Acked-by: Max Filippov

    Masahiro Yamada
     

30 Jan, 2018

1 commit

  • Pull Xtensa updates from Max Filippov:

    - add SSP support

    - add KASAN support

    - improvements to xtensa-specific assembly:
    - use ENTRY and ENDPROC consistently
    - clean up and unify word alignment macros
    - clean up and unify fixup marking
    - use 'call' instead of 'callx' where possible

    - various cleanups:
    - consiolidate kernel stack size related definitions
    - replace #ifdef'fed/commented out debug printk statements with
    pr_debug
    - use struct exc_table instead of flat array for exception handling
    data

    - build kernel with -mtext-section-literals; simplify xtensa linker
    script

    - fix futex_atomic_cmpxchg_inatomic()

    * tag 'xtensa-20180129' of git://github.com/jcmvbkbc/linux-xtensa: (21 commits)
    xtensa: fix futex_atomic_cmpxchg_inatomic
    xtensa: shut up gcc-8 warnings
    xtensa: print kernel sections info in mem_init
    xtensa: use generic strncpy_from_user with KASAN
    xtensa: use __memset in __xtensa_clear_user
    xtensa: add support for KASAN
    xtensa: move fixmap and kmap just above the KSEG
    xtensa: don't clear swapper_pg_dir in paging_init
    xtensa: extract init_kio
    xtensa: implement early_trap_init
    xtensa: clean up exception handling structure
    xtensa: clean up custom-controlled debug output
    xtensa: enable stack protector
    xtensa: print hardware config ID on startup
    xtensa: consolidate kernel stack size related definitions
    xtensa: clean up functions in assembly code
    xtensa: clean up word alignment macros in assembly code
    xtensa: clean up fixups in assembly code
    xtensa: use call instead of callx in assembly code
    xtensa: build kernel with text-section-literals
    ...

    Linus Torvalds
     

17 Dec, 2017

2 commits

  • Cover kernel addresses above 0x90000000 by the shadow map. Enable
    HAVE_ARCH_KASAN when MMU is enabled. Provide kasan_early_init that fills
    shadow map with writable copies of kasan_zero_page. Call
    kasan_early_init right after mmu initialization in the setup_arch.
    Provide kasan_init that allocates proper shadow map pages from the
    memblock and puts these pages into the shadow map for addresses from
    VMALLOC area to the end of KSEG. Call kasan_init right after memblock
    initialization. Don't use KASAN for the boot code, MMU and KASAN
    initialization and page fault handler. Make kernel stack size 4 times
    larger when KASAN is enabled to avoid stack overflows.
    GCC 7.3, 8 or newer is required to build the xtensa kernel with KASAN.

    Signed-off-by: Max Filippov

    Max Filippov
     
  • The implementation is adopted from the ARM arch. GCC 7.3, 8 or newer is
    required for building the xtensa kernel with SSP.

    Signed-off-by: Max Filippov

    Max Filippov
     

11 Dec, 2017

1 commit

  • vmlinux.lds.S doesn't do anything special with literals, so instead of
    keeping them separate put them into the corresponding text sections.
    Drop explicit .literal sections from the vmlinux.lds.S, use standard
    section macros. Mark literal pool locations in the assembly sources.
    Unfortunately assembler doesn't put literals into .init sections and
    external libgcc may still have .literal sections, so sed transformation
    to the linker script is still needed.

    Signed-off-by: Max Filippov

    Max Filippov
     

15 Nov, 2017

1 commit

  • Pull DeviceTree updates from Rob Herring:
    "A bigger diffstat than usual with the kbuild changes and a tree wide
    fix in the binding documentation.

    Summary:

    - kbuild cleanups and improvements for dtbs

    - Code clean-up of overlay code and fixing for some long standing
    memory leak and race condition in applying overlays

    - Improvements to DT memory usage making sysfs/kobjects optional and
    skipping unflattening of disabled nodes. This is part of kernel
    tinification efforts.

    - Final piece of removing storing the full path for every DT node.
    The prerequisite conversion of printk's to use device_node format
    specifier happened in 4.14.

    - Sync with current upstream dtc. This brings additional checks to
    dtb compiling.

    - Binding doc tree wide removal of leading 0s from examples

    - RTC binding documentation adding missing devices and some
    consolidation of duplicated bindings

    - Vendor prefix documentation for nutsboard, Silicon Storage
    Technology, shimafuji, Tecon Microprocessor Technologies, DH
    electronics GmbH, Opal Kelly, and Next Thing"

    * tag 'devicetree-for-4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (55 commits)
    dt-bindings: usb: add #phy-cells to usb-nop-xceiv
    dt-bindings: Remove leading zeros from bindings notation
    kbuild: handle dtb-y and CONFIG_OF_ALL_DTBS natively in Makefile.lib
    MIPS: dts: remove bogus bcm96358nb4ser.dtb from dtb-y entry
    kbuild: clean up *.dtb and *.dtb.S patterns from top-level Makefile
    .gitignore: move *.dtb and *.dtb.S patterns to the top-level .gitignore
    .gitignore: sort normal pattern rules alphabetically
    dt-bindings: add vendor prefix for Next Thing Co.
    scripts/dtc: Update to upstream version v1.4.5-6-gc1e55a5513e9
    of: dynamic: fix memory leak related to properties of __of_node_dup
    of: overlay: make pr_err() string unique
    of: overlay: pr_err from return NOTIFY_OK to overlay apply/remove
    of: overlay: remove unneeded check for NULL kbasename()
    of: overlay: remove a dependency on device node full_name
    of: overlay: simplify applying symbols from an overlay
    of: overlay: avoid race condition between applying multiple overlays
    of: overlay: loosen overly strict phandle clash check
    of: overlay: expand check of whether overlay changeset can be removed
    of: overlay: detect cases where device tree may become corrupt
    of: overlay: minor restructuring
    ...

    Linus Torvalds
     

10 Nov, 2017

1 commit

  • If CONFIG_OF_ALL_DTBS is enabled, "make ARCH=arm64 dtbs" compiles each
    DTB twice; one from arch/arm64/boot/dts/*/Makefile and the other from
    the dtb-$(CONFIG_OF_ALL_DTBS) line in arch/arm64/boot/dts/Makefile.
    It could be a race problem when building DTBS in parallel.

    Another minor issue is CONFIG_OF_ALL_DTBS covers only *.dts in vendor
    sub-directories, so this broke when Broadcom added one more hierarchy
    in arch/arm64/boot/dts/broadcom//.

    One idea to fix the issues in a clean way is to move DTB handling
    to Kbuild core scripts. Makefile.dtbinst already recognizes dtb-y
    natively, so it should not hurt to do so.

    Add $(dtb-y) to extra-y, and $(dtb-) as well if CONFIG_OF_ALL_DTBS is
    enabled. All clutter things in Makefiles go away.

    As a bonus clean-up, I also removed dts-dirs. Just use subdir-y
    directly to traverse sub-directories.

    Signed-off-by: Masahiro Yamada
    Acked-by: Arnd Bergmann
    [robh: corrected BUILTIN_DTB to CONFIG_BUILTIN_DTB]
    Signed-off-by: Rob Herring

    Masahiro Yamada
     

09 Nov, 2017

2 commits


02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

04 Mar, 2017

1 commit

  • Pull Xtensa updates from Max Filippov:

    - clean up bootable image build targets: provide separate 'Image',
    'zImage' and 'uImage' make targets that only build corresponding
    image type. Make 'all' build all images appropriate for a platform

    - allow merging vectors code into .text section as a preparation step
    for XIP support

    - fix handling external FDT when the kernel is built without
    BLK_DEV_INITRD support

    * tag 'xtensa-20170303' of git://github.com/jcmvbkbc/linux-xtensa:
    xtensa: allow merging vectors into .text section
    xtensa: clean up bootable image build targets
    xtensa: move parse_tag_fdt out of #ifdef CONFIG_BLK_DEV_INITRD

    Linus Torvalds
     

02 Mar, 2017

1 commit

  • Currently xtensa uses 'zImage' as a synonym of 'all', but in fact xtensa
    supports three targets: 'Image' (ELF image with reset vector), 'zImage'
    (compressed redboot image) and 'uImage' (U-Boot image).
    Provide separate 'Image', 'zImage' and 'uImage' make targets that only
    build corresponding image type. Make 'all' build all images appropriate
    for a platform.

    Signed-off-by: Max Filippov

    Max Filippov
     

16 Dec, 2016

1 commit


21 Sep, 2016

2 commits

  • DT-enabled kernel should have a CPU node connected to a clock. This clock
    is the CCOUNT clock. Use old platform_calibrate_ccount call as a fallback
    when CPU node cannot be found or has no clock and in non-DT-enabled
    configurations.

    Drop no longer needed code that updates CPU clock-frequency property in
    the DT; drop DT-related code from the platform_calibrate_ccount too.

    Move of_clk_init to the top of time_init, so that clocks are initialized
    before CCOUNT calibration is attempted.

    Signed-off-by: Max Filippov

    Max Filippov
     
  • Instead of querying hardcoded FPGA frequency register and then updating
    clock-frequency property in specificly named DT nodes in machine setup
    code register a clock provider that returns fixed-rate clock, configured
    by register specified in DT. This way we have less magic/hardcoded names
    and use more existing common clock framework code.

    Signed-off-by: Max Filippov
    Tested-by: Guenter Roeck

    Max Filippov
     

20 Sep, 2016

1 commit


10 Sep, 2016

1 commit


24 Jul, 2016

1 commit

  • Make kernel load address explicit, independent of the selected MMU
    configuration and configurable from Kconfig. Do not restrict it to the
    first 512MB of the physical address space.

    Cleanup kernel memory layout macros:

    - rename VECBASE_RESET_VADDR to VECBASE_VADDR, XC_VADDR to VECTOR_VADDR;
    - drop VIRTUAL_MEMORY_ADDRESS and LOAD_MEMORY_ADDRESS;
    - introduce PHYS_OFFSET and use it in __va and __pa definitions;
    - synchronize MMU/noMMU vectors, drop unused NMI vector;
    - replace hardcoded vectors offset of 0x3000 with Kconfig symbol.

    Signed-off-by: Max Filippov

    Max Filippov
     

11 Mar, 2016

2 commits