Add support for ThunderX 88xx SoC family
Subsystems (2)
v7 cover Add support for ThunderX 88xx SoC family
This patch series adds support for Cavium ThunderX 88xx SoC family
(http://cavium.com/ThunderX_ARM_Processors.html)
This is the version 6 of the series I posted at
http://lists.denx.de/pipermail/u-boot/2015-September/228716.html
http://lists.denx.de/pipermail/u-boot/2015-September/227088.html
http://lists.denx.de/pipermail/u-boot/2015-August/224324.html
http://lists.denx.de/pipermail/u-boot/2015-August/223618.html
Changes in v7:
- Removed stale board.c changes
- Removed rebase/merge residue
- Added CONFIG_CMD_ATF
- Updated defconfig
- Fixed typo in the 'uboot,skip-init' preperty
Changes in v6:
- Fixed lack of protection in global_data.h
- Changed the 'PL0X_PREINITIALIZED' flag to the 'skip-init' bool
- Added /chosen node
- Added 'u-boot,skip-init' property to the FDT
Changes in v5:
- Allow setting of different memory attributes in the memory map
- Added OF control support
- Added FDT for ThunderX 88xx series
- Added CONFIG_OF_CONTROL support
- Changed memory attributes
- Moved dram_init() from a separate file to thunderx.c
Changes in v4:
- Use ALIGN macro for address alignment
- Document FW calls
- Fixed build warnings
- Moved to DM_SERIAL
- Moved CONFIG_SYS_PROMPT to configs/thunderx_88xx_defconfig
- Added proper DM_SERIAL definitions
Changes in v3:
- Reduced code duplication
- Renamed CONFIG_SYS_PTL1_BITS to CONFIG_SYS_PTL2_BITS
- Moved 'reset_sctrl' call to the 'reset' label
- Rebased to the actual upstream tree
- Documented newly added config options
- Fixed clobber lists (thanks to Corey)
- Added __used keyword
- Fixed formatting
- Added MAINTAINERS
- Moved command definitions to defconfig
Changes in v2:
- Changed code licensing
- Completed the patchset
Sergey Temerkhanov (9):
armv8: Add read_mpidr() function
armv8: New MMU setup code allowing to use 48+ bits PA/VA
armv8: Add Secure Monitor/Hypervisor Call (SMC/HVC) infrastructure
armv8: Add psci.h from the Linux kernel
arm: serial: Add ability to use pre-initialized UARTs
armv8: cavium: Add the device tree for ThunderX
armv8: cavium: Add ThunderX 88xx board definition
armv8: cavium: Add an implementation of ATF calling functions
armv8: cavium: Get DRAM size from ATF
arch/arm/Kconfig | 5 + arch/arm/cpu/armv8/Makefile | 1 + arch/arm/cpu/armv8/cache_v8.c | 79 +++++++ arch/arm/cpu/armv8/fwcall.c | 75 ++++++ arch/arm/cpu/armv8/start.S | 36 +++ arch/arm/dts/Makefile | 1 + arch/arm/dts/thunderx-88xx.dts | 31 +++ arch/arm/dts/thunderx-88xx.dtsi | 363 ++++++++++++++++++++++++++++++ arch/arm/include/asm/armv8/mmu.h | 82 ++++++- arch/arm/include/asm/global_data.h | 3 + arch/arm/include/asm/system.h | 39 ++++ board/cavium/thunderx/Kconfig | 27 +++ board/cavium/thunderx/MAINTAINERS | 6 + board/cavium/thunderx/Makefile | 8 + board/cavium/thunderx/atf.c | 312 +++++++++++++++++++++++++ board/cavium/thunderx/thunderx.c | 102 +++++++++ configs/thunderx_88xx_defconfig | 24 ++ doc/README.arm64 | 35 ++- doc/device-tree-bindings/serial/pl01x.txt | 3 + drivers/serial/serial_pl01x.c | 14 +- include/cavium/atf.h | 22 ++ include/cavium/atf_part.h | 26 +++ include/cavium/thunderx_svc.h | 67 ++++++ include/configs/thunderx_88xx.h | 147 ++++++++++++ include/dm/platform_data/serial_pl01x.h | 2 + include/linux/psci.h | 90 ++++++++ 26 files changed, 1582 insertions(+), 18 deletions(-) create mode 100644 arch/arm/cpu/armv8/fwcall.c create mode 100644 arch/arm/dts/thunderx-88xx.dts create mode 100644 arch/arm/dts/thunderx-88xx.dtsi create mode 100644 board/cavium/thunderx/Kconfig create mode 100644 board/cavium/thunderx/MAINTAINERS create mode 100644 board/cavium/thunderx/Makefile create mode 100644 board/cavium/thunderx/atf.c create mode 100644 board/cavium/thunderx/thunderx.c create mode 100644 configs/thunderx_88xx_defconfig create mode 100644 include/cavium/atf.h create mode 100644 include/cavium/atf_part.h create mode 100644 include/cavium/thunderx_svc.h create mode 100644 include/configs/thunderx_88xx.h create mode 100644 include/linux/psci.h
Signature · 1 line
2.1.4
PATCH v7 1/9 armv8: Add read_mpidr() function
This patch adds the read_mpidr() function which returns the MPIDR_EL1 register value
---
Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None
arch/arm/include/asm/system.h | 11 +++++++++++ 1 file changed, 11 insertions(+)
arch/arm/include/asm/system.h +11 -0
@@ -71,6 +71,17 @@ static inline void set_sctlr(unsigned int val) asmvolatile ("isb" ); } +static inline unsigned long read_mpidr (void ) +{ +unsigned long val; + + asmvolatile ("mrs %0, mpidr_el1" :"=r" (val)); + +return val; +} + +#define BSP_COREID 0 +void __asm_flush_dcache_all (void );void __asm_invalidate_dcache_all (void );void __asm_flush_dcache_range (u64 start,u64 end);
Signature · 1 line
2.1.4
PATCH v7 1/9 armv8: Add read_mpidr() function
Quoted 7 lines · Sergey Temerkhanov
This patch adds the
read_mpidr()function which returns theMPIDR_EL1register valueSigned-off-by Sergey Temerkhanov <[email protected]>Signed-off-by Radha Mohan Chintakuntla <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160119/99d3d023/attachment.sig>
PATCH v7 2/9 armv8: New MMU setup code allowing to use 48+ bits PA/VA
In reply to Sergey TemerkhanovThis patch adds code which sets up 2-level page tables on ARM64 thus extending available VA space. CPUs implementing 64k translation granule are able to use direct PA-VA mapping of the whole 48 bit address space.
It also adds the ability to reset the SCTRL register at the very beginning of execution to avoid interference from stale mappings set up by early firmware/loaders/etc.
---
Changes in v7:
- Removed stale board.c changes
Changes in v6:
- Fixed lack of protection in global_data.h
Changes in v5:
- Allow setting of different memory attributes in the memory map
Changes in v4:
- Use ALIGN macro for address alignment
Changes in v3:
- Reduced code duplication
- Renamed CONFIG_SYS_PTL1_BITS to CONFIG_SYS_PTL2_BITS
- Moved 'reset_sctrl' call to the 'reset' label
- Rebased to the actual upstream tree
- Documented newly added config options
Changes in v2:
- Changed code licensing
- Completed the patchset
arch/arm/cpu/armv8/cache_v8.c | 79 ++++++++++++++++++++++++++++++++++++ arch/arm/cpu/armv8/start.S | 36 +++++++++++++++++ arch/arm/include/asm/armv8/mmu.h | 82 +++++++++++++++++++++++++++++++++++--- arch/arm/include/asm/global_data.h | 3 ++ arch/arm/include/asm/system.h | 7 ++++ doc/README.arm64 | 35 +++++++++++++--- 6 files changed, 230 insertions(+), 12 deletions(-)
arch/arm/cpu/armv8/cache_v8.c +79 -0
@@ -12,6 +12,69 @@DECLARE_GLOBAL_DATA_PTR ; #ifndef CONFIG_SYS_DCACHE_OFF + +#ifdef CONFIG_SYS_FULL_VA +static void set_ptl1_entry(u64 index, u64 ptl2_entry) +{ + u64 *pgd = (u64 *)gd->arch.tlb_addr; + u64 value; + + value = ptl2_entry | PTL1_TYPE_TABLE; + pgd[index] = value; +} + +static void set_ptl2_block(u64 ptl1, u64 bfn, u64 address, u64 memory_attrs) +{ + u64 *pmd = (u64 *)ptl1; + u64 value; + + value = address | PTL2_TYPE_BLOCK | PTL2_BLOCK_AF; + value |= memory_attrs; + pmd[bfn] = value; +} + +static struct mm_region mem_map[] = CONFIG_SYS_MEM_MAP; + +#define PTL1_ENTRIES CONFIG_SYS_PTL1_ENTRIES +#define PTL2_ENTRIES CONFIG_SYS_PTL2_ENTRIES + +static void setup_pgtables(void) +{ + int l1_e, l2_e; + unsigned long pmd = 0; + unsigned long address; + + /* Setup the PMD pointers */ + for (l1_e = 0; l1_e < CONFIG_SYS_MEM_MAP_SIZE; l1_e++) { + gd->arch.pmd_addr[l1_e] = gd->arch.tlb_addr + + PTL1_ENTRIES * sizeof(u64); + gd->arch.pmd_addr[l1_e] += PTL2_ENTRIES * sizeof(u64) * l1_e; + gd->arch.pmd_addr[l1_e] = ALIGN(gd->arch.pmd_addr[l1_e], + 0x10000UL); + } + + /* Setup the page tables */ + for (l1_e = 0; l1_e < PTL1_ENTRIES; l1_e++) { + if (mem_map[pmd].base == + (uintptr_t)l1_e << PTL2_BITS) { + set_ptl1_entry(l1_e, gd->arch.pmd_addr[pmd]); + + for (l2_e = 0; l2_e < PTL2_ENTRIES; l2_e++) { + address = mem_map[pmd].base + + (uintptr_t)l2_e * BLOCK_SIZE; + set_ptl2_block(gd->arch.pmd_addr[pmd], l2_e, + address, mem_map[pmd].attrs); + } + + pmd++; + } else { + set_ptl1_entry(l1_e, 0); + } + } +} + +#else + inline void set_pgtable_section(u64 *page_table, u64 index, u64 section, u64 memory_type, u64 share) {
@@ -31,13 +94,25 @@ inline void set_pgtable_table(u64 *page_table, u64 index, u64 *table_addr) page_table[index] = value; } +#endif + +/* to activate the MMU we need to set up virtual memory */ static void mmu_setup(void) { +#ifndef CONFIG_SYS_FULL_VA bd_t *bd = gd->bd; u64 *page_table = (u64 *)gd->arch.tlb_addr, i, j; +#endif int el; +#ifdef CONFIG_SYS_FULL_VA + unsigned long coreid = read_mpidr() & CONFIG_COREID_MASK; + + /* Set up page tables only on BSP */ + if (coreid == BSP_COREID) + setup_pgtables(); +#else /* Setup an identity-mapping for all spaces */ for (i = 0; i < (PGTABLE_SIZE >> 3); i++) { set_pgtable_section(page_table, i, i << SECTION_SHIFT,
@@ -55,6 +130,7 @@ static void mmu_setup(void) } } +#endif /* load TTBR0 */ el =current_el ();if (el ==1 ) {
@@ -154,6 +230,7 @@ u64 *__weak arch_get_page_table(void) {return NULL ; } +#ifndef CONFIG_SYS_FULL_VA void mmu_set_region_dcache_behaviour (phys_addr_t start,size_t size,enum dcache_option option) {
@@ -179,6 +256,8 @@ void mmu_set_region_dcache_behaviour(phys_addr_t start, size_t size,flush_dcache_range (start, end); asm volatile("dsb sy"); } +#endif +#else /* CONFIG_SYS_DCACHE_OFF */ void invalidate_dcache_all (void )
arch/arm/cpu/armv8/start.S +36 -0
@@ -43,6 +43,9 @@ _bss_end_ofs: .quad __bss_end - _start reset: +#ifdef CONFIG_SYS_RESET_SCTRL + bl reset_sctrl +#endif /* * Could be EL3/EL2/EL1, Initial State: * Little Endian, MMU Disabled, i/dCache Disabled
@@ -99,6 +102,39 @@ master_cpu: bl _main +#ifdef CONFIG_SYS_RESET_SCTRL +reset_sctrl: + switch_el x1, 3f, 2f, 1f +3: + mrs x0, sctlr_el3 + b 0f +2: + mrs x0, sctlr_el2 + b 0f +1: + mrs x0, sctlr_el1 + +0: + ldr x1, =0xfdfffffa + and x0, x0, x1 + + switch_el x1, 6f, 5f, 4f +6: + msr sctlr_el3, x0 + b 7f +5: + msr sctlr_el2, x0 + b 7f +4: + msr sctlr_el1, x0 + +7: + dsb sy + isb + b __asm_invalidate_tlb_all + ret +#endif + /*-----------------------------------------------------------------------*/ WEAK(apply_core_errata)
arch/arm/include/asm/armv8/mmu.h +76 -6
141 lines not on this page · raw message
arch/arm/include/asm/global_data.h +3 -0
@@ -38,6 +38,9 @@ struct arch_global_data {unsigned long long timer_reset_value;#if !(defined(CONFIG_SYS_ICACHE_OFF ) && defined(CONFIG_SYS_DCACHE_OFF ))unsigned long tlb_addr; +#if defined(CONFIG_SYS_FULL_VA ) +unsigned long pmd_addr[CONFIG_SYS_PTL1_ENTRIES ]; +#endif unsigned long tlb_size;#endif
arch/arm/include/asm/system.h +7 -0
@@ -14,7 +14,12 @@#define CR_WXN (1 << 19)/* Write Permision Imply XN */ #define CR_EE (1 << 25)/* Exception (Big) Endian */ +#ifndef CONFIG_SYS_FULL_VA #define PGTABLE_SIZE (0x10000) +#else +#define PGTABLE_SIZE CONFIG_SYS_PGTABLE_SIZE +#endif +/* 2MB granularity */ #define MMU_SECTION_SHIFT 21
@@ -147,7 +152,9 @@ void flush_l3_cache(void);#define CR_AFE (1 << 29)/* Access flag enable */ #define CR_TE (1 << 30)/* Thumb exception enable */ +#ifndef PGTABLE_SIZE #define PGTABLE_SIZE (4096 * 4) +#endif /* * This is used to ensure the compiler did actually allocate the register we
doc/README.arm64 +29 -6
@@ -36,11 +36,34 @@ Notes 6. CONFIG_ARM64 instead of CONFIG_ARMV8 is used to distinguish aarch64 and aarch32 specific codes. +7. CONFIG_SYS_FULL_VA is used to enable 2-level page tables. For cores + supporting 64k pages it allows usage of full 48+ virtual/physical addresses + + Enabling this option requires the following ones to be defined: + - CONFIG_SYS_MEM_MAP - an array of 'struct mm_region' describing the + system memory map (start, length, attributes) + - CONFIG_SYS_MEM_MAP_SIZE - number of entries in CONFIG_SYS_MEM_MAP + - CONFIG_SYS_PTL1_ENTRIES - number of 1st level page table entries + - CONFIG_SYS_PTL2_ENTRIES - number of 1nd level page table entries + for the largest CONFIG_SYS_MEM_MAP entry + - CONFIG_COREID_MASK - the mask value used to get the core from the + MPIDR_EL1 register + - CONFIG_SYS_PTL2_BITS - number of bits addressed by the 2nd level + page tables + - CONFIG_SYS_BLOCK_SHIFT - number of bits addressed by a single block + entry from L2 page tables + - CONFIG_SYS_PGTABLE_SIZE - total size of the page table + - CONFIG_SYS_TCR_EL{1,2,3}_IPS_BITS - the IPS field of the TCR_EL{1,2,3} + + + + Contributor =========== - Tom Rini <[email protected]> - Scott Wood <[email protected]> - York Sun <[email protected]> - Simon Glass <[email protected]> - Sharma Bhupesh <[email protected]> - Rob Herring <[email protected]> + Tom Rini <[email protected]> + Scott Wood <[email protected]> + York Sun <[email protected]> + Simon Glass <[email protected]> + Sharma Bhupesh <[email protected]> + Rob Herring <[email protected]> + Sergey Temerkhanov <[email protected]>
Signature · 1 line
2.1.4
PATCH v7 2/9 armv8: New MMU setup code allowing to use 48+ bits PA/VA
Quoted 10 lines · Sergey Temerkhanov
This patch adds code which sets up 2-level page tables on ARM64 thus extending available VA space. CPUs implementing 64k translation granule are able to use direct PA-VA mapping of the whole 48 bit address space.
It also adds the ability to reset the SCTRL register at the very beginning of execution to avoid interference from stale mappings set up by earlyfirmware/loaders/etc.Signed-off-by Sergey Temerkhanov <[email protected]>Signed-off-by Radha Mohan Chintakuntla <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160119/a2542d17/attachment.sig>
PATCH v7 3/9 armv8: Add Secure Monitor/Hypervisor Call (SMC/HVC) infrastructure
In reply to Sergey TemerkhanovThis commit adds functions issuing calls to secure monitor or hypervisore. This allows using services such as Power State Coordination Interface (PSCI) provided by firmware, e.g. ARM Trusted Firmware (ATF)
The SMC call can destroy all registers declared temporary by the calling conventions. The clobber list is "x0..x17" because of this
---
Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4:
- Document FW calls
Changes in v3:
- Fixed clobber lists (thanks to Corey)
Changes in v2: None
arch/arm/cpu/armv8/Makefile | 1 + arch/arm/cpu/armv8/fwcall.c | 75 +++++++++++++++++++++++++++++++++++++++++++ arch/arm/include/asm/system.h | 21 ++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 arch/arm/cpu/armv8/fwcall.c
arch/arm/cpu/armv8/Makefile +1 -0
@@ -14,6 +14,7 @@ obj-y += exceptions.o obj-y += cache.o obj-y += tlb.o obj-y += transition.o +obj-y += fwcall.o obj-$(CONFIG_FSL_LSCH3) += fsl-lsch3/ obj-$(CONFIG_ARCH_ZYNQMP) += zynqmp/
arch/arm/cpu/armv8/fwcall.c new file +75 -0
75 lines not on this page · raw message
arch/arm/include/asm/system.h +21 -0
@@ -1,6 +1,9 @@#ifndef __ASM_ARM_SYSTEM_H#define __ASM_ARM_SYSTEM_H +#include <common.h> +#include <linux/compiler.h> +#ifdef CONFIG_ARM64 /*
@@ -104,6 +107,24 @@ void smp_kick_all_cpus(void);void flush_l3_cache (void ); +/* +*Issue a hypervisor call in accordance with ARM "SMC Calling convention", +* DEN0028A +* +* @args: input and output arguments +* +*/ +void hvc_call (struct pt_regs *args); + +/* +*Issue a secure monitor call in accordance with ARM "SMC Calling convention", +* DEN0028A +* +* @args: input and output arguments +* +*/ +void smc_call (struct pt_regs *args); +#endif /* __ASSEMBLY__ */ #else /* CONFIG_ARM64 */
Signature · 1 line
2.1.4
PATCH v7 3/9 armv8: Add Secure Monitor/Hypervisor Call (SMC/HVC) infrastructure
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Quoted 5 lines · Sergey Temerkhanov
This commit adds functions issuing calls to secure monitor or hypervisore. This allows using services such as Power State Coordination Interface (PSCI) provided by firmware, e.g. ARM Trusted Firmware (ATF)
Quoted 8 lines
The SMC call can destroy all registers declared temporary by the calling conventions. The clobber list is "x0..x17" because of this
Signed-off-by Sergey Temerkhanov <[email protected]>Signed-off-by Corey Minyard <[email protected]>Signed-off-by Radha Mohan Chintakuntla <[email protected]>Reviewed-by Simon Glass <[email protected]>
+1 (I may need it as well)
Tested on: Hikey
Methodology:
Hacked smc handler in arm trusted firmware (x0=x0+x1, x1=x2+x3, x2=x4+x5, x3=x6+2) +new u-boot command (smc/hvc) using functions from this patch;
I didn't tested hvc code (would need to make some fake hypervisor), but it's basically the same.
Idea: perhaps after this series is merged we can add 2 new commands to u-boot (SMC/HVC) to play with hypervisors/secure monitors (and perhaps use some simple functionality if needed).
@Sergey - you probably need to rebase the patch as it doesn't apply to master cleanly
Regards,
Mateusz
Quoted 143 lines
---
Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4:
- Document FW callsChanges in v3:
- Fixed clobber lists (thanks to Corey)Changes in v2: None
arch/arm/cpu/armv8/Makefile | 1 + arch/arm/cpu/armv8/fwcall.c | 75 +++++++++++++++++++++++++++++++++++++++++++ arch/arm/include/asm/system.h | 21 ++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 arch/arm/cpu/armv8/fwcall.carch/arm/cpu/armv8/Makefile +1
-0@@ -14,6 +14,7 @@ obj-y += exceptions.o obj-y += cache.o obj-y += tlb.o obj-y += transition.o +obj-y += fwcall.o obj-$(CONFIG_FSL_LSCH3) += fsl-lsch3/ obj-$(CONFIG_ARCH_ZYNQMP) += zynqmp/arch/arm/cpu/armv8/fwcall.c new file +75
-0@@ -0,0 +1,75 @@ +/** +* (C) Copyright 2014, Cavium Inc. +* +* SPDX-License-Identifier: GPL-2.0+ +**/ + +#include <asm-offsets.h> +#include <config.h> +#include <version.h> +#include <asm/macro.h> +#include <asm/system.h> + +/* +* Issue the hypervisor call +* +* x0~x7: input arguments +* x0~x3: output arguments +*/ +void hvc_call (struct pt_regs *args) +{ + asmvolatile ( +"ldr x0, %0\n" +"ldr x1, %1\n" +"ldr x2, %2\n" +"ldr x3, %3\n" +"ldr x4, %4\n" +"ldr x5, %5\n" +"ldr x6, %6\n" +"ldr x7, %7\n" +"hvc #0\n" +"str x0, %0\n" +"str x1, %1\n" +"str x2, %2\n" +"str x3, %3\n" + :"+m" (args->regs[0 ]),"+m" (args->regs[1 ]), +"+m" (args->regs[2 ]),"+m" (args->regs[3 ]) + :"m" (args->regs[4 ]),"m" (args->regs[5 ]), +"m" (args->regs[6 ]),"m" (args->regs[7 ]) + :"x0" ,"x1" ,"x2" ,"x3" ,"x4" ,"x5" ,"x6" ,"x7" , +"x8" ,"x9" ,"x10" ,"x11" ,"x12" ,"x13" ,"x14" ,"x15" , +"x16" ,"x17" ); +} + +/* +* void smc_call(arg0, arg1...arg7) +* +* issue the secure monitor call +* +* x0~x7: input arguments +* x0~x3: output arguments +*/ + +void smc_call (struct pt_regs *args) +{ + asmvolatile ( +"ldr x0, %0\n" +"ldr x1, %1\n" +"ldr x2, %2\n" +"ldr x3, %3\n" +"ldr x4, %4\n" +"ldr x5, %5\n" +"ldr x6, %6\n" +"smc #0\n" +"str x0, %0\n" +"str x1, %1\n" +"str x2, %2\n" +"str x3, %3\n" + :"+m" (args->regs[0 ]),"+m" (args->regs[1 ]), +"+m" (args->regs[2 ]),"+m" (args->regs[3 ]) + :"m" (args->regs[4 ]),"m" (args->regs[5 ]), +"m" (args->regs[6 ]) + :"x0" ,"x1" ,"x2" ,"x3" ,"x4" ,"x5" ,"x6" ,"x7" , +"x8" ,"x9" ,"x10" ,"x11" ,"x12" ,"x13" ,"x14" ,"x15" , +"x16" ,"x17" ); +}arch/arm/include/asm/system.h +14
-0@@ -1,6 +1,9 @@#ifndef __ASM_ARM_SYSTEM_H#define __ASM_ARM_SYSTEM_H +#include <common.h> +#include <linux/compiler.h> +#ifdef CONFIG_ARM64 /* @@ -104,6 +107,24 @@ void smp_kick_all_cpus(void);void flush_l3_cache (void ); +/* +*Issue a hypervisor call in accordance with ARM "SMC Calling convention", +* DEN0028A +* +* @args: input and output arguments +* +*/ +void hvc_call (struct pt_regs *args); + +/* +*Issue a secure monitor call in accordance with ARM "SMC Calling convention",
arch/arm/include/asm/system.h void smp_kick_all_cpus(void); · line 130
Quoted 10 lines
arch/arm/include/asm/system.h +7
-0+* DEN0028A +* +* @args: input and output arguments +* +*/ +void smc_call (struct pt_regs *args); +#endif /* __ASSEMBLY__ */ #else /* CONFIG_ARM64 */
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQEcBAEBCAAGBQJWjRDgAAoJELvtohmVtQzBD/4IAJBh4uT99P/qRZtXr2SJhnIE 45wp3vuQw22IhwUiV0D/8V7dtElYLy8C3Ct4xbZF15oibSdto8k9tJjuuLw/DOdV aYvNwCSc0eyckHAfwjUwMlW4rMFVYD4ik+kvDBb9Rr9b8rpJIPWWA0mBY95rHTq/ 0uq2KsxHvbMCmmuNWksb6lk7s7fcrR3j2uavvtrFtMT255dKqw/kinWxXHDVKrWa MBngc1rsa23u07oN9MyDpE0knCLB01l3pkmu4FB5CybJvJ7FPLxMPZNaataFo4Z/ 6KM02h6RYhGntiveQ+2/vIm4BHK7XSkX9CBsi9SpV+opN8MSwhC3RKNFem72hBk= =2qqk
-----END PGP SIGNATURE-----
PATCH v7 3/9 armv8: Add Secure Monitor/Hypervisor Call (SMC/HVC) infrastructure
Quoted 22 lines · Mateusz Kulikowski
Quoted 5 lines · Sergey Temerkhanov
This commit adds functions issuing calls to secure monitor or hypervisore. This allows using services such as Power State Coordination Interface (PSCI) provided by firmware, e.g. ARM Trusted Firmware (ATF)
Quoted 8 lines
The SMC call can destroy all registers declared temporary by the calling conventions. The clobber list is "x0..x17" because of this
Signed-off-by Sergey Temerkhanov <[email protected]>Signed-off-by Corey Minyard <[email protected]>Signed-off-by Radha Mohan Chintakuntla <[email protected]>Reviewed-by Simon Glass <[email protected]>+1 (I may need it as well)
Tested-by Mateusz Kulikowski <[email protected]>Tested on: Hikey
Methodology:
Quoted 7 lines
Hacked smc handler in arm trusted firmware (x0=x0+x1, x1=x2+x3, x2=x4+x5, x3=x6+2) +new u-boot command (smc/hvc) using functions from this patch;
I didn't tested hvc code (would need to make some fake hypervisor), but it's basically the same.
Idea: perhaps after this series is merged we can add 2 new commands to u-boot (SMC/HVC) to play with hypervisors/secure monitors (and perhaps use some simple functionality if needed).
How this should look like?
Definitely I would like to see this code in mainline because we have code which needs to call SMCs.
Thanks,
Michal
PATCH v7 3/9 armv8: Add Secure Monitor/Hypervisor Call (SMC/HVC) infrastructure
Quoted 28 lines · Michal Simek
Quoted 27 lines · Mateusz Kulikowski
Quoted 5 lines · Sergey Temerkhanov
This commit adds functions issuing calls to secure monitor or hypervisore. This allows using services such as Power State Coordination Interface (PSCI) provided by firmware, e.g. ARM Trusted Firmware (ATF)
Quoted 8 lines
The SMC call can destroy all registers declared temporary by the calling conventions. The clobber list is "x0..x17" because of this
Signed-off-by Sergey Temerkhanov <[email protected]>Signed-off-by Corey Minyard <[email protected]>Signed-off-by Radha Mohan Chintakuntla <[email protected]>Reviewed-by Simon Glass <[email protected]>+1 (I may need it as well)
Tested-by Mateusz Kulikowski <[email protected]>Tested on: Hikey
Methodology:Hacked smc handler in arm trusted firmware (x0=x0+x1, x1=x2+x3, x2=x4+x5, x3=x6+2) +new u-boot command (smc/hvc) using functions from this patch;
I didn't tested hvc code (would need to make some fake hypervisor), but it's basically the same.
Quoted 7 lines
Quoted 2 lines
Idea: perhaps after this series is merged we can add 2 new commands to u-boot (SMC/HVC) to play with hypervisors/secure monitors (and perhaps use some simple functionality if needed).
How this should look like?
Definitely I would like to see this code in mainline because we have code which needs to call SMCs.
I guess the answer is we either need the cavium board series re-posted without the device-tree binding change that is causing consternation elsewhere or come up with something else there, or I just pull parts of the series. I'm not quite sure which is best at this point..
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160107/50e98bd6/attachment.sig>
PATCH v7 3/9 armv8: Add Secure Monitor/Hypervisor Call (SMC/HVC) infrastructure
Quoted 34 lines · Tom Rini
Quoted 33 lines · Michal Simek
Quoted 22 lines · Mateusz Kulikowski
Quoted 5 lines · Sergey Temerkhanov
This commit adds functions issuing calls to secure monitor or hypervisore. This allows using services such as Power State Coordination Interface (PSCI) provided by firmware, e.g. ARM Trusted Firmware (ATF)
Quoted 8 lines
The SMC call can destroy all registers declared temporary by the calling conventions. The clobber list is "x0..x17" because of this
Signed-off-by Sergey Temerkhanov <[email protected]>Signed-off-by Corey Minyard <[email protected]>Signed-off-by Radha Mohan Chintakuntla <[email protected]>Reviewed-by Simon Glass <[email protected]>+1 (I may need it as well)
Tested-by Mateusz Kulikowski <[email protected]>Tested on: Hikey
Methodology:Quoted 7 lines
Hacked smc handler in arm trusted firmware (x0=x0+x1, x1=x2+x3, x2=x4+x5, x3=x6+2) +new u-boot command (smc/hvc) using functions from this patch;
I didn't tested hvc code (would need to make some fake hypervisor), but it's basically the same.
Idea: perhaps after this series is merged we can add 2 new commands to u-boot (SMC/HVC) to play with hypervisors/secure monitors (and perhaps use some simple functionality if needed).
How this should look like?
Quoted 7 lines
Quoted 2 lines
Definitely I would like to see this code in mainline because we have code which needs to call SMCs.
I guess the answer is we either need the cavium board series re-posted without the device-tree binding change that is causing consternation elsewhere or come up with something else there, or I just pull parts of the series. I'm not quite sure which is best at this point..
This patch can go standalone I believe. Should it go via Albert or directly through you?
I think that make sense to add it in merge window.
I am happy to test it on zynqmp.
Thanks,
Michal
PATCH v7 3/9 armv8: Add Secure Monitor/Hypervisor Call (SMC/HVC) infrastructure
In reply to Michal Simek-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Quoted 2 lines · Michal Simek
Quoted 1 line · Mateusz Kulikowski
On 14.10.2015 18:55, Sergey Temerkhanov wrote:
[...]
Quoted 5 lines
Quoted 3 lines
Idea: perhaps after this series is merged we can add 2 new commands to u-boot (SMC/HVC) to play with hypervisors/secure monitors (and perhaps use some simple functionality if needed).
How this should look like?
I thought of something like this (I did such code few times):
u-boot> smc 42 42 42 42 42 42
ret => (0x1, 0x2, 0x3, 0x4)
Or something similar (perhaps setting env variables so return value can be used in scripts)
Regards,
Mateusz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQEcBAEBCAAGBQJWjtsVAAoJELvtohmVtQzBa9oH/3/wQfIjTBeRqTUJw/spaojw skkTAGjYVJXrlQJJw6YNi7z1uYhA91VEkF/04u0wT45JU/SUjHtCtdqWnYwwIAPK r4zAoPpr5VLxLbvAiIBQLC+DkkvtTES3bSvPvI5NVM7hiIvnzJNmXfgLpG+ju+qZ IHrteaN6Idt1LZOGBiz5/aIaXpGkii85U6eSViH/bj9Ocpjv0aj+BDjQVZaM7OSr 3YHy2Mbi0eN97KrUWm+w1DxaFvoSJvtbzfZDdgTAiZlWcL7zSkL6SquD4eDMSnOc gJPLoURHQCZxD3zwLKMYVL+St1oE2k1HrwfeWE4ypBRsV6R2++9JETfdBFphn+A= =v6rh
-----END PGP SIGNATURE-----
PATCH v7 3/9 armv8: Add Secure Monitor/Hypervisor Call (SMC/HVC) infrastructure
Quoted 9 lines · Mateusz Kulikowski
Quoted 2 lines · Michal Simek
Quoted 1 line · Mateusz Kulikowski
On 14.10.2015 18:55, Sergey Temerkhanov wrote:
[...]
Quoted 3 lines
Quoted 3 lines
Idea: perhaps after this series is merged we can add 2 new commands to u-boot (SMC/HVC) to play with hypervisors/secure monitors (and perhaps use some simple functionality if needed).
Quoted 8 lines
Quoted 1 line
How this should look like?
I thought of something like this (I did such code few times):
u-boot> smc 42 42 42 42 42 42
ret => (0x1,0x2,0x3,0x4)Or something similar (perhaps setting env variables so return value can be used in scripts)
I have no problem with that.
M
PATCH v7 3/9 armv8: Add Secure Monitor/Hypervisor Call (SMC/HVC) infrastructure
In reply to Mateusz KulikowskiHi Mateusz,
Quoted 12 lines · Mateusz Kulikowski
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256Quoted 2 lines · Michal Simek
Quoted 1 line · Mateusz Kulikowski
On 14.10.2015 18:55, Sergey Temerkhanov wrote:
[...]
Quoted 4 lines
Quoted 3 lines
Idea: perhaps after this series is merged we can add 2 new commands to u-boot (SMC/HVC) to play with hypervisors/secure monitors (and perhaps use some simple functionality if needed).
Quoted 6 lines
Quoted 1 line
How this should look like?
I thought of something like this (I did such code few times):
u-boot> smc 42 42 42 42 42 42
ret => (0x1,0x2,0x3,0x4)
Could you share any (example?) code you have for such an smc/hvc U-Boot command?
Best regards
Dirk
PATCH v7 3/9 armv8: Add Secure Monitor/Hypervisor Call (SMC/HVC) infrastructure
Hi Dirk,
On 23.06.2016 13:33, Dirk Behme wrote:
[...]
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Quoted 3 lines
Idea: perhaps after this series is merged we can add 2 new commands to u-boot (SMC/HVC) to play with hypervisors/secure monitors (and perhaps use some simple functionality if needed).
How this should look like?
Quoted 7 lines
Quoted 4 lines
I thought of something like this (I did such code few times):
u-boot> smc 42 42 42 42 42 42
ret => (0x1,0x2,0x3,0x4)Could you share any (example?) code you have for such an smc/hvc U-Boot command?
I'm afraid I don't have it anymore :(
SMC call itself is trivial, you can use smc_call @ u-boot:arch/arm/cpu/armv8/fwcall.c
(this is code for armv8 in 64-bit mode, but you can easily port it to armv7)
As for adding custom commands - just use any existing as template (sleep may be a good idea :) ).
Regards,
Mateusz
PATCH v7 3/9 armv8: Add Secure Monitor/Hypervisor Call (SMC/HVC) infrastructure
Quoted 18 lines · Mateusz Kulikowski
Hi Dirk,
On 23.06.2016 13:33, Dirk Behme wrote:
[...]Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Quoted 3 lines
Idea: perhaps after this series is merged we can add 2 new commands to u-boot (SMC/HVC) to play with hypervisors/secure monitors (and perhaps use some simple functionality if needed).
How this should look like?
Quoted 7 lines
Quoted 4 lines
I thought of something like this (I did such code few times):
u-boot> smc 42 42 42 42 42 42
ret => (0x1,0x2,0x3,0x4)Could you share any (example?) code you have for such an smc/hvc U-Boot command?
Quoted 7 lines
I'm afraid I don't have it anymore :(
SMC call itself is trivial, you can use
smc_call@ u-boot:arch/arm/cpu/armv8/fwcall.c
(this is code for armv8 in 64-bit mode, but you can easily port it to armv7)As for adding custom commands - just use any existing as template (sleep may be a good idea :) ).
Anything like below [1]?
Best regards
Dirk
[1]
From f5fb9bdab3054fdc37ca3fed44703f0dc5c8b083 Mon Sep 17 00:00:00 2001
From: Dirk Behme <[email protected]>
Date: Mon, 27 Jun 2016 12:39:35 +0200
Subject: [PATCH] common: Add ARMv8 smc command
Add a command line interface to do ARMv8 secure monitor calls (smc).
--- common/Makefile | 2 + common/cmd_armv8svchvc.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 0 deletions(-)
create mode 100644 common/cmd_armv8svchvc.c
common/Makefile +2 -0
@@ -191,6 +191,8 @@ obj-$(CONFIG_CMD_SPL) += cmd_spl.o obj-$(CONFIG_CMD_ZIP) += cmd_zip.o obj-$(CONFIG_CMD_ZFS) += cmd_zfs.o +obj-$(CONFIG_ARM64) += cmd_armv8svchvc.o + # others obj-$(CONFIG_BOOTSTAGE) += bootstage.o obj-$(CONFIG_CONSOLE_MUX) += iomux.o
common/cmd_armv8svchvc.c new file +12 -0
@@ -0,0 +1,60 @@ +/* +* (C) Copyright 2016 +* Robert Bosch Car Multimedia GmbH +* Dirk Behme <[email protected]> +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#include <common.h> +#include <command.h> + +static int do_smc(cmd_tbl_t *cmdtp, int flag, int argc, char * const
argv[])
+{
+ struct pt_regs regs;
+
+ memset(®s, 0, sizeof(struct pt_regs));
+
+ switch (argc) {
+ case 9:
+ regs.regs[7] = simple_strtoul(argv[8], NULL, 16);
+ /* fall through */
+ case 8:
+ regs.regs[6] = simple_strtoul(argv[7], NULL, 16);
+ /* fall through */
+ case 7:
+ regs.regs[5] = simple_strtoul(argv[6], NULL, 16);
+ /* fall through */
+ case 6:
+ regs.regs[4] = simple_strtoul(argv[5], NULL, 16);
+ /* fall through */
+ case 5:
+ regs.regs[3] = simple_strtoul(argv[4], NULL, 16);
+ /* fall through */
+ case 4:
+ regs.regs[2] = simple_strtoul(argv[3], NULL, 16);
+ /* fall through */
+ case 3:
+ regs.regs[1] = simple_strtoul(argv[2], NULL, 16);
+ /* fall through */
+ case 2:
+ regs.regs[0] = simple_strtoul(argv[1], NULL, 16);
+ break;
+ default:
+ return CMD_RET_USAGE;
+ }
+
+ smc_call(®s);
+
+ printf("ret: x0: 0x%016luX\n x1: 0x%016luX\n x2: 0x%016luX
x3: 0x%016lX\n",
+ regs.regs[0], regs.regs[1], regs.regs[2], regs.regs[3]);
+
+ return 0;
+}
+
+U_BOOT_CMD(
+ smc , 9, 0, do_smc,
+ "do ARMv8 hypervisor call (SMC)",
+ "x0 [x1 x2 x3 x4 x5 x6 x7]\n"
+ " - 8 SMC parameters for the registers x0 - x7"
+);
Signature · 1 line
1.6.6.1
PATCH v7 3/9 armv8: Add Secure Monitor/Hypervisor Call (SMC/HVC) infrastructure
In reply to Sergey TemerkhanovQuoted 9 lines · Sergey Temerkhanov
This commit adds functions issuing calls to secure monitor or hypervisore. This allows using services such as Power State Coordination Interface (PSCI) provided by firmware, e.g. ARM Trusted Firmware (ATF)
The SMC call can destroy all registers declared temporary by the calling conventions. The clobber list is "x0..x17" because of this
Quoted 5 lines
Signed-off-by Sergey Temerkhanov <[email protected]>Signed-off-by Corey Minyard <[email protected]>Signed-off-by Radha Mohan Chintakuntla <[email protected]>Reviewed-by Simon Glass <[email protected]>Tested-by Mateusz Kulikowski <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160119/24a7799c/attachment.sig>
PATCH v7 4/9 armv8: Add psci.h from the Linux kernel
In reply to Sergey TemerkhanovThis commit adds the psci.h header file from Linux kernel which contains definitions related to the PSCI interface provided by firmware
---
Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None
include/linux/psci.h | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 include/linux/psci.h
include/linux/psci.h new file +90 -0
@@ -0,0 +1,90 @@ +/* +* ARM Power State and Coordination Interface (PSCI) header +* +* This header holds common PSCI defines and macros shared +* by: ARM kernel, ARM64 kernel, KVM ARM/ARM64 and user space. +* +* Copyright (C) 2014 Linaro Ltd. +* Author: Anup Patel <[email protected]> +*/ + +#ifndef _UAPI_LINUX_PSCI_H +#define _UAPI_LINUX_PSCI_H + +/* +* PSCI v0.1 interface +* +* The PSCI v0.1 function numbers are implementation defined. +* +* Only PSCI return values such as: SUCCESS, NOT_SUPPORTED, +* INVALID_PARAMS, and DENIED defined below are applicable +* to PSCI v0.1. +*/ + +/* PSCI v0.2 interface */ +#define PSCI_0_2_FN_BASE 0x84000000 +#define PSCI_0_2_FN (n) (PSCI_0_2_FN_BASE + (n)) +#define PSCI_0_2_64BIT 0x40000000 +#define PSCI_0_2_FN64_BASE \ + (PSCI_0_2_FN_BASE + PSCI_0_2_64BIT) +#define PSCI_0_2_FN64 (n) (PSCI_0_2_FN64_BASE + (n)) + +#define PSCI_0_2_FN_PSCI_VERSION PSCI_0_2_FN(0) +#define PSCI_0_2_FN_CPU_SUSPEND PSCI_0_2_FN(1) +#define PSCI_0_2_FN_CPU_OFF PSCI_0_2_FN(2) +#define PSCI_0_2_FN_CPU_ON PSCI_0_2_FN(3) +#define PSCI_0_2_FN_AFFINITY_INFO PSCI_0_2_FN(4) +#define PSCI_0_2_FN_MIGRATE PSCI_0_2_FN(5) +#define PSCI_0_2_FN_MIGRATE_INFO_TYPE PSCI_0_2_FN(6) +#define PSCI_0_2_FN_MIGRATE_INFO_UP_CPU PSCI_0_2_FN(7) +#define PSCI_0_2_FN_SYSTEM_OFF PSCI_0_2_FN(8) +#define PSCI_0_2_FN_SYSTEM_RESET PSCI_0_2_FN(9) + +#define PSCI_0_2_FN64_CPU_SUSPEND PSCI_0_2_FN64(1) +#define PSCI_0_2_FN64_CPU_ON PSCI_0_2_FN64(3) +#define PSCI_0_2_FN64_AFFINITY_INFO PSCI_0_2_FN64(4) +#define PSCI_0_2_FN64_MIGRATE PSCI_0_2_FN64(5) +#define PSCI_0_2_FN64_MIGRATE_INFO_UP_CPU PSCI_0_2_FN64(7) + +/* PSCI v0.2 power state encoding for CPU_SUSPEND function */ +#define PSCI_0_2_POWER_STATE_ID_MASK 0xffff +#define PSCI_0_2_POWER_STATE_ID_SHIFT 0 +#define PSCI_0_2_POWER_STATE_TYPE_SHIFT 16 +#define PSCI_0_2_POWER_STATE_TYPE_MASK \ + (0x1 << PSCI_0_2_POWER_STATE_TYPE_SHIFT) +#define PSCI_0_2_POWER_STATE_AFFL_SHIFT 24 +#define PSCI_0_2_POWER_STATE_AFFL_MASK \ + (0x3 << PSCI_0_2_POWER_STATE_AFFL_SHIFT) + +/* PSCI v0.2 affinity level state returned by AFFINITY_INFO */ +#define PSCI_0_2_AFFINITY_LEVEL_ON 0 +#define PSCI_0_2_AFFINITY_LEVEL_OFF 1 +#define PSCI_0_2_AFFINITY_LEVEL_ON_PENDING 2 + +/* PSCI v0.2 multicore support in Trusted OS returned by MIGRATE_INFO_TYPE */ +#define PSCI_0_2_TOS_UP_MIGRATE 0 +#define PSCI_0_2_TOS_UP_NO_MIGRATE 1 +#define PSCI_0_2_TOS_MP 2 + +/* PSCI version decoding (independent of PSCI version) */ +#define PSCI_VERSION_MAJOR_SHIFT 16 +#define PSCI_VERSION_MINOR_MASK \ + ((1U << PSCI_VERSION_MAJOR_SHIFT) - 1) +#define PSCI_VERSION_MAJOR_MASK ~PSCI_VERSION_MINOR_MASK +#define PSCI_VERSION_MAJOR (ver) \ + (((ver) & PSCI_VERSION_MAJOR_MASK) >> PSCI_VERSION_MAJOR_SHIFT) +#define PSCI_VERSION_MINOR (ver) \ + ((ver) & PSCI_VERSION_MINOR_MASK) + +/* PSCI return values (inclusive of all PSCI versions) */ +#define PSCI_RET_SUCCESS 0 +#define PSCI_RET_NOT_SUPPORTED -1 +#define PSCI_RET_INVALID_PARAMS -2 +#define PSCI_RET_DENIED -3 +#define PSCI_RET_ALREADY_ON -4 +#define PSCI_RET_ON_PENDING -5 +#define PSCI_RET_INTERNAL_FAILURE -6 +#define PSCI_RET_NOT_PRESENT -7 +#define PSCI_RET_DISABLED -8 + +#endif /* _UAPI_LINUX_PSCI_H */
Signature · 1 line
2.1.4
PATCH v7 4/9 armv8: Add psci.h from the Linux kernel
Quoted 6 lines · Sergey Temerkhanov
This commit adds the
psci.hheader file from Linux kernel which contains definitions related to the PSCI interface provided by firmwareSigned-off-by Sergey Temerkhanov <[email protected]>Signed-off-by Radha Mohan Chintakuntla <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160119/f910f005/attachment.sig>
PATCH v7 5/9 arm: serial: Add ability to use pre-initialized UARTs
In reply to Sergey TemerkhanovOn some systems, UART initialization is performed before running U-Boot. This commit allows to skip UART re-initializaion on those systems
---
Changes in v7: None
Changes in v6:
- Changed the 'PL0X_PREINITIALIZED' flag to the 'skip-init' bool
Changes in v5:
- Added OF control support
Changes in v4:
- Fixed build warnings
- Moved to DM_SERIAL
Changes in v3:
- Added __used keyword
Changes in v2: None
doc/device-tree-bindings/serial/pl01x.txt | 3 +++ drivers/serial/serial_pl01x.c | 14 ++++++++------ include/dm/platform_data/serial_pl01x.h | 2 ++ 3 files changed, 13 insertions(+), 6 deletions(-)
doc/device-tree-bindings/serial/pl01x.txt +3 -0
@@ -5,3 +5,6 @@ Required properties: - reg: exactly one register range with length 0x1000 - clock: input clock frequency for the UART (used to calculate the baud rate divisor) + +Optional properties: +- u-boot,skip-init: skip UART initialization at start.
drivers/serial/serial_pl01x.c +8 -6
@@ -103,7 +103,7 @@ static int pl011_set_line_control(struct pl01x_regs *regs) }static int pl01x_generic_setbrg (struct pl01x_regs *regs,enum pl01x_type type, -int clock,int baudrate) +int clock,int baudrate) {switch (type) {case TYPE_PL010 : {
@@ -273,7 +273,6 @@ __weak struct serial_device *default_serial_console(void)#endif /* nCONFIG_DM_SERIAL */ #ifdef CONFIG_DM_SERIAL - struct pl01x_priv { struct pl01x_regs *regs; enum pl01x_type type;
@@ -284,9 +283,9 @@ static int pl01x_serial_setbrg(struct udevice *dev, int baudrate)struct pl01x_serial_platdata *plat =dev_get_platdata (dev);struct pl01x_priv *priv =dev_get_priv (dev); -pl01x_generic_setbrg (priv->regs, priv->type, plat->clock, baudrate); - -return 0 ; +return plat->skip_init ?0 : +pl01x_generic_setbrg (priv->regs, priv->type, + plat->clock, baudrate); }static int pl01x_serial_probe (struct udevice *dev)
@@ -296,7 +295,8 @@ static int pl01x_serial_probe(struct udevice *dev) priv->regs = (struct pl01x_regs *)plat->base; priv->type = plat->type; -return pl01x_generic_serial_init (priv->regs, priv->type); +return plat->skip_init ?0 : +pl01x_generic_serial_init (priv->regs, priv->type); }static int pl01x_serial_getc (struct udevice *dev)
@@ -350,6 +350,8 @@ static int pl01x_serial_ofdata_to_platdata(struct udevice *dev) plat->base = addr; plat->clock =fdtdec_get_int (gd->fdt_blob, dev->of_offset,"clock" ,1 ); plat->type =dev_get_driver_data (dev); + plat->skip_init =fdtdec_get_bool (gd->fdt_blob, dev->of_offset, +"uboot,skip-init" ); return 0; }#endif
include/dm/platform_data/serial_pl01x.h +2 -0
@@ -17,11 +17,13 @@ enum pl01x_type {* @base: Register base address * @type: Port type * @clock: Input clock rate, used for calculating the baud rate divisor +* @flags: Port flags */ struct pl01x_serial_platdata {unsigned long base;enum pl01x_type type;unsigned int clock; +bool skip_init; };#endif
Signature · 1 line
2.1.4
PATCH v7 5/9 arm: serial: Add ability to use pre-initialized UARTs
Quoted 7 lines · Sergey Temerkhanov
On some systems, UART initialization is performed before running U-Boot. This commit allows to skip UART re-initializaion on those systems
Signed-off-by Sergey Temerkhanov <[email protected]>Signed-off-by Radha Mohan Chintakuntla <[email protected]>Reviewed-by Simon Glass <[email protected]>
(...)
doc/device-tree-bindings/serial/pl01x.txt Required properties: · line 10
Quoted 11 lines
doc/device-tree-bindings/serial/pl01x.txt +3
-0@@ -5,3 +5,6 @@ Required properties: - reg: exactly one register range with length 0x1000 - clock: input clock frequency for the UART (used to calculate the baud rate divisor) + +Optional properties: +- u-boot,skip-init: skip UART initialization at start.
Again: get this merged in the Linux kernel FIRST. Is it?
Yours,
Linus Walleij
PATCH v7 5/9 arm: serial: Add ability to use pre-initialized UARTs
Hi Linus,
Quoted 12 lines · Linus Walleij
Quoted 7 lines · Sergey Temerkhanov
On some systems, UART initialization is performed before running U-Boot. This commit allows to skip UART re-initializaion on those systems
Signed-off-by Sergey Temerkhanov <[email protected]>Signed-off-by Radha Mohan Chintakuntla <[email protected]>Reviewed-by Simon Glass <[email protected]>(...)
Quoted 13 lines
doc/device-tree-bindings/serial/pl01x.txt Required properties: · line 10
Quoted 11 lines
doc/device-tree-bindings/serial/pl01x.txt +3
-0@@ -5,3 +5,6 @@ Required properties: - reg: exactly one register range with length 0x1000 - clock: input clock frequency for the UART (used to calculate the baud rate divisor) + +Optional properties: +- u-boot,skip-init: skip UART initialization at start.Again: get this merged in the Linux kernel FIRST. Is it?
We had a little bit of a chat about this at ELCE. It would be great to get these changes merged with the kernel but the amount of push-back/energy it requires is still excessive IMO. Any thoughts?
Regards,
Simon
PATCH v7 5/9 arm: serial: Add ability to use pre-initialized UARTs
Quoted 29 lines · Simon Glass
Hi Linus,
Quoted 12 lines · Linus Walleij
Quoted 7 lines · Sergey Temerkhanov
On some systems, UART initialization is performed before running U-Boot. This commit allows to skip UART re-initializaion on those systems
Signed-off-by Sergey Temerkhanov <[email protected]>Signed-off-by Radha Mohan Chintakuntla <[email protected]>Reviewed-by Simon Glass <[email protected]>(...)
Quoted 13 lines
doc/device-tree-bindings/serial/pl01x.txt Required properties: · line 10
Quoted 11 lines
doc/device-tree-bindings/serial/pl01x.txt +3
-0@@ -5,3 +5,6 @@ Required properties: - reg: exactly one register range with length 0x1000 - clock: input clock frequency for the UART (used to calculate the baud rate divisor) + +Optional properties: +- u-boot,skip-init: skip UART initialization at start.Again: get this merged in the Linux kernel FIRST. Is it?
Quoted 3 lines
We had a little bit of a chat about this at ELCE. It would be great to get these changes merged with the kernel but the amount of push-back/energy it requires is still excessive IMO. Any thoughts?
But it also requires that we try. Did we try here? My first thought is that there's a number of things it would be nice to say "don't re-init stuff" to the kernel as well.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151016/36fc8198/attachment.sig>
PATCH v7 5/9 arm: serial: Add ability to use pre-initialized UARTs
Hi Tom,
Quoted 30 lines · Tom Rini
Quoted 29 lines · Simon Glass
Hi Linus,
Quoted 25 lines · Linus Walleij
Quoted 7 lines · Sergey Temerkhanov
On some systems, UART initialization is performed before running U-Boot. This commit allows to skip UART re-initializaion on those systems
Signed-off-by Sergey Temerkhanov <[email protected]>Signed-off-by Radha Mohan Chintakuntla <[email protected]>Reviewed-by Simon Glass <[email protected]>(...)
doc/device-tree-bindings/serial/pl01x.txt Required properties: · line 10
Quoted 11 lines
doc/device-tree-bindings/serial/pl01x.txt +3
-0@@ -5,3 +5,6 @@ Required properties: - reg: exactly one register range with length 0x1000 - clock: input clock frequency for the UART (used to calculate the baud rate divisor) + +Optional properties: +- u-boot,skip-init: skip UART initialization at start.Again: get this merged in the Linux kernel FIRST. Is it?
Quoted 7 lines
Quoted 3 lines
We had a little bit of a chat about this at ELCE. It would be great to get these changes merged with the kernel but the amount of push-back/energy it requires is still excessive IMO. Any thoughts?
But it also requires that we try. Did we try here? My first thought is that there's a number of things it would be nice to say "don't re-init stuff" to the kernel as well.
See the thread that ends here:
http://lists.denx.de/pipermail/u-boot/2015-July/219283.html
Regards,
Simon
PATCH v7 5/9 arm: serial: Add ability to use pre-initialized UARTs
Quoted 37 lines · Simon Glass
Hi Tom,
Quoted 34 lines · Tom Rini
Quoted 32 lines · Simon Glass
Hi Linus,
Quoted 12 lines · Linus Walleij
Quoted 7 lines · Sergey Temerkhanov
On some systems, UART initialization is performed before running U-Boot. This commit allows to skip UART re-initializaion on those systems
Signed-off-by Sergey Temerkhanov <[email protected]>Signed-off-by Radha Mohan Chintakuntla <[email protected]>Reviewed-by Simon Glass <[email protected]>(...)
Quoted 13 lines
doc/device-tree-bindings/serial/pl01x.txt Required properties: · line 10
Quoted 11 lines
doc/device-tree-bindings/serial/pl01x.txt +3
-0@@ -5,3 +5,6 @@ Required properties: - reg: exactly one register range with length 0x1000 - clock: input clock frequency for the UART (used to calculate the baud rate divisor) + +Optional properties: +- u-boot,skip-init: skip UART initialization at start.Again: get this merged in the Linux kernel FIRST. Is it?
We had a little bit of a chat about this at ELCE. It would be great to get these changes merged with the kernel but the amount of push-back/energy it requires is still excessive IMO. Any thoughts?
Quoted 7 lines
Quoted 3 lines
But it also requires that we try. Did we try here? My first thought is that there's a number of things it would be nice to say "don't re-init stuff" to the kernel as well.
See the thread that ends here:
Yes, I think maybe Geert was waiting for a reply or respin?
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151019/fa2ff228/attachment.sig>
PATCH v7 5/9 arm: serial: Add ability to use pre-initialized UARTs
In reply to Simon GlassQuoted 7 lines · Simon Glass
Quoted 1 line · Linus Walleij
Again: get this merged in the Linux kernel FIRST. Is it?
We had a little bit of a chat about this at ELCE. It would be great to get these changes merged with the kernel but the amount of push-back/energy it requires is still excessive IMO. Any thoughts?
I'm sorry but DT is standardization, and while I know how stinky it is to be first somewhere and having to pave the road for everyone else, in the long run it's worth it. I think when we switched the entire kernel to DT it was to get "more order", and this is the cost that comes with that order: more review.
I will go in and answer the comment on the DT mailing list so there is some push atleast.
Yours,
Linus Walleij
PATCH v7 5/9 arm: serial: Add ability to use pre-initialized UARTs
Hi Linus,
Quoted 9 lines · Linus Walleij
Quoted 7 lines · Simon Glass
Quoted 1 line · Linus Walleij
Again: get this merged in the Linux kernel FIRST. Is it?
We had a little bit of a chat about this at ELCE. It would be great to get these changes merged with the kernel but the amount of push-back/energy it requires is still excessive IMO. Any thoughts?
Quoted 8 lines
I'm sorry but DT is standardization, and while I know how stinky it is to be first somewhere and having to pave the road for everyone else, in the long run it's worth it. I think when we switched the entire kernel to DT it was to get "more order", and this is the cost that comes with that order: more review.
I will go in and answer the comment on the DT mailing list so there is some push atleast.
Perhaps if we could see some movement then it would provide encouragement to continue. So far I cannot recall seeing a single U-Boot device tree change accepted in the 4 years I've been involved. That's not to say it hasn't happened, and I hope it is just a reflection on my memory rather than the difficulty level.
Regards,
Simon
PATCH v7 5/9 arm: serial: Add ability to use pre-initialized UARTs
Jon & Grant especially:
Quoted 9 lines · Simon Glass
Me
Quoted 2 lines
I will go in and answer the comment on the DT mailing list so there is some push atleast.
Perhaps if we could see some movement then it would provide encouragement to continue. So far I cannot recall seeing a single U-Boot device tree change accepted in the 4 years I've been involved. That's not to say it hasn't happened, and I hope it is just a reflection on my memory rather than the difficulty level.
OK this isn't working.
I think the problem is that DT bindings have traditionally been merged to the kernel by different subsystem maintainers. That means mailing them and their mailing lists and this is IMO too complex for U-Boot people (or other external people) to have to deal with. As subsystem maintainer I'm not very happy about being the one responsible either.
The MAINTAINERS entry for device tree bindings does not state a git tree and I've never seen any of the maintainers send a pull request for DT binding files. (Beat me up properly if you have, guys.) I've seen Grant send some at times.
I suggest sending U-Boot DT bindings to not only devicetree at vger.kernel.org
but also, as indicated, to Jon Corbet and linux-doc.
If noone cares to comment in two weeks, Jon can merge them, breaking the status quo on external DT bindings.
The DT bindings maintainance has sadly been a very sad story and if the Linux kernel should be the canon repository for them, we need to find a simple way for external projects to contribute. Just mailing them to devicetree at vger obviously stands the risk of just ending up in the memory hole.
Jon, are you OK with taking on this or do we need to find another way of funneling external DT bindings? Or do you want to do this Grant?
Yours,
Linus Walleij
Mark Rutland
maintainerPATCH v7 5/9 arm: serial: Add ability to use pre-initialized UARTs
Quoted 21 lines · Linus Walleij
Jon & Grant especially:
Quoted 9 lines · Simon Glass
Me
Quoted 2 lines
I will go in and answer the comment on the DT mailing list so there is some push atleast.
Perhaps if we could see some movement then it would provide encouragement to continue. So far I cannot recall seeing a single U-Boot device tree change accepted in the 4 years I've been involved. That's not to say it hasn't happened, and I hope it is just a reflection on my memory rather than the difficulty level.
OK this isn't working.
I think the problem is that DT bindings have traditionally been merged to the kernel by different subsystem maintainers. That means mailing them and their mailing lists and this is IMO too complex for U-Boot people (or other external people) to have to deal with. As subsystem maintainer I'm not very happy about being the one responsible either.
Quoted 4 lines
The
MAINTAINERSentry for device tree bindings does not state a git tree and I've never seen any of the maintainers send a pull request for DT binding files. (Beat me up properly if you have, guys.) I've seen Grant send some at times.
From Rob Herring
Date Tue, 1 Sep 2015 16:20:13 -0500
Subject [GIT PULL] DeviceTree for 4.3
https://lkml.org/lkml/2015/9/1/526
Quoted 3 lines
I suggest sending U-Boot DT bindings to not only devicetree at vger.kernel.org
but also, as indicated, to Jon Corbet and linux-doc.
I have no problem with patches going to an extended set of lists.
Quoted 8 lines
If noone cares to comment in two weeks, Jon can merge them, breaking the status quo on external DT bindings.
The DT bindings maintainance has sadly been a very sad story and if the Linux kernel should be the canon repository for them, we need to find a simple way for external projects to contribute. Just mailing them to devicetree at vger obviously stands the risk of just ending up in the memory hole.
Rob, we should organise rotating the reponsibility of picking things up.
I'd been meaning to organise something official previously, and this is a good kick to do so.
Thanks,
Mark.
PATCH v7 5/9 arm: serial: Add ability to use pre-initialized UARTs
In reply to Linus WalleijQuoted 12 lines · Linus Walleij
Jon & Grant especially:
Quoted 9 lines · Simon Glass
Me
Quoted 2 lines
I will go in and answer the comment on the DT mailing list so there is some push atleast.
Perhaps if we could see some movement then it would provide encouragement to continue. So far I cannot recall seeing a single U-Boot device tree change accepted in the 4 years I've been involved. That's not to say it hasn't happened, and I hope it is just a reflection on my memory rather than the difficulty level.
Sorry, but anything is with "uboot,*" is going to be an uphill battle. The same is true for "linux,*" properties. There's only 2-3 linux ones that have gone in that timeframe and not without much discussion.
Quoted 8 lines
OK this isn't working.
I think the problem is that DT bindings have traditionally been merged to the kernel by different subsystem maintainers. That means mailing them and their mailing lists and this is IMO too complex for U-Boot people (or other external people) to have to deal with. As subsystem maintainer I'm not very happy about being the one responsible either.
Quoted 4 lines
The
MAINTAINERSentry for device tree bindings does not state a git tree and I've never seen any of the maintainers send a pull request for DT binding files. (Beat me up properly if you have, guys.) I've seen Grant send some at times.
Err, what?
$ git log --merges --grep='Pull.*\(Herring\|Likely\)' --oneline Documentation/devicetree/ 4401555 Merge tag 'devicetree-fixes-for-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux f1a3c0b Merge tag 'devicetree-for-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux 4da3064 Merge tag 'devicetree-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/glikely/linux d56a669 Merge tag 'devicetree-for-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux 7505256 Merge tag 'devicetree-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/glikely/linux 3d52c5b Merge tag 'devicetree-fixes-for-4.0' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux cdd3054 Merge tag 'devicetree-for-3.20' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux b8de08d Merge tag 'devicetree-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/glikely/linux 7ef58b3 Merge tag 'devicetree-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/glikely/linux 2e29a6d Merge tag 'devicetree-fixes-for-3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux e98d6e7 Merge tag 'devicetree-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/glikely/linux 4d3afba Merge tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux ae36e95 Merge tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux d270506 Merge tag 'devicetree-for-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux into next 345ef87 Merge tag 'dt-fixes-for-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux b9f2b21 Merge tag 'dt-for-linus' of git://git.secretlab.ca/git/linux bbb1955 Merge tag 'dt-fixes-for-3.14' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux 4d8880a Merge tag 'devicetree-for-3.14' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux 24cb412 Merge tag 'dt-fixes-for-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux 10d0c97 Merge tag 'devicetree-for-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux 31f7c3a Merge tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux 74b9272 Merge tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux ff9129b Merge tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux 30c67e9 Merge tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux b3cdda2 Merge tag 'dt-for-linus' of git://git.secretlab.ca/git/linux 3aad3f0 Merge tag 'spi-for-linus' of git://git.secretlab.ca/git/linux e327955 Merge tags 'dt-for-linus', 'gpio-for-linus' and 'spi-for-linus' of git://git.secretlab.ca/git/linux-2.6 d3b43e1 Merge tag 'spi-for-linus' of git://git.secretlab.ca/git/linux-2.6 b0885d0 Merge tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux-2.6 b58ed04 Merge tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux-2.6 a54dfb1 Merge tag 'dt-for-3.7' of git://sources.calxeda.com/kernel/linux 7fe0b14 Merge tag 'spi-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc f14121a Merge tag 'dt-for-3.6' of git://sources.calxeda.com/kernel/linux b1bf7d4 Merge tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux-2.6 0708500 Merge tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux-2.6 e152c38 Merge tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux-2.6 7bf97e1 Merge tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux-2.6 5f0e685 Merge tag 'spi-for-linus' of git://git.secretlab.ca/git/linux-2.6 f8974cb Merge tag 'dt-for-linus' of git://git.secretlab.ca/git/linux-2.6
The DT core code and bindings (which don't go thru subsystem trees) go together. The maintainer issues with DT are on binding review bandwidth, not so much on there is no one applying them. I'm sure we've missed things though.
Quoted 3 lines
I suggest sending U-Boot DT bindings to not only devicetree at vger.kernel.org
but also, as indicated, to Jon Corbet and linux-doc.
I'd suggest devicetree-spec at vger for common things. Perhaps we need a better name, but the whole point of this was to separate the common issues from the firehose and have multiple OS participation.
Quoted 2 lines
If noone cares to comment in two weeks, Jon can merge them, breaking the status quo on external DT bindings.
Did someone tell Jon to drink from that firehose?
Quoted 8 lines
The DT bindings maintainance has sadly been a very sad story and if the Linux kernel should be the canon repository for them, we need to find a simple way for external projects to contribute. Just mailing them to devicetree at vger obviously stands the risk of just ending up in the memory hole.
Jon, are you OK with taking on this or do we need to find another way of funneling external DT bindings? Or do you want to do this Grant?
Grant is stepping away from maintainer duties.
In any case, I don't think the problem here is bindings not getting picked up. The instances I'm aware of the bindings were reviewed and commented on.
Rob
Quoted 7 lines
Yours,
Linus Walleij
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
PATCH v7 5/9 arm: serial: Add ability to use pre-initialized UARTs
Quoted 11 lines · Rob Herring
Quoted 4 lines · Linus Walleij
The
MAINTAINERSentry for device tree bindings does not state a git tree and I've never seen any of the maintainers send a pull request for DT binding files. (Beat me up properly if you have, guys.) I've seen Grant send some at times.Err, what?
$ git log --merges --grep='Pull.*\(Herring\|Likely\)' --oneline Documentation/devicetree/
OK nice, bad research from me. My sloppy statement was based on this:
OPEN FIRMWARE AND FLATTENED DEVICE TREE
M: Rob Herring <[email protected]> M: Frank Rowand <[email protected]> M: Grant Likely <[email protected]> L: devicetree at vger.kernel.org W: http://www.devicetree.org/ T: git git://git.kernel.org/pub/scm/linux/kernel/git/glikely/linux.git S: Maintained F: drivers/of/ F: include/linux/of*.h F: scripts/dtc/
Quoted 2 lines
The DT core code and bindings (which don't go thru subsystem trees) go together.
I guess I should just send a patch adding
F: Documentation/devicetree/*
...and hope things get better from that.
Quoted 7 lines
Quoted 3 lines
I suggest sending U-Boot DT bindings to not only devicetree at vger.kernel.org
but also, as indicated, to Jon Corbet and linux-doc.I'd suggest devicetree-spec at vger for common things. Perhaps we need a better name, but the whole point of this was to separate the common issues from the firehose and have multiple OS participation.
Hm, wasn't devicetree at vger.kernel.org supposed to be for that?
Quoted 4 lines
Quoted 2 lines
If noone cares to comment in two weeks, Jon can merge them, breaking the status quo on external DT bindings.
Did someone tell Jon to drink from that firehose?
I'm sorry, I guess this whole mail was something I wrote in light panic over the increasing threat from the separatists.
Yours,
Linus Walleij
PATCH v7 5/9 arm: serial: Add ability to use pre-initialized UARTs
Quoted 23 lines · Linus Walleij
Quoted 6 lines · Rob Herring
On Mon, Oct 19, 2015 at 7:57 AM, Linus Walleij <[email protected]> wrote:
Err, what?
$ git log --merges --grep='Pull.*\(Herring\|Likely\)' --oneline Documentation/devicetree/OK nice, bad research from me. My sloppy statement was based on this:
OPEN FIRMWARE AND FLATTENED DEVICE TREE
M: Rob Herring <[email protected]> M: Frank Rowand <[email protected]> M: Grant Likely <[email protected]> L: devicetree at vger.kernel.org W: http://www.devicetree.org/ T: git git://git.kernel.org/pub/scm/linux/kernel/git/glikely/linux.git S: Maintained F: drivers/of/ F: include/linux/of*.h F: scripts/dtc/
Quoted 8 lines
Quoted 2 lines
The DT core code and bindings (which don't go thru subsystem trees) go together.
I guess I should just send a patch adding
F:
Documentation/devicetree/*...and hope things get better from that.
Ah yeah now I also woke up properly... so there is a special group of people listed under another heading for this, and I should know that, mea culpa.
OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
M: Rob Herring <[email protected]> M: Pawel Moll <[email protected]> M: Mark Rutland <[email protected]> M: Ian Campbell <[email protected]> M: Kumar Gala <[email protected]> L: devicetree at vger.kernel.org S: Maintained F: Documentation/devicetree/ F: arch/*/boot/dts/ F: include/dt-bindings/
So can we add your git tree as T: here and replace Grant's tree in the overall DT entry above it?
Yours,
Linus Walleij
PATCH v7 5/9 arm: serial: Add ability to use pre-initialized UARTs
Quoted 49 lines · Linus Walleij
Quoted 23 lines · Linus Walleij
Quoted 6 lines · Rob Herring
On Mon, Oct 19, 2015 at 7:57 AM, Linus Walleij <[email protected]> wrote:
Err, what?
$ git log --merges --grep='Pull.*\(Herring\|Likely\)' --oneline Documentation/devicetree/OK nice, bad research from me. My sloppy statement was based on this:
OPEN FIRMWARE AND FLATTENED DEVICE TREE
M: Rob Herring <[email protected]> M: Frank Rowand <[email protected]> M: Grant Likely <[email protected]> L: devicetree at vger.kernel.org W: http://www.devicetree.org/ T: git git://git.kernel.org/pub/scm/linux/kernel/git/glikely/linux.git S: Maintained F: drivers/of/ F: include/linux/of*.h F: scripts/dtc/Quoted 8 lines
Quoted 2 lines
The DT core code and bindings (which don't go thru subsystem trees) go together.
I guess I should just send a patch adding
F:
Documentation/devicetree/*...and hope things get better from that.
Ah yeah now I also woke up properly... so there is a special group of people listed under another heading for this, and I should know that, mea culpa.
OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
M: Rob Herring <[email protected]> M: Pawel Moll <[email protected]> M: Mark Rutland <[email protected]> M: Ian Campbell <[email protected]> M: Kumar Gala <[email protected]> L: devicetree at vger.kernel.org S: Maintained F: Documentation/devicetree/ F: arch/*/boot/dts/ F: include/dt-bindings/
Quoted 2 lines
So can we add your git tree as T: here and replace Grant's tree in the overall DT entry above it?
I would hold off. We've not sorted out our workflow yet and may move to a shared repo.
Rob
PATCH v7 5/9 arm: serial: Add ability to use pre-initialized UARTs
Hi,
Quoted 50 lines · Rob Herring
Quoted 49 lines · Linus Walleij
Quoted 23 lines · Linus Walleij
Quoted 6 lines · Rob Herring
On Mon, Oct 19, 2015 at 7:57 AM, Linus Walleij <[email protected]> wrote:
Err, what?
$ git log --merges --grep='Pull.*\(Herring\|Likely\)' --oneline Documentation/devicetree/OK nice, bad research from me. My sloppy statement was based on this:
OPEN FIRMWARE AND FLATTENED DEVICE TREE
M: Rob Herring <[email protected]> M: Frank Rowand <[email protected]> M: Grant Likely <[email protected]> L: devicetree at vger.kernel.org W: http://www.devicetree.org/ T: git git://git.kernel.org/pub/scm/linux/kernel/git/glikely/linux.git S: Maintained F: drivers/of/ F: include/linux/of*.h F: scripts/dtc/Quoted 8 lines
Quoted 2 lines
The DT core code and bindings (which don't go thru subsystem trees) go together.
I guess I should just send a patch adding
F:
Documentation/devicetree/*...and hope things get better from that.
Ah yeah now I also woke up properly... so there is a special group of people listed under another heading for this, and I should know that, mea culpa.
OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
M: Rob Herring <[email protected]> M: Pawel Moll <[email protected]> M: Mark Rutland <[email protected]> M: Ian Campbell <[email protected]> M: Kumar Gala <[email protected]> L: devicetree at vger.kernel.org S: Maintained F: Documentation/devicetree/ F: arch/*/boot/dts/ F: include/dt-bindings/
Quoted 5 lines
Quoted 2 lines
So can we add your git tree as T: here and replace Grant's tree in the overall DT entry above it?
I would hold off. We've not sorted out our workflow yet and may move to a shared repo.
With respect to this patch, I wonder if someone in the 'circle of trust' might draw up a patch to handle skipping init and specifying the input the clock speed? A little bit of progress might go a long way.
Regards,
Simon
PATCH v7 5/9 arm: serial: Add ability to use pre-initialized UARTs
Quoted 56 lines · Simon Glass
Hi,
Quoted 53 lines · Rob Herring
Quoted 51 lines · Linus Walleij
Quoted 23 lines · Linus Walleij
Quoted 6 lines · Rob Herring
On Mon, Oct 19, 2015 at 7:57 AM, Linus Walleij <[email protected]> wrote:
Err, what?
$ git log --merges --grep='Pull.*\(Herring\|Likely\)' --oneline Documentation/devicetree/OK nice, bad research from me. My sloppy statement was based on this:
OPEN FIRMWARE AND FLATTENED DEVICE TREE
M: Rob Herring <[email protected]> M: Frank Rowand <[email protected]> M: Grant Likely <[email protected]> L: devicetree at vger.kernel.org W: http://www.devicetree.org/ T: git git://git.kernel.org/pub/scm/linux/kernel/git/glikely/linux.git S: Maintained F: drivers/of/ F: include/linux/of*.h F: scripts/dtc/Quoted 8 lines
Quoted 2 lines
The DT core code and bindings (which don't go thru subsystem trees) go together.
I guess I should just send a patch adding
F:
Documentation/devicetree/*...and hope things get better from that.
Ah yeah now I also woke up properly... so there is a special group of people listed under another heading for this, and I should know that, mea culpa.
OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
M: Rob Herring <[email protected]> M: Pawel Moll <[email protected]> M: Mark Rutland <[email protected]> M: Ian Campbell <[email protected]> M: Kumar Gala <[email protected]> L: devicetree at vger.kernel.org S: Maintained F: Documentation/devicetree/ F: arch/*/boot/dts/ F: include/dt-bindings/So can we add your git tree as T: here and replace Grant's tree in the overall DT entry above it?
Quoted 7 lines
Quoted 2 lines
I would hold off. We've not sorted out our workflow yet and may move to a shared repo.
With respect to this patch, I wonder if someone in the 'circle of trust' might draw up a patch to handle skipping init and specifying the input the clock speed? A little bit of progress might go a long way.
Or at least "yes, if you do it $this way, we'll take it".. ?
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151023/5dbeb8aa/attachment.sig>
PATCH v7 5/9 arm: serial: Add ability to use pre-initialized UARTs
In reply to Linus WalleijQuoted 28 lines · Linus Walleij
Quoted 11 lines · Rob Herring
Quoted 4 lines · Linus Walleij
The
MAINTAINERSentry for device tree bindings does not state a git tree and I've never seen any of the maintainers send a pull request for DT binding files. (Beat me up properly if you have, guys.) I've seen Grant send some at times.Err, what?
$ git log --merges --grep='Pull.*\(Herring\|Likely\)' --oneline Documentation/devicetree/OK nice, bad research from me. My sloppy statement was based on this:
OPEN FIRMWARE AND FLATTENED DEVICE TREE
M: Rob Herring <[email protected]> M: Frank Rowand <[email protected]> M: Grant Likely <[email protected]> L: devicetree at vger.kernel.org W: http://www.devicetree.org/ T: git git://git.kernel.org/pub/scm/linux/kernel/git/glikely/linux.git S: Maintained F: drivers/of/ F: include/linux/of*.h F: scripts/dtc/
Quoted 6 lines
Quoted 2 lines
The DT core code and bindings (which don't go thru subsystem trees) go together.
I guess I should just send a patch adding
F:
Documentation/devicetree/*
I see you found it is already there...
Quoted 7 lines
...and hope things get better from that.
Quoted 4 lines
Quoted 3 lines
I suggest sending U-Boot DT bindings to not only devicetree at vger.kernel.org
but also, as indicated, to Jon Corbet and linux-doc.
Quoted 5 lines
Quoted 3 lines
I'd suggest devicetree-spec at vger for common things. Perhaps we need a better name, but the whole point of this was to separate the common issues from the firehose and have multiple OS participation.
Hm, wasn't devicetree at vger.kernel.org supposed to be for that?
Yes, but BSD developers complained about all the Linux driver patches, so devicetree-spec was created as was devicetree-compiler to try to separate out the lower volume stuff. We need to do more with MAINTAINERS so that common bindings go to devicetree-spec.
Rob
PATCH v7 5/9 arm: serial: Add ability to use pre-initialized UARTs
In reply to Simon GlassQuoted 18 lines · Simon Glass
Hi Linus,
Quoted 15 lines · Linus Walleij
Quoted 7 lines · Simon Glass
Quoted 1 line · Linus Walleij
Again: get this merged in the Linux kernel FIRST. Is it?
We had a little bit of a chat about this at ELCE. It would be great to get these changes merged with the kernel but the amount of push-back/energy it requires is still excessive IMO. Any thoughts?
I'm sorry but DT is standardization, and while I know how stinky it is to be first somewhere and having to pave the road for everyone else, in the long run it's worth it. I think when we switched the entire kernel to DT it was to get "more order", and this is the cost that comes with that order: more review.
Quoted 8 lines
Quoted 2 lines
I will go in and answer the comment on the DT mailing list so there is some push atleast.
Perhaps if we could see some movement then it would provide encouragement to continue. So far I cannot recall seeing a single U-Boot device tree change accepted in the 4 years I've been involved. That's not to say it hasn't happened, and I hope it is just a reflection on my memory rather than the difficulty level.
I think there's a few things that need to be kept in mind. First, the DT world is changing compared to where it was a year ago, and even more so since August or so (LPC?). There should be less of a stuck in limbo problem. The second is that since we aren't using DT as free-form replacement for values shoved in a C header, it is a lot more work to get things agreed to and merged with our upstream here. And third (and maybe this is where devicetree-spec at vger.kernel.org comes in) is that if this is really going to be some useful and OS-agnostic description of the hardware then yes, we do need some way to say 'here is what the clock freq is once released from ROM'.
All of that said, maybe "no re-init of console port" is not quite right for the UART node (maybe a property of the stdout-path to note this condition as Rob suggests).
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151019/460c60ab/attachment.sig>
PATCH v7 5/9 arm: serial: Add ability to use pre-initialized UARTs
In reply to Sergey TemerkhanovQuoted 7 lines · Sergey Temerkhanov
On some systems, UART initialization is performed before running U-Boot. This commit allows to skip UART re-initializaion on those systems
Signed-off-by Sergey Temerkhanov <[email protected]>Signed-off-by Radha Mohan Chintakuntla <[email protected]>Reviewed-by Simon Glass <[email protected]>
I'll comment on this now that I'm here, but as the rest of the thread said, please send to DT list.
doc/device-tree-bindings/serial/pl01x.txt Required properties: · line 10
Quoted 11 lines
doc/device-tree-bindings/serial/pl01x.txt +3
-0@@ -5,3 +5,6 @@ Required properties: - reg: exactly one register range with length 0x1000 - clock: input clock frequency for the UART (used to calculate the baud rate divisor) + +Optional properties: +- u-boot,skip-init: skip UART initialization at start.
What are you trying to accomplish by skipping?
stdout-path can take options now, so what about making it an option there:
stdout-path = &serial0:no-init
I have similar concerns with this as I did with the early init flag. This requires the dtb and u-boot to be in sync. For example, you have this option in the dtb, but then you add clock initialization to your platform which changes the default clock frequency of the UART. Now if you boot with an older dtb and new u-boot, then it will break because the UART is at the wrong baudrate.
Rob
PATCH v7 5/9 arm: serial: Add ability to use pre-initialized UARTs
Hi Rob,
Quoted 29 lines · Rob Herring
Quoted 7 lines · Sergey Temerkhanov
On some systems, UART initialization is performed before running U-Boot. This commit allows to skip UART re-initializaion on those systems
Signed-off-by Sergey Temerkhanov <[email protected]>Signed-off-by Radha Mohan Chintakuntla <[email protected]>Reviewed-by Simon Glass <[email protected]>I'll comment on this now that I'm here, but as the rest of the thread said, please send to DT list.
doc/device-tree-bindings/serial/pl01x.txt Required properties: · line 10
Quoted 11 lines
doc/device-tree-bindings/serial/pl01x.txt +3
-0@@ -5,3 +5,6 @@ Required properties: - reg: exactly one register range with length 0x1000 - clock: input clock frequency for the UART (used to calculate the baud rate divisor) + +Optional properties: +- u-boot,skip-init: skip UART initialization at start.What are you trying to accomplish by skipping?
stdout-path can take options now, so what about making it an option there:
Quoted 8 lines
stdout-path = &serial0:no-init
I have similar concerns with this as I did with the early init flag. This requires the dtb and u-boot to be in sync. For example, you have this option in the dtb, but then you add clock initialization to your platform which changes the default clock frequency of the UART. Now if you boot with an older dtb and new u-boot, then it will break because the UART is at the wrong baudrate.
If you are saying what I think you are saying, U-Boot expects the device tree that IT uses for configuration to come from the same commit as the source code. It doesn't support anything else as the DTB is bundled with (and replaced at the same time as) U-Boot.. You would be on your own in that case.
Regards,
Simon
PATCH v7 5/9 arm: serial: Add ability to use pre-initialized UARTs
Quoted 41 lines · Simon Glass
Hi Rob,
Quoted 29 lines · Rob Herring
Quoted 7 lines · Sergey Temerkhanov
On some systems, UART initialization is performed before running U-Boot. This commit allows to skip UART re-initializaion on those systems
Signed-off-by Sergey Temerkhanov <[email protected]>Signed-off-by Radha Mohan Chintakuntla <[email protected]>Reviewed-by Simon Glass <[email protected]>I'll comment on this now that I'm here, but as the rest of the thread said, please send to DT list.
doc/device-tree-bindings/serial/pl01x.txt Required properties: · line 10
Quoted 11 lines
doc/device-tree-bindings/serial/pl01x.txt +3
-0@@ -5,3 +5,6 @@ Required properties: - reg: exactly one register range with length 0x1000 - clock: input clock frequency for the UART (used to calculate the baud rate divisor) + +Optional properties: +- u-boot,skip-init: skip UART initialization at start.What are you trying to accomplish by skipping?
stdout-path can take options now, so what about making it an option there:
Quoted 8 lines
stdout-path = &serial0:no-init
I have similar concerns with this as I did with the early init flag. This requires the dtb and u-boot to be in sync. For example, you have this option in the dtb, but then you add clock initialization to your platform which changes the default clock frequency of the UART. Now if you boot with an older dtb and new u-boot, then it will break because the UART is at the wrong baudrate.
Quoted 5 lines
If you are saying what I think you are saying, U-Boot expects the device tree that IT uses for configuration to come from the same commit as the source code. It doesn't support anything else as the DTB is bundled with (and replaced at the same time as) U-Boot.. You would be on your own in that case.
You can have that expectation, but that is generally not how DT works. Bindings are an ABI. You may not care for some usecases or boards, but we generally can't assume a DTB and its user whether u-boot, kernel, BSD, etc. are linked together. The rule is new s/w version should work with old DTB.
How is it going to work when/if we put dts files in a standalone repository?
What I want to see WRT u-boot and DTB handling is that they are independently updateable. That is already the case on some platforms such as highbank. The way it works is the management processor put both u-boot and the DTB into memory and then boots the cores. u-boot does minor tweaks and then passes the DTB on to the OS. I was working some to add u-boot DT config support for highbank before Calxeda's demise. IIRC, the main problems I hit were telling u-boot where the dtb is and then having it pass the same DTB on to the kernel. I doubt I'm the only one that would like things to work that way.
Rob
PATCH v7 5/9 arm: serial: Add ability to use pre-initialized UARTs
Hi Rob,
Quoted 56 lines · Rob Herring
Quoted 41 lines · Simon Glass
Hi Rob,
Quoted 29 lines · Rob Herring
Quoted 7 lines · Sergey Temerkhanov
On some systems, UART initialization is performed before running U-Boot. This commit allows to skip UART re-initializaion on those systems
Signed-off-by Sergey Temerkhanov <[email protected]>Signed-off-by Radha Mohan Chintakuntla <[email protected]>Reviewed-by Simon Glass <[email protected]>I'll comment on this now that I'm here, but as the rest of the thread said, please send to DT list.
doc/device-tree-bindings/serial/pl01x.txt Required properties: · line 10
Quoted 11 lines
doc/device-tree-bindings/serial/pl01x.txt +3
-0@@ -5,3 +5,6 @@ Required properties: - reg: exactly one register range with length 0x1000 - clock: input clock frequency for the UART (used to calculate the baud rate divisor) + +Optional properties: +- u-boot,skip-init: skip UART initialization at start.What are you trying to accomplish by skipping?
stdout-path can take options now, so what about making it an option there:
Quoted 8 lines
stdout-path = &serial0:no-init
I have similar concerns with this as I did with the early init flag. This requires the dtb and u-boot to be in sync. For example, you have this option in the dtb, but then you add clock initialization to your platform which changes the default clock frequency of the UART. Now if you boot with an older dtb and new u-boot, then it will break because the UART is at the wrong baudrate.
Quoted 5 lines
If you are saying what I think you are saying, U-Boot expects the device tree that IT uses for configuration to come from the same commit as the source code. It doesn't support anything else as the DTB is bundled with (and replaced at the same time as) U-Boot.. You would be on your own in that case.
You can have that expectation, but that is generally not how DT works. Bindings are an ABI. You may not care for some usecases or boards, but we generally can't assume a DTB and its user whether u-boot, kernel, BSD, etc. are linked together. The rule is new s/w version should work with old DTB.
How is it going to work when/if we put dts files in a standalone repository?
Quoted 9 lines
What I want to see WRT u-boot and DTB handling is that they are independently updateable. That is already the case on some platforms such as highbank. The way it works is the management processor put both u-boot and the DTB into memory and then boots the cores. u-boot does minor tweaks and then passes the DTB on to the OS. I was working some to add u-boot DT config support for highbank before Calxeda's demise. IIRC, the main problems I hit were telling u-boot where the dtb is and then having it pass the same DTB on to the kernel. I doubt I'm the only one that would like things to work that way.
I don't see that this is a requirement. Also I don't think it makes sense.
U-Boot and Linux have quite different field-upgrade cycles. It is quite common to update the kernel without updating U-Boot, and vice versa. Some platforms will never update U-Boot. Some platforms have U-Boot in one medium (sometimes even read-only) and Linux in another. When updating the kernel I would expect the kernel device tree to be updated also - e.g. a new FIT image containing the kernel and device tree files. This is because we may have new drivers or enhanced features there were not defined in the earlier device tre.
When updating U-Boot I would expect U-Boot's device tree to update also, without affecting the one passed to the kernel. Similar to the above there may be new features or enhancements that require this.
If there is ever a stand-alone repository then we can revisit this discussion, but I doubt it makes much different for U-Boot at least, which requires the device tree to complete its build. Maybe something has changed recently to suggest things will go that way, but as far as I recall it has been talked about for 4 years.
It should be possible for the U-Boot project to decide how it uses device tree.
Regards,
Simon
PATCH v7 5/9 arm: serial: Add ability to use pre-initialized UARTs
In reply to Rob HerringQuoted 27 lines · Rob Herring
Quoted 7 lines · Sergey Temerkhanov
On some systems, UART initialization is performed before running U-Boot. This commit allows to skip UART re-initializaion on those systems
Signed-off-by Sergey Temerkhanov <[email protected]>Signed-off-by Radha Mohan Chintakuntla <[email protected]>Reviewed-by Simon Glass <[email protected]>I'll comment on this now that I'm here, but as the rest of the thread said, please send to DT list.
doc/device-tree-bindings/serial/pl01x.txt Required properties: · line 10
Quoted 11 lines
doc/device-tree-bindings/serial/pl01x.txt +3
-0@@ -5,3 +5,6 @@ Required properties: - reg: exactly one register range with length 0x1000 - clock: input clock frequency for the UART (used to calculate the baud rate divisor) + +Optional properties: +- u-boot,skip-init: skip UART initialization at start.What are you trying to accomplish by skipping?
Quoted 3 lines
stdout-path can take options now, so what about making it an option there:
stdout-path = &serial0:no-init
It's not about a single UART but all UARTs present in the platform. Some of them might have different reference clocks/PLL settings/whatever which can be tricky to support with FDT editing/rebuilding/etc. Especially if those reference clocks can be
reprogrammed between runs.
Quoted 7 lines
I have similar concerns with this as I did with the early init flag. This requires the dtb and u-boot to be in sync. For example, you have this option in the dtb, but then you add clock initialization to your platform which changes the default clock frequency of the UART. Now if you boot with an older dtb and new u-boot, then it will break because the UART is at the wrong baudrate.
It's not a problem at all since the U-Boot image with an attached DTB is being used. And that DTB comes from the U-Boot source tree.
Quoted 2 lines
Rob
PATCH v7 5/9 arm: serial: Add ability to use pre-initialized UARTs
In reply to Sergey TemerkhanovQuoted 6 lines · Sergey Temerkhanov
On some systems, UART initialization is performed before running U-Boot. This commit allows to skip UART re-initializaion on those systems
Signed-off-by Sergey Temerkhanov <[email protected]>Signed-off-by Radha Mohan Chintakuntla <[email protected]>Reviewed-by Simon Glass <[email protected]>
In the end, this appears to have become mired in a lack of getting a device tree binding for this functionality in particular to be accepted upstream from us. I'm deferring on this particular version until someone with the time and desire to resolve the binding does so.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160119/f1c00f3d/attachment.sig>
PATCH v7 6/9 armv8: cavium: Add the device tree for ThunderX
In reply to Sergey TemerkhanovThis commit adds the FDT for the ThunderX family of SoCs
---
Changes in v7: None
Changes in v6:
- Added /chosen node
Changes in v5:
- Added FDT for ThunderX 88xx series
Changes in v4: None
Changes in v3: None
Changes in v2: None
arch/arm/dts/Makefile | 1 + arch/arm/dts/thunderx-88xx.dts | 31 ++++ arch/arm/dts/thunderx-88xx.dtsi | 363 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 395 insertions(+) create mode 100644 arch/arm/dts/thunderx-88xx.dts create mode 100644 arch/arm/dts/thunderx-88xx.dtsi
arch/arm/dts/Makefile +1 -0
@@ -61,6 +61,7 @@ dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb \ zynq-zc770-xm012.dtb \ zynq-zc770-xm013.dtb dtb-$(CONFIG_AM33XX) += am335x-boneblack.dtb am335x-evm.dtb +dtb-$(CONFIG_THUNDERX) += thunderx-88xx.dtb dtb-$(CONFIG_ARCH_SOCFPGA) += \ socfpga_arria5_socdk.dtb \
arch/arm/dts/thunderx-88xx.dts new file +31 -0
@@ -0,0 +1,31 @@ +/* + * Cavium Thunder DTS file - Thunder board description + * + * Copyright (C) 2014, Cavium Inc. + * + * SPDX-License-Identifier: GPL-2.0+ or X11 + * + */ + +/dts-v1/; + +/include/ "thunderx-88xx.dtsi" + +/ { + model = "Cavium ThunderX CN88XX board"; + compatible = "cavium,thunder-88xx"; + + aliases { + serial0 = &uaa0; + serial1 = &uaa1; + }; + + chosen { + stdout-path = &uaa0; + }; + + memory at 00000000 { + device_type = "memory"; + reg = <0x0 0x00000000 0x0 0x80000000>; + }; +};
arch/arm/dts/thunderx-88xx.dtsi new file +363 -0
363 lines not on this page · raw message
Signature · 1 line
2.1.4
PATCH v7 6/9 armv8: cavium: Add the device tree for ThunderX
Quoted 6 lines · Sergey Temerkhanov
This commit adds the FDT for the ThunderX family of SoCs
Signed-off-by Sergey Temerkhanov <[email protected]>Signed-off-by Radha Mohan Chintakuntla <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160119/39da67eb/attachment.sig>
PATCH v7 7/9 armv8: cavium: Add ThunderX 88xx board definition
In reply to Sergey TemerkhanovThis commit adds basic Cavium ThunderX 88xx board definitions and support.
---
Changes in v7:
- Removed rebase/merge residue
- Added CONFIG_CMD_ATF
- Updated defconfig
- Fixed typo in the 'uboot,skip-init' preperty
Changes in v6:
- Added 'u-boot,skip-init' property to the FDT
Changes in v5:
- Added CONFIG_OF_CONTROL support
- Changed memory attributes
Changes in v4:
- Moved CONFIG_SYS_PROMPT to configs/thunderx_88xx_defconfig
- Added proper DM_SERIAL definitions
Changes in v3:
- Fixed formatting
- Added MAINTAINERS
- Moved command definitions to defconfig
Changes in v2: None
arch/arm/Kconfig | 5 ++ arch/arm/dts/thunderx-88xx.dtsi | 4 +- board/cavium/thunderx/Kconfig | 27 +++++++ board/cavium/thunderx/MAINTAINERS | 6 ++ board/cavium/thunderx/Makefile | 8 +++ board/cavium/thunderx/thunderx.c | 75 ++++++++++++++++++++ configs/thunderx_88xx_defconfig | 24 +++++++ include/configs/thunderx_88xx.h | 145 ++++++++++++++++++++++++++++++++++++++ 8 files changed, 292 insertions(+), 2 deletions(-) create mode 100644 board/cavium/thunderx/Kconfig create mode 100644 board/cavium/thunderx/MAINTAINERS create mode 100644 board/cavium/thunderx/Makefile create mode 100644 board/cavium/thunderx/thunderx.c create mode 100644 configs/thunderx_88xx_defconfig create mode 100644 include/configs/thunderx_88xx.h
arch/arm/Kconfig +5 -0
@@ -666,6 +666,10 @@ config ARCH_ROCKCHIP select CPU_V7 select DM +config TARGET_THUNDERX_88XX + bool "Support ThunderX 88xx" + select OF_CONTROL + endchoice source "arch/arm/mach-at91/Kconfig"
@@ -734,6 +738,7 @@ source "board/bluegiga/apx4devkit/Kconfig" source "board/broadcom/bcm28155_ap/Kconfig" source "board/broadcom/bcmcygnus/Kconfig" source "board/broadcom/bcmnsp/Kconfig" +source "board/cavium/thunderx/Kconfig" source "board/cirrus/edb93xx/Kconfig" source "board/compulab/cm_t335/Kconfig" source "board/compulab/cm_t43/Kconfig"
arch/arm/dts/thunderx-88xx.dtsi +2 -2
@@ -348,7 +348,7 @@ interrupts = <1 21 4>; clocks = <&refclk50mhz>; clock-names = "apb_pclk"; - flags = <1>; + uboot,skip-init; }; uaa1: serial at 87e0,25000000 {
@@ -357,7 +357,7 @@ interrupts = <1 22 4>; clocks = <&refclk50mhz>; clock-names = "apb_pclk"; - flags = <1>; + uboot,skip-init; }; }; };
board/cavium/thunderx/Kconfig new file +27 -0
@@ -0,0 +1,27 @@ +if TARGET_THUNDERX_88XX + +config SYS_CPU + string + default "armv8" + +config SYS_BOARD + string + default "thunderx" + +config SYS_VENDOR + string + default "cavium" + +config SYS_CONFIG_NAME + string + default "thunderx_88xx" + +config CMD_ATF + bool "Enable ATF query commands" + default y + help + Enable vendor specific ATF query commands such as SPI and SD/MMC + devices access, low level environment query, boot device layout + and node count. + +endif
board/cavium/thunderx/MAINTAINERS new file +6 -0
@@ -0,0 +1,6 @@ +THUNDERX BOARD +M: Sergey Temerkhanov <[email protected]> +S: Maintained +F: board/cavium/thunderx/ +F: include/configs/thunderx_88xx.h +F: configs/thunderx_88xx_defconfig
board/cavium/thunderx/Makefile new file +8 -0
@@ -0,0 +1,8 @@ +# +# +# (C) Copyright 2014, Cavium Inc. +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y := thunderx.o
board/cavium/thunderx/thunderx.c new file +75 -0
75 lines not on this page · raw message
configs/thunderx_88xx_defconfig new file +24 -0
@@ -0,0 +1,24 @@ +CONFIG_ARM=y +CONFIG_TARGET_THUNDERX_88XX=y +CONFIG_DM_SERIAL=y +CONFIG_DEFAULT_DEVICE_TREE="thunderx-88xx" +CONFIG_SYS_EXTRA_OPTIONS="ARM64" +CONFIG_HUSH_PARSER=y +CONFIG_SYS_PROMPT="ThunderX_88XX> " +# CONFIG_CMD_IMLS is not set +# CONFIG_CMD_EXPORTENV is not set +# CONFIG_CMD_IMPORTENV is not set +# CONFIG_CMD_EDITENV is not set +# CONFIG_CMD_SAVEENV is not set +# CONFIG_CMD_ENV_EXISTS is not set +# CONFIG_CMD_FLASH is not set +# CONFIG_CMD_FPGA is not set +# CONFIG_CMD_NET is not set +# CONFIG_CMD_NFS is not set +CONFIG_DM=y +CONFIG_DEBUG_UART=y +CONFIG_DEBUG_UART_PL011=y +CONFIG_DEBUG_UART_BASE=0x87e024000000 +CONFIG_DEBUG_UART_CLOCK=24000000 +CONFIG_DEBUG_UART_SKIP_INIT=y +CONFIG_REGEX=y
include/configs/thunderx_88xx.h new file +145 -0
145 lines not on this page · raw message
Signature · 1 line
2.1.4
PATCH v7 7/9 armv8: cavium: Add ThunderX 88xx board definition
Quoted 4 lines · Sergey Temerkhanov
This commit adds basic Cavium ThunderX 88xx board definitions and support.
Signed-off-by Sergey Temerkhanov <[email protected]>Signed-off-by Radha Mohan Chintakuntla <[email protected]>
With a minor change for current API, applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160119/6331ebd4/attachment.sig>
PATCH v7 8/9 armv8: cavium: Add an implementation of ATF calling functions
In reply to Sergey TemerkhanovThis commit adds functions issuing calls to the product-specific ATF services
---
Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None
board/cavium/thunderx/Makefile | 2 +- board/cavium/thunderx/atf.c | 312 ++++++++++++++++++++++++++++++++++++++++ include/cavium/atf.h | 22 +++ include/cavium/atf_part.h | 26 ++++ include/cavium/thunderx_svc.h | 67 +++++++++ include/configs/thunderx_88xx.h | 2 + 6 files changed, 430 insertions(+), 1 deletion(-) create mode 100644 board/cavium/thunderx/atf.c create mode 100644 include/cavium/atf.h create mode 100644 include/cavium/atf_part.h create mode 100644 include/cavium/thunderx_svc.h
board/cavium/thunderx/Makefile +1 -1
@@ -5,4 +5,4 @@ # SPDX-License-Identifier: GPL-2.0+ # -obj-y := thunderx.o +obj-y := thunderx.o atf.o
board/cavium/thunderx/atf.c new file +312 -0
312 lines not on this page · raw message
include/cavium/atf.h new file +22 -0
@@ -0,0 +1,22 @@ +/** +* (C) Copyright 2014, Cavium Inc. +* +* SPDX-License-Identifier: GPL-2.0+ +**/ +#ifndef __ATF_H__ +#define __ATF_H__ +#include <cavium/atf_part.h> + +ssize_t atf_read_mmc (uintptr_t offset,void *buffer,size_t size); +ssize_t atf_read_nor (uintptr_t offset,void *buffer,size_t size); +ssize_t atf_get_pcount (void ); +ssize_t atf_get_part (struct storage_partition *part,unsigned int index); +ssize_t atf_erase_nor (uintptr_t offset,size_t size); +ssize_t atf_write_nor (uintptr_t offset,const void *buffer,size_t size); +ssize_t atf_write_mmc (uintptr_t offset,const void *buffer,size_t size); +ssize_t atf_dram_size (unsigned int node); +ssize_t atf_node_count (void ); +ssize_t atf_env_count (void ); +ssize_t atf_env_string (size_t index,char *str); + +#endif
include/cavium/atf_part.h new file +26 -0
@@ -0,0 +1,26 @@ +/** +* (C) Copyright 2014, Cavium Inc. +* +* SPDX-License-Identifier: GPL-2.0+ +**/ + +#ifndef __ATF_PART_H__ +#define __ATF_PART_H__ + +struct storage_partition { +unsigned int type; +unsigned int size; +unsigned long offset; +}; + +enum { +PARTITION_NBL1FW_REST =0 , +PARTITION_BL2_BL31 =1 , +PARTITION_UBOOT =2 , +PARTITION_UEFI =2 , +PARTITION_KERNEL =3 , +PARTITION_DEVICE_TREE =4 , +PARTITION_LAST , +}; + +#endif
include/cavium/thunderx_svc.h new file +67 -0
67 lines not on this page · raw message
include/configs/thunderx_88xx.h +2 -0
@@ -28,6 +28,8 @@#define CONFIG_SYS_FULL_VA +#define CONFIG_SYS_LOWMEM_BASE MEM_BASE +#define CONFIG_SYS_MEM_MAP {{0x000000000000UL, 0x40000000000UL, \ PTL2_MEMTYPE(MT_NORMAL) | \ PTL2_BLOCK_NON_SHARE}, \
Signature · 1 line
2.1.4
PATCH v7 8/9 armv8: cavium: Add an implementation of ATF calling functions
Quoted 5 lines · Sergey Temerkhanov
This commit adds functions issuing calls to the product-specific ATF services
Signed-off-by Sergey Temerkhanov <[email protected]>Signed-off-by Radha Mohan Chintakuntla <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160119/223b9f0a/attachment.sig>
PATCH v7 9/9 armv8: cavium: Get DRAM size from ATF
In reply to Sergey TemerkhanovChange the dram_init() function on ThunderX to query ATF services for the real installed DRAM size
---
Changes in v7: None
Changes in v6: None
Changes in v5:
- Moved dram_init() from a separate file to thunderx.c
Changes in v4: None
Changes in v3: None
Changes in v2: None
board/cavium/thunderx/thunderx.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
board/cavium/thunderx/thunderx.c +27 -0
@@ -9,6 +9,8 @@#include <errno.h> #include <linux/compiler.h> +#include <cavium/atf.h> +#if !CONFIG_IS_ENABLED (OF_CONTROL )#include <dm/platdata.h> #include <dm/platform_data/serial_pl01x.h>
@@ -50,6 +52,31 @@ int timer_init(void)return 0 ; } +int dram_init (void ) +{ +ssize_t node_count =atf_node_count (); +ssize_t dram_size; +int node; + +printf ("Initializing\nNodes in system: %zd\n" , node_count); + + gd->ram_size =0 ; + +for (node =0 ; node < node_count; node++) { + dram_size =atf_dram_size (node); +printf ("Node %d: %zd MBytes of DRAM\n" , node, dram_size >>20 ); + gd->ram_size += dram_size; + } + + gd->ram_size -=MEM_BASE ; + + *(unsigned long *)CPU_RELEASE_ADDR =0 ; + +puts ("DRAM size:" ); + +return 0 ; +} +/* * Board specific reset that is system reset. */
Signature · 1 line
2.1.4
PATCH v7 9/9 armv8: cavium: Get DRAM size from ATF
Quoted 5 lines · Sergey Temerkhanov
Change the
dram_init()function on ThunderX to query ATF services for the real installed DRAM sizeSigned-off-by Sergey Temerkhanov <[email protected]>Signed-off-by Radha Mohan Chintakuntla <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160119/0f2a34c8/attachment.sig>