From: Linus Torvalds Date: Thu, 1 Feb 2018 18:57:45 +0000 (-0800) Subject: Merge tag 'devicetree-for-4.16' of git://git.kernel.org/pub/scm/linux/kernel/git... X-Git-Tag: v4.16-rc1~108 X-Git-Url: https://repo.jachan.dev/linux.git/commitdiff_plain/2bed26606b61a7b20fc1cc54df53c48c06cd9aa8?hp=-c Merge tag 'devicetree-for-4.16' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull DeviceTree updates from Rob Herring: - Convert to use memblock_virt_alloc in DT code which supports bootmem arches. With this we can remove the arch specific early_init_dt_alloc_memory_arch() functions. - Enable running the DT unittests on UML - Use SPDX license tags on DT files - Fix early FDT kconfig ifdef logic - Clean-up unittest Makefile - Fix function comment for of_irq_parse_raw - Add missing documentation for linux,initrd-{start,end} properties - Clean-up of binding examples using uppercase hex - Add trivial devices W83773G and Infineon TLV493D-A1B6 - Add missing STM32 SoC bindings - Various small binding doc fixes * tag 'devicetree-for-4.16' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (23 commits) xtensa: remove arch specific early DT functions x86: remove arch specific early_init_dt_alloc_memory_arch nios2: remove arch specific early_init_dt_alloc_memory_arch mips: remove arch specific early_init_dt_alloc_memory_arch metag: remove arch specific early DT functions cris: remove arch specific early DT functions libfdt: remove unnecessary include directive from of: unittest: refactor Makefile of/fdt: use memblock_virt_alloc for early alloc of: Use SPDX license tag for DT files of/fdt: Fix #ifdef dependency of early flattree declarations dt-bindings: h8300 clocksource: correct spelling of pulse dt-bindings: imx6q-pcie: Add required property for i.MX6SX mmc: Don't reference Linux-specific OF_GPIO_ACTIVE_LOW flag in DT binding dt-bindings: Use lower case hex in unit-addresses dt-bindings: display: panel: Fix compatible string for Toshiba LT089AC29000 dt-bindings: Add Infineon TLV493D-A1B6 dt-bindings: mailbox: ti,message-manager: Fix interrupt name error dt-bindings: chosen: Document linux,initrd-{start,end} dt-bindings: arm: document supported STM32 SoC family ... --- 2bed26606b61a7b20fc1cc54df53c48c06cd9aa8 diff --combined arch/xtensa/kernel/setup.c index a931af9075f2,82bd1a94157c..686a27444bba --- a/arch/xtensa/kernel/setup.c +++ b/arch/xtensa/kernel/setup.c @@@ -20,7 -20,6 +20,6 @@@ #include #include #include - #include #include #include #include @@@ -36,7 -35,6 +35,7 @@@ #endif #include +#include #include #include #include @@@ -157,7 -155,7 +156,7 @@@ static int __init parse_bootparam(cons /* Boot parameters must start with a BP_TAG_FIRST tag. */ if (tag->id != BP_TAG_FIRST) { - printk(KERN_WARNING "Invalid boot parameters!\n"); + pr_warn("Invalid boot parameters!\n"); return 0; } @@@ -166,14 -164,15 +165,14 @@@ /* Parse all tags. */ while (tag != NULL && tag->id != BP_TAG_LAST) { - for (t = &__tagtable_begin; t < &__tagtable_end; t++) { + for (t = &__tagtable_begin; t < &__tagtable_end; t++) { if (tag->id == t->tag) { t->parse(tag); break; } } if (t == &__tagtable_end) - printk(KERN_WARNING "Ignoring tag " - "0x%08x\n", tag->id); + pr_warn("Ignoring tag 0x%08x\n", tag->id); tag = (bp_tag_t*)((unsigned long)(tag + 1) + tag->size); } @@@ -208,8 -207,6 +207,8 @@@ static int __init xtensa_dt_io_area(uns /* round down to nearest 256MB boundary */ xtensa_kio_paddr &= 0xf0000000; + init_kio(); + return 1; } #else @@@ -220,17 -217,6 +219,6 @@@ static int __init xtensa_dt_io_area(uns } #endif - void __init early_init_dt_add_memory_arch(u64 base, u64 size) - { - size &= PAGE_MASK; - memblock_add(base, size); - } - - void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align) - { - return __alloc_bootmem(size, align, 0); - } - void __init early_init_devtree(void *params) { early_init_dt_scan(params); @@@ -248,14 -234,6 +236,14 @@@ void __init init_arch(bp_tag_t *bp_start) { + /* Initialize MMU. */ + + init_mmu(); + + /* Initialize initial KASAN shadow map */ + + kasan_early_init(); + /* Parse boot parameters */ if (bp_start) @@@ -273,6 -251,10 +261,6 @@@ /* Early hook for platforms */ platform_init(bp_start); - - /* Initialize MMU. */ - - init_mmu(); } /* @@@ -283,13 -265,13 +271,13 @@@ extern char _end[] extern char _stext[]; extern char _WindowVectors_text_start; extern char _WindowVectors_text_end; -extern char _DebugInterruptVector_literal_start; +extern char _DebugInterruptVector_text_start; extern char _DebugInterruptVector_text_end; -extern char _KernelExceptionVector_literal_start; +extern char _KernelExceptionVector_text_start; extern char _KernelExceptionVector_text_end; -extern char _UserExceptionVector_literal_start; +extern char _UserExceptionVector_text_start; extern char _UserExceptionVector_text_end; -extern char _DoubleExceptionVector_literal_start; +extern char _DoubleExceptionVector_text_start; extern char _DoubleExceptionVector_text_end; #if XCHAL_EXCM_LEVEL >= 2 extern char _Level2InterruptVector_text_start; @@@ -323,13 -305,6 +311,13 @@@ static inline int mem_reserve(unsigned void __init setup_arch(char **cmdline_p) { + pr_info("config ID: %08x:%08x\n", + get_sr(SREG_EPC), get_sr(SREG_EXCSAVE)); + if (get_sr(SREG_EPC) != XCHAL_HW_CONFIGID0 || + get_sr(SREG_EXCSAVE) != XCHAL_HW_CONFIGID1) + pr_info("built for config ID: %08x:%08x\n", + XCHAL_HW_CONFIGID0, XCHAL_HW_CONFIGID1); + *cmdline_p = command_line; platform_setup(cmdline_p); strlcpy(boot_command_line, *cmdline_p, COMMAND_LINE_SIZE); @@@ -352,16 -327,16 +340,16 @@@ mem_reserve(__pa(&_WindowVectors_text_start), __pa(&_WindowVectors_text_end)); - mem_reserve(__pa(&_DebugInterruptVector_literal_start), + mem_reserve(__pa(&_DebugInterruptVector_text_start), __pa(&_DebugInterruptVector_text_end)); - mem_reserve(__pa(&_KernelExceptionVector_literal_start), + mem_reserve(__pa(&_KernelExceptionVector_text_start), __pa(&_KernelExceptionVector_text_end)); - mem_reserve(__pa(&_UserExceptionVector_literal_start), + mem_reserve(__pa(&_UserExceptionVector_text_start), __pa(&_UserExceptionVector_text_end)); - mem_reserve(__pa(&_DoubleExceptionVector_literal_start), + mem_reserve(__pa(&_DoubleExceptionVector_text_start), __pa(&_DoubleExceptionVector_text_end)); #if XCHAL_EXCM_LEVEL >= 2 @@@ -393,7 -368,7 +381,7 @@@ #endif parse_early_param(); bootmem_init(); - + kasan_init(); unflatten_and_copy_device_tree(); #ifdef CONFIG_SMP @@@ -595,14 -570,12 +583,14 @@@ c_show(struct seq_file *f, void *slot "model\t\t: Xtensa " XCHAL_HW_VERSION_NAME "\n" "core ID\t\t: " XCHAL_CORE_ID "\n" "build ID\t: 0x%x\n" + "config ID\t: %08x:%08x\n" "byte order\t: %s\n" "cpu MHz\t\t: %lu.%02lu\n" "bogomips\t: %lu.%02lu\n", num_online_cpus(), cpumask_pr_args(cpu_online_mask), XCHAL_BUILD_UNIQUE_ID, + get_sr(SREG_EPC), get_sr(SREG_EXCSAVE), XCHAL_HAVE_BE ? "big" : "little", ccount_freq/1000000, (ccount_freq/10000) % 100, diff --combined drivers/of/base.c index a9d6fe86585b,dd0b4201f1cc..ad28de96e13f --- a/drivers/of/base.c +++ b/drivers/of/base.c @@@ -1,3 -1,4 +1,4 @@@ + // SPDX-License-Identifier: GPL-2.0+ /* * Procedures for creating, accessing and interpreting the device tree. * @@@ -11,11 -12,6 +12,6 @@@ * * Reconsolidated from arch/x/kernel/prom.c by Stephen Rothwell and * Grant Likely. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. */ #define pr_fmt(fmt) "OF: " fmt @@@ -315,32 -311,6 +311,32 @@@ struct device_node *of_get_cpu_node(in } EXPORT_SYMBOL(of_get_cpu_node); +/** + * of_cpu_node_to_id: Get the logical CPU number for a given device_node + * + * @cpu_node: Pointer to the device_node for CPU. + * + * Returns the logical CPU number of the given CPU device_node. + * Returns -ENODEV if the CPU is not found. + */ +int of_cpu_node_to_id(struct device_node *cpu_node) +{ + int cpu; + bool found = false; + struct device_node *np; + + for_each_possible_cpu(cpu) { + np = of_cpu_device_node_get(cpu); + found = (cpu_node == np); + of_node_put(np); + if (found) + return cpu; + } + + return -ENODEV; +} +EXPORT_SYMBOL(of_cpu_node_to_id); + /** * __of_device_is_compatible() - Check if the node matches given constraints * @device: pointer to node diff --combined drivers/of/property.c index f25d36358187,2b22560b60c1..36ed84e26d9c --- a/drivers/of/property.c +++ b/drivers/of/property.c @@@ -1,3 -1,4 +1,4 @@@ + // SPDX-License-Identifier: GPL-2.0+ /* * drivers/of/property.c - Procedures for accessing and interpreting * Devicetree properties and graphs. @@@ -16,11 -17,6 +17,6 @@@ * * Reconsolidated from arch/x/kernel/prom.c by Stephen Rothwell and * Grant Likely. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. */ #define pr_fmt(fmt) "OF: " fmt @@@ -981,18 -977,10 +977,18 @@@ static int of_fwnode_graph_parse_endpoi return 0; } +static void * +of_fwnode_device_get_match_data(const struct fwnode_handle *fwnode, + const struct device *dev) +{ + return (void *)of_device_get_match_data(dev); +} + const struct fwnode_operations of_fwnode_ops = { .get = of_fwnode_get, .put = of_fwnode_put, .device_is_available = of_fwnode_device_is_available, + .device_get_match_data = of_fwnode_device_get_match_data, .property_present = of_fwnode_property_present, .property_read_int_array = of_fwnode_property_read_int_array, .property_read_string_array = of_fwnode_property_read_string_array, diff --combined include/linux/of.h index 173102dafb07,d4abee0e8fc4..da1ee95241c1 --- a/include/linux/of.h +++ b/include/linux/of.h @@@ -1,3 -1,4 +1,4 @@@ + /* SPDX-License-Identifier: GPL-2.0+ */ #ifndef _LINUX_OF_H #define _LINUX_OF_H /* @@@ -9,11 -10,6 +10,6 @@@ * Updates for PPC64 by Peter Bergner & David Engebretsen, IBM Corp. * Updates for SPARC64 by David S. Miller * Derived from PowerPC and Sparc prom.h files by Stephen Rothwell, IBM Corp. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. */ #include #include @@@ -544,8 -540,6 +540,8 @@@ const char *of_prop_next_string(struct bool of_console_check(struct device_node *dn, char *name, int index); +extern int of_cpu_node_to_id(struct device_node *np); + #else /* CONFIG_OF */ static inline void of_core_init(void) @@@ -918,11 -912,6 +914,11 @@@ static inline void of_property_clear_fl { } +static inline int of_cpu_node_to_id(struct device_node *np) +{ + return -ENODEV; +} + #define of_match_ptr(_ptr) NULL #define of_match_node(_matches, _node) NULL #endif /* CONFIG_OF */ diff --combined include/linux/of_gpio.h index 18a7f03e1182,f6af4276fd51..163b79ecd01a --- a/include/linux/of_gpio.h +++ b/include/linux/of_gpio.h @@@ -1,14 -1,10 +1,10 @@@ + /* SPDX-License-Identifier: GPL-2.0+ */ /* * OF helpers for the GPIO API * * Copyright (c) 2007-2008 MontaVista Software, Inc. * * Author: Anton Vorontsov - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. */ #ifndef __LINUX_OF_GPIO_H @@@ -31,7 -27,7 +27,7 @@@ enum of_gpio_flags OF_GPIO_ACTIVE_LOW = 0x1, OF_GPIO_SINGLE_ENDED = 0x2, OF_GPIO_OPEN_DRAIN = 0x4, - OF_GPIO_SLEEP_MAY_LOSE_VALUE = 0x8, + OF_GPIO_TRANSITORY = 0x8, }; #ifdef CONFIG_OF_GPIO