mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-10 23:33:01 -04:00
Merge branch 'for-5.11/elecom' into for-linus
- support for EX-G M-XGL20DLBK device, from YOSHIOKA Takuma
This commit is contained in:
@@ -53,6 +53,24 @@ enum {
|
||||
GHES_SEV_PANIC = 0x3,
|
||||
};
|
||||
|
||||
#ifdef CONFIG_ACPI_APEI_GHES
|
||||
/**
|
||||
* ghes_register_vendor_record_notifier - register a notifier for vendor
|
||||
* records that the kernel would otherwise ignore.
|
||||
* @nb: pointer to the notifier_block structure of the event handler.
|
||||
*
|
||||
* return 0 : SUCCESS, non-zero : FAIL
|
||||
*/
|
||||
int ghes_register_vendor_record_notifier(struct notifier_block *nb);
|
||||
|
||||
/**
|
||||
* ghes_unregister_vendor_record_notifier - unregister the previously
|
||||
* registered vendor record notifier.
|
||||
* @nb: pointer to the notifier_block structure of the vendor record handler.
|
||||
*/
|
||||
void ghes_unregister_vendor_record_notifier(struct notifier_block *nb);
|
||||
#endif
|
||||
|
||||
int ghes_estatus_pool_init(int num_ghes);
|
||||
|
||||
/* From drivers/edac/ghes_edac.c */
|
||||
|
||||
@@ -39,6 +39,7 @@ mandatory-y += mmiowb.h
|
||||
mandatory-y += mmu.h
|
||||
mandatory-y += mmu_context.h
|
||||
mandatory-y += module.h
|
||||
mandatory-y += module.lds.h
|
||||
mandatory-y += msi.h
|
||||
mandatory-y += pci.h
|
||||
mandatory-y += percpu.h
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#include <linux/compiler.h>
|
||||
#include <asm/rwonce.h>
|
||||
|
||||
#ifndef nop
|
||||
|
||||
@@ -141,7 +141,7 @@ void __warn(const char *file, int line, void *caller, unsigned taint,
|
||||
|
||||
#ifndef WARN_ON_ONCE
|
||||
#define WARN_ON_ONCE(condition) ({ \
|
||||
static bool __section(.data.once) __warned; \
|
||||
static bool __section(".data.once") __warned; \
|
||||
int __ret_warn_once = !!(condition); \
|
||||
\
|
||||
if (unlikely(__ret_warn_once && !__warned)) { \
|
||||
@@ -153,7 +153,7 @@ void __warn(const char *file, int line, void *caller, unsigned taint,
|
||||
#endif
|
||||
|
||||
#define WARN_ONCE(condition, format...) ({ \
|
||||
static bool __section(.data.once) __warned; \
|
||||
static bool __section(".data.once") __warned; \
|
||||
int __ret_warn_once = !!(condition); \
|
||||
\
|
||||
if (unlikely(__ret_warn_once && !__warned)) { \
|
||||
@@ -164,7 +164,7 @@ void __warn(const char *file, int line, void *caller, unsigned taint,
|
||||
})
|
||||
|
||||
#define WARN_TAINT_ONCE(condition, taint, format...) ({ \
|
||||
static bool __section(.data.once) __warned; \
|
||||
static bool __section(".data.once") __warned; \
|
||||
int __ret_warn_once = !!(condition); \
|
||||
\
|
||||
if (unlikely(__ret_warn_once && !__warned)) { \
|
||||
|
||||
@@ -25,7 +25,7 @@ struct pt_regs;
|
||||
*/
|
||||
#define ALLOW_ERROR_INJECTION(fname, _etype) \
|
||||
static struct error_injection_entry __used \
|
||||
__attribute__((__section__("_error_injection_whitelist"))) \
|
||||
__section("_error_injection_whitelist") \
|
||||
_eil_addr_##fname = { \
|
||||
.addr = (unsigned long)fname, \
|
||||
.etype = EI_ETYPE_##_etype, \
|
||||
|
||||
@@ -911,18 +911,6 @@ static inline void iowrite64_rep(volatile void __iomem *addr,
|
||||
#include <linux/vmalloc.h>
|
||||
#define __io_virt(x) ((void __force *)(x))
|
||||
|
||||
#ifndef CONFIG_GENERIC_IOMAP
|
||||
struct pci_dev;
|
||||
extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
|
||||
|
||||
#ifndef pci_iounmap
|
||||
#define pci_iounmap pci_iounmap
|
||||
static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
#endif /* CONFIG_GENERIC_IOMAP */
|
||||
|
||||
/*
|
||||
* Change virtual addresses to physical addresses and vv.
|
||||
* These are pretty trivial
|
||||
@@ -1016,6 +1004,16 @@ static inline void __iomem *ioport_map(unsigned long port, unsigned int nr)
|
||||
port &= IO_SPACE_LIMIT;
|
||||
return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port;
|
||||
}
|
||||
#define __pci_ioport_unmap __pci_ioport_unmap
|
||||
static inline void __pci_ioport_unmap(void __iomem *p)
|
||||
{
|
||||
uintptr_t start = (uintptr_t) PCI_IOBASE;
|
||||
uintptr_t addr = (uintptr_t) p;
|
||||
|
||||
if (addr >= start && addr < start + IO_SPACE_LIMIT)
|
||||
return;
|
||||
iounmap(p);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef ioport_unmap
|
||||
@@ -1030,6 +1028,23 @@ extern void ioport_unmap(void __iomem *p);
|
||||
#endif /* CONFIG_GENERIC_IOMAP */
|
||||
#endif /* CONFIG_HAS_IOPORT_MAP */
|
||||
|
||||
#ifndef CONFIG_GENERIC_IOMAP
|
||||
struct pci_dev;
|
||||
extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
|
||||
|
||||
#ifndef __pci_ioport_unmap
|
||||
static inline void __pci_ioport_unmap(void __iomem *p) {}
|
||||
#endif
|
||||
|
||||
#ifndef pci_iounmap
|
||||
#define pci_iounmap pci_iounmap
|
||||
static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p)
|
||||
{
|
||||
__pci_ioport_unmap(p);
|
||||
}
|
||||
#endif
|
||||
#endif /* CONFIG_GENERIC_IOMAP */
|
||||
|
||||
/*
|
||||
* Convert a virtual cached pointer to an uncached pointer
|
||||
*/
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
*/
|
||||
# define __NOKPROBE_SYMBOL(fname) \
|
||||
static unsigned long __used \
|
||||
__attribute__((__section__("_kprobe_blacklist"))) \
|
||||
__section("_kprobe_blacklist") \
|
||||
_kbl_addr_##fname = (unsigned long)fname;
|
||||
# define NOKPROBE_SYMBOL(fname) __NOKPROBE_SYMBOL(fname)
|
||||
/* Use this to forbid a kprobes attach on very low level functions */
|
||||
# define __kprobes __attribute__((__section__(".kprobes.text")))
|
||||
# define __kprobes __section(".kprobes.text")
|
||||
# define nokprobe_inline __always_inline
|
||||
#else
|
||||
# define NOKPROBE_SYMBOL(fname)
|
||||
|
||||
10
include/asm-generic/module.lds.h
Normal file
10
include/asm-generic/module.lds.h
Normal file
@@ -0,0 +1,10 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef __ASM_GENERIC_MODULE_LDS_H
|
||||
#define __ASM_GENERIC_MODULE_LDS_H
|
||||
|
||||
/*
|
||||
* <asm/module.lds.h> can specify arch-specific sections for linking modules.
|
||||
* Empty for the asm-generic header.
|
||||
*/
|
||||
|
||||
#endif /* __ASM_GENERIC_MODULE_LDS_H */
|
||||
@@ -89,7 +89,7 @@ static inline void vmbus_signal_eom(struct hv_message *msg, u32 old_msg_type)
|
||||
}
|
||||
}
|
||||
|
||||
void hv_setup_vmbus_irq(void (*handler)(void));
|
||||
int hv_setup_vmbus_irq(int irq, void (*handler)(void));
|
||||
void hv_remove_vmbus_irq(void);
|
||||
void hv_enable_vmbus_irq(void);
|
||||
void hv_disable_vmbus_irq(void);
|
||||
@@ -99,6 +99,8 @@ void hv_remove_kexec_handler(void);
|
||||
void hv_setup_crash_handler(void (*handler)(struct pt_regs *regs));
|
||||
void hv_remove_crash_handler(void);
|
||||
|
||||
extern int vmbus_interrupt;
|
||||
|
||||
#if IS_ENABLED(CONFIG_HYPERV)
|
||||
/*
|
||||
* Hypervisor's notion of virtual processor ID is different from
|
||||
|
||||
@@ -114,21 +114,21 @@ do { \
|
||||
|
||||
#define __this_cpu_generic_read_nopreempt(pcp) \
|
||||
({ \
|
||||
typeof(pcp) __ret; \
|
||||
typeof(pcp) ___ret; \
|
||||
preempt_disable_notrace(); \
|
||||
__ret = READ_ONCE(*raw_cpu_ptr(&(pcp))); \
|
||||
___ret = READ_ONCE(*raw_cpu_ptr(&(pcp))); \
|
||||
preempt_enable_notrace(); \
|
||||
__ret; \
|
||||
___ret; \
|
||||
})
|
||||
|
||||
#define __this_cpu_generic_read_noirq(pcp) \
|
||||
({ \
|
||||
typeof(pcp) __ret; \
|
||||
unsigned long __flags; \
|
||||
raw_local_irq_save(__flags); \
|
||||
__ret = raw_cpu_generic_read(pcp); \
|
||||
raw_local_irq_restore(__flags); \
|
||||
__ret; \
|
||||
typeof(pcp) ___ret; \
|
||||
unsigned long ___flags; \
|
||||
raw_local_irq_save(___flags); \
|
||||
___ret = raw_cpu_generic_read(pcp); \
|
||||
raw_local_irq_restore(___flags); \
|
||||
___ret; \
|
||||
})
|
||||
|
||||
#define this_cpu_generic_read(pcp) \
|
||||
|
||||
@@ -10,28 +10,78 @@
|
||||
#include <linux/string.h>
|
||||
|
||||
#ifdef CONFIG_UACCESS_MEMCPY
|
||||
#include <asm/unaligned.h>
|
||||
|
||||
static __always_inline int
|
||||
__get_user_fn(size_t size, const void __user *from, void *to)
|
||||
{
|
||||
BUILD_BUG_ON(!__builtin_constant_p(size));
|
||||
|
||||
switch (size) {
|
||||
case 1:
|
||||
*(u8 *)to = get_unaligned((u8 __force *)from);
|
||||
return 0;
|
||||
case 2:
|
||||
*(u16 *)to = get_unaligned((u16 __force *)from);
|
||||
return 0;
|
||||
case 4:
|
||||
*(u32 *)to = get_unaligned((u32 __force *)from);
|
||||
return 0;
|
||||
case 8:
|
||||
*(u64 *)to = get_unaligned((u64 __force *)from);
|
||||
return 0;
|
||||
default:
|
||||
BUILD_BUG();
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
#define __get_user_fn(sz, u, k) __get_user_fn(sz, u, k)
|
||||
|
||||
static __always_inline int
|
||||
__put_user_fn(size_t size, void __user *to, void *from)
|
||||
{
|
||||
BUILD_BUG_ON(!__builtin_constant_p(size));
|
||||
|
||||
switch (size) {
|
||||
case 1:
|
||||
put_unaligned(*(u8 *)from, (u8 __force *)to);
|
||||
return 0;
|
||||
case 2:
|
||||
put_unaligned(*(u16 *)from, (u16 __force *)to);
|
||||
return 0;
|
||||
case 4:
|
||||
put_unaligned(*(u32 *)from, (u32 __force *)to);
|
||||
return 0;
|
||||
case 8:
|
||||
put_unaligned(*(u64 *)from, (u64 __force *)to);
|
||||
return 0;
|
||||
default:
|
||||
BUILD_BUG();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#define __put_user_fn(sz, u, k) __put_user_fn(sz, u, k)
|
||||
|
||||
#define __get_kernel_nofault(dst, src, type, err_label) \
|
||||
do { \
|
||||
*((type *)dst) = get_unaligned((type *)(src)); \
|
||||
if (0) /* make sure the label looks used to the compiler */ \
|
||||
goto err_label; \
|
||||
} while (0)
|
||||
|
||||
#define __put_kernel_nofault(dst, src, type, err_label) \
|
||||
do { \
|
||||
put_unaligned(*((type *)src), (type *)(dst)); \
|
||||
if (0) /* make sure the label looks used to the compiler */ \
|
||||
goto err_label; \
|
||||
} while (0)
|
||||
|
||||
#define HAVE_GET_KERNEL_NOFAULT 1
|
||||
|
||||
static inline __must_check unsigned long
|
||||
raw_copy_from_user(void *to, const void __user * from, unsigned long n)
|
||||
{
|
||||
if (__builtin_constant_p(n)) {
|
||||
switch(n) {
|
||||
case 1:
|
||||
*(u8 *)to = *(u8 __force *)from;
|
||||
return 0;
|
||||
case 2:
|
||||
*(u16 *)to = *(u16 __force *)from;
|
||||
return 0;
|
||||
case 4:
|
||||
*(u32 *)to = *(u32 __force *)from;
|
||||
return 0;
|
||||
#ifdef CONFIG_64BIT
|
||||
case 8:
|
||||
*(u64 *)to = *(u64 __force *)from;
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
memcpy(to, (const void __force *)from, n);
|
||||
return 0;
|
||||
}
|
||||
@@ -39,27 +89,6 @@ raw_copy_from_user(void *to, const void __user * from, unsigned long n)
|
||||
static inline __must_check unsigned long
|
||||
raw_copy_to_user(void __user *to, const void *from, unsigned long n)
|
||||
{
|
||||
if (__builtin_constant_p(n)) {
|
||||
switch(n) {
|
||||
case 1:
|
||||
*(u8 __force *)to = *(u8 *)from;
|
||||
return 0;
|
||||
case 2:
|
||||
*(u16 __force *)to = *(u16 *)from;
|
||||
return 0;
|
||||
case 4:
|
||||
*(u32 __force *)to = *(u32 *)from;
|
||||
return 0;
|
||||
#ifdef CONFIG_64BIT
|
||||
case 8:
|
||||
*(u64 __force *)to = *(u64 *)from;
|
||||
return 0;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
memcpy((void __force *)to, from, n);
|
||||
return 0;
|
||||
}
|
||||
@@ -67,6 +96,7 @@ raw_copy_to_user(void __user *to, const void *from, unsigned long n)
|
||||
#define INLINE_COPY_TO_USER
|
||||
#endif /* CONFIG_UACCESS_MEMCPY */
|
||||
|
||||
#ifdef CONFIG_SET_FS
|
||||
#define MAKE_MM_SEG(s) ((mm_segment_t) { (s) })
|
||||
|
||||
#ifndef KERNEL_DS
|
||||
@@ -89,6 +119,7 @@ static inline void set_fs(mm_segment_t fs)
|
||||
#ifndef uaccess_kernel
|
||||
#define uaccess_kernel() (get_fs().seg == KERNEL_DS.seg)
|
||||
#endif
|
||||
#endif /* CONFIG_SET_FS */
|
||||
|
||||
#define access_ok(addr, size) __access_ok((unsigned long)(addr),(size))
|
||||
|
||||
|
||||
@@ -701,6 +701,7 @@
|
||||
#ifdef CONFIG_CONSTRUCTORS
|
||||
#define KERNEL_CTORS() . = ALIGN(8); \
|
||||
__ctors_start = .; \
|
||||
KEEP(*(SORT(.ctors.*))) \
|
||||
KEEP(*(.ctors)) \
|
||||
KEEP(*(SORT(.init_array.*))) \
|
||||
KEEP(*(.init_array)) \
|
||||
@@ -734,7 +735,8 @@
|
||||
THERMAL_TABLE(governor) \
|
||||
EARLYCON_TABLE() \
|
||||
LSM_TABLE() \
|
||||
EARLY_LSM_TABLE()
|
||||
EARLY_LSM_TABLE() \
|
||||
KUNIT_TABLE()
|
||||
|
||||
#define INIT_TEXT \
|
||||
*(.init.text .init.text.*) \
|
||||
@@ -932,6 +934,13 @@
|
||||
KEEP(*(.con_initcall.init)) \
|
||||
__con_initcall_end = .;
|
||||
|
||||
/* Alignment must be consistent with (kunit_suite *) in include/kunit/test.h */
|
||||
#define KUNIT_TABLE() \
|
||||
. = ALIGN(8); \
|
||||
__kunit_suites_start = .; \
|
||||
KEEP(*(.kunit_test_suites)) \
|
||||
__kunit_suites_end = .;
|
||||
|
||||
#ifdef CONFIG_BLK_DEV_INITRD
|
||||
#define INIT_RAM_FS \
|
||||
. = ALIGN(4); \
|
||||
|
||||
@@ -1836,7 +1836,7 @@ static inline void drm_dp_cec_unset_edid(struct drm_dp_aux *aux)
|
||||
* @link_rate: Requested Link rate from DPCD 0x219
|
||||
* @num_lanes: Number of lanes requested by sing through DPCD 0x220
|
||||
* @phy_pattern: DP Phy test pattern from DPCD 0x248
|
||||
* @hb2_reset: DP HBR2_COMPLIANCE_SCRAMBLER_RESET from DCPD 0x24A and 0x24B
|
||||
* @hbr2_reset: DP HBR2_COMPLIANCE_SCRAMBLER_RESET from DCPD 0x24A and 0x24B
|
||||
* @custom80: DP Test_80BIT_CUSTOM_PATTERN from DPCDs 0x250 through 0x259
|
||||
* @enhanced_frame_cap: flag for enhanced frame capability.
|
||||
*/
|
||||
|
||||
@@ -359,13 +359,6 @@ drm_load_edid_firmware(struct drm_connector *connector)
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* drm_edid_are_equal - compare two edid blobs.
|
||||
* @edid1: pointer to first blob
|
||||
* @edid2: pointer to second blob
|
||||
* This helper can be used during probing to determine if
|
||||
* edid had changed.
|
||||
*/
|
||||
bool drm_edid_are_equal(const struct edid *edid1, const struct edid *edid2);
|
||||
|
||||
int
|
||||
|
||||
@@ -338,7 +338,7 @@ void drm_dev_dbg(const struct device *dev, enum drm_debug_category category,
|
||||
const char *format, ...);
|
||||
|
||||
/**
|
||||
* Error output.
|
||||
* DRM_DEV_ERROR() - Error output.
|
||||
*
|
||||
* @dev: device pointer
|
||||
* @fmt: printf() like format string.
|
||||
@@ -347,10 +347,12 @@ void drm_dev_dbg(const struct device *dev, enum drm_debug_category category,
|
||||
drm_dev_printk(dev, KERN_ERR, "*ERROR* " fmt, ##__VA_ARGS__)
|
||||
|
||||
/**
|
||||
* Rate limited error output. Like DRM_ERROR() but won't flood the log.
|
||||
* DRM_DEV_ERROR_RATELIMITED() - Rate limited error output.
|
||||
*
|
||||
* @dev: device pointer
|
||||
* @fmt: printf() like format string.
|
||||
*
|
||||
* Like DRM_ERROR() but won't flood the log.
|
||||
*/
|
||||
#define DRM_DEV_ERROR_RATELIMITED(dev, fmt, ...) \
|
||||
({ \
|
||||
@@ -375,15 +377,27 @@ void drm_dev_dbg(const struct device *dev, enum drm_debug_category category,
|
||||
})
|
||||
|
||||
/**
|
||||
* Debug output.
|
||||
* DRM_DEV_DEBUG() - Debug output for generic drm code
|
||||
*
|
||||
* @dev: device pointer
|
||||
* @fmt: printf() like format string.
|
||||
*/
|
||||
#define DRM_DEV_DEBUG(dev, fmt, ...) \
|
||||
drm_dev_dbg(dev, DRM_UT_CORE, fmt, ##__VA_ARGS__)
|
||||
/**
|
||||
* DRM_DEV_DEBUG_DRIVER() - Debug output for vendor specific part of the driver
|
||||
*
|
||||
* @dev: device pointer
|
||||
* @fmt: printf() like format string.
|
||||
*/
|
||||
#define DRM_DEV_DEBUG_DRIVER(dev, fmt, ...) \
|
||||
drm_dev_dbg(dev, DRM_UT_DRIVER, fmt, ##__VA_ARGS__)
|
||||
/**
|
||||
* DRM_DEV_DEBUG_KMS() - Debug output for modesetting code
|
||||
*
|
||||
* @dev: device pointer
|
||||
* @fmt: printf() like format string.
|
||||
*/
|
||||
#define DRM_DEV_DEBUG_KMS(dev, fmt, ...) \
|
||||
drm_dev_dbg(dev, DRM_UT_KMS, fmt, ##__VA_ARGS__)
|
||||
|
||||
|
||||
@@ -332,6 +332,7 @@
|
||||
#define DRA7_L4SEC_DES_CLKCTRL DRA7_L4SEC_CLKCTRL_INDEX(0x1b0)
|
||||
#define DRA7_L4SEC_RNG_CLKCTRL DRA7_L4SEC_CLKCTRL_INDEX(0x1c0)
|
||||
#define DRA7_L4SEC_SHAM_CLKCTRL DRA7_L4SEC_CLKCTRL_INDEX(0x1c8)
|
||||
#define DRA7_L4SEC_SHAM2_CLKCTRL DRA7_L4SEC_CLKCTRL_INDEX(0x1f8)
|
||||
|
||||
/* l4per2 clocks */
|
||||
#define DRA7_L4PER2_CLKCTRL_OFFSET 0xc
|
||||
|
||||
@@ -172,8 +172,10 @@
|
||||
#define CLK_MOUT_GPLL 1025
|
||||
#define CLK_MOUT_ACLK200_DISP1_SUB 1026
|
||||
#define CLK_MOUT_ACLK300_DISP1_SUB 1027
|
||||
#define CLK_MOUT_APLL 1028
|
||||
#define CLK_MOUT_MPLL 1029
|
||||
|
||||
/* must be greater than maximal clock id */
|
||||
#define CLK_NR_CLKS 1028
|
||||
#define CLK_NR_CLKS 1030
|
||||
|
||||
#endif /* _DT_BINDINGS_CLOCK_EXYNOS_5250_H */
|
||||
|
||||
@@ -230,6 +230,12 @@
|
||||
#define CLK_MOUT_USER_MAU_EPLL 659
|
||||
#define CLK_MOUT_SCLK_SPLL 660
|
||||
#define CLK_MOUT_MX_MSPLL_CCORE_PHY 661
|
||||
#define CLK_MOUT_SW_ACLK_G3D 662
|
||||
#define CLK_MOUT_APLL 663
|
||||
#define CLK_MOUT_MSPLL_CPU 664
|
||||
#define CLK_MOUT_KPLL 665
|
||||
#define CLK_MOUT_MSPLL_KFC 666
|
||||
|
||||
|
||||
/* divider clocks */
|
||||
#define CLK_DOUT_PIXEL 768
|
||||
|
||||
@@ -180,7 +180,7 @@
|
||||
#define IMX8MP_CLK_MEDIA_MIPI_PHY1_REF 171
|
||||
#define IMX8MP_CLK_MEDIA_DISP1_PIX 172
|
||||
#define IMX8MP_CLK_MEDIA_CAM2_PIX 173
|
||||
#define IMX8MP_CLK_MEDIA_MIPI_PHY2_REF 174
|
||||
#define IMX8MP_CLK_MEDIA_LDB 174
|
||||
#define IMX8MP_CLK_MEDIA_MIPI_CSI2_ESC 175
|
||||
#define IMX8MP_CLK_PCIE2_CTRL 176
|
||||
#define IMX8MP_CLK_PCIE2_PHY 177
|
||||
|
||||
131
include/dt-bindings/clock/mt8167-clk.h
Normal file
131
include/dt-bindings/clock/mt8167-clk.h
Normal file
@@ -0,0 +1,131 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Copyright (c) 2020 MediaTek Inc.
|
||||
* Copyright (c) 2020 BayLibre, SAS.
|
||||
* Author: James Liao <jamesjj.liao@mediatek.com>
|
||||
* Fabien Parent <fparent@baylibre.com>
|
||||
*/
|
||||
|
||||
#ifndef _DT_BINDINGS_CLK_MT8167_H
|
||||
#define _DT_BINDINGS_CLK_MT8167_H
|
||||
|
||||
/* MT8167 is based on MT8516 */
|
||||
#include <dt-bindings/clock/mt8516-clk.h>
|
||||
|
||||
/* APMIXEDSYS */
|
||||
|
||||
#define CLK_APMIXED_TVDPLL (CLK_APMIXED_NR_CLK + 0)
|
||||
#define CLK_APMIXED_LVDSPLL (CLK_APMIXED_NR_CLK + 1)
|
||||
#define CLK_APMIXED_HDMI_REF (CLK_APMIXED_NR_CLK + 2)
|
||||
#define MT8167_CLK_APMIXED_NR_CLK (CLK_APMIXED_NR_CLK + 3)
|
||||
|
||||
/* TOPCKGEN */
|
||||
|
||||
#define CLK_TOP_DSI0_LNTC_DSICK (CLK_TOP_NR_CLK + 0)
|
||||
#define CLK_TOP_VPLL_DPIX (CLK_TOP_NR_CLK + 1)
|
||||
#define CLK_TOP_LVDSTX_CLKDIG_CTS (CLK_TOP_NR_CLK + 2)
|
||||
#define CLK_TOP_HDMTX_CLKDIG_CTS (CLK_TOP_NR_CLK + 3)
|
||||
#define CLK_TOP_LVDSPLL (CLK_TOP_NR_CLK + 4)
|
||||
#define CLK_TOP_LVDSPLL_D2 (CLK_TOP_NR_CLK + 5)
|
||||
#define CLK_TOP_LVDSPLL_D4 (CLK_TOP_NR_CLK + 6)
|
||||
#define CLK_TOP_LVDSPLL_D8 (CLK_TOP_NR_CLK + 7)
|
||||
#define CLK_TOP_MIPI_26M (CLK_TOP_NR_CLK + 8)
|
||||
#define CLK_TOP_TVDPLL (CLK_TOP_NR_CLK + 9)
|
||||
#define CLK_TOP_TVDPLL_D2 (CLK_TOP_NR_CLK + 10)
|
||||
#define CLK_TOP_TVDPLL_D4 (CLK_TOP_NR_CLK + 11)
|
||||
#define CLK_TOP_TVDPLL_D8 (CLK_TOP_NR_CLK + 12)
|
||||
#define CLK_TOP_TVDPLL_D16 (CLK_TOP_NR_CLK + 13)
|
||||
#define CLK_TOP_PWM_MM (CLK_TOP_NR_CLK + 14)
|
||||
#define CLK_TOP_CAM_MM (CLK_TOP_NR_CLK + 15)
|
||||
#define CLK_TOP_MFG_MM (CLK_TOP_NR_CLK + 16)
|
||||
#define CLK_TOP_SPM_52M (CLK_TOP_NR_CLK + 17)
|
||||
#define CLK_TOP_MIPI_26M_DBG (CLK_TOP_NR_CLK + 18)
|
||||
#define CLK_TOP_SCAM_MM (CLK_TOP_NR_CLK + 19)
|
||||
#define CLK_TOP_SMI_MM (CLK_TOP_NR_CLK + 20)
|
||||
#define CLK_TOP_26M_HDMI_SIFM (CLK_TOP_NR_CLK + 21)
|
||||
#define CLK_TOP_26M_CEC (CLK_TOP_NR_CLK + 22)
|
||||
#define CLK_TOP_32K_CEC (CLK_TOP_NR_CLK + 23)
|
||||
#define CLK_TOP_GCPU_B (CLK_TOP_NR_CLK + 24)
|
||||
#define CLK_TOP_RG_VDEC (CLK_TOP_NR_CLK + 25)
|
||||
#define CLK_TOP_RG_FDPI0 (CLK_TOP_NR_CLK + 26)
|
||||
#define CLK_TOP_RG_FDPI1 (CLK_TOP_NR_CLK + 27)
|
||||
#define CLK_TOP_RG_AXI_MFG (CLK_TOP_NR_CLK + 28)
|
||||
#define CLK_TOP_RG_SLOW_MFG (CLK_TOP_NR_CLK + 29)
|
||||
#define CLK_TOP_GFMUX_EMI1X_SEL (CLK_TOP_NR_CLK + 30)
|
||||
#define CLK_TOP_CSW_MUX_MFG_SEL (CLK_TOP_NR_CLK + 31)
|
||||
#define CLK_TOP_CAMTG_MM_SEL (CLK_TOP_NR_CLK + 32)
|
||||
#define CLK_TOP_PWM_MM_SEL (CLK_TOP_NR_CLK + 33)
|
||||
#define CLK_TOP_SPM_52M_SEL (CLK_TOP_NR_CLK + 34)
|
||||
#define CLK_TOP_MFG_MM_SEL (CLK_TOP_NR_CLK + 35)
|
||||
#define CLK_TOP_SMI_MM_SEL (CLK_TOP_NR_CLK + 36)
|
||||
#define CLK_TOP_SCAM_MM_SEL (CLK_TOP_NR_CLK + 37)
|
||||
#define CLK_TOP_VDEC_MM_SEL (CLK_TOP_NR_CLK + 38)
|
||||
#define CLK_TOP_DPI0_MM_SEL (CLK_TOP_NR_CLK + 39)
|
||||
#define CLK_TOP_DPI1_MM_SEL (CLK_TOP_NR_CLK + 40)
|
||||
#define CLK_TOP_AXI_MFG_IN_SEL (CLK_TOP_NR_CLK + 41)
|
||||
#define CLK_TOP_SLOW_MFG_SEL (CLK_TOP_NR_CLK + 42)
|
||||
#define MT8167_CLK_TOP_NR_CLK (CLK_TOP_NR_CLK + 43)
|
||||
|
||||
/* MFGCFG */
|
||||
|
||||
#define CLK_MFG_BAXI 0
|
||||
#define CLK_MFG_BMEM 1
|
||||
#define CLK_MFG_BG3D 2
|
||||
#define CLK_MFG_B26M 3
|
||||
#define CLK_MFG_NR_CLK 4
|
||||
|
||||
/* MMSYS */
|
||||
|
||||
#define CLK_MM_SMI_COMMON 0
|
||||
#define CLK_MM_SMI_LARB0 1
|
||||
#define CLK_MM_CAM_MDP 2
|
||||
#define CLK_MM_MDP_RDMA 3
|
||||
#define CLK_MM_MDP_RSZ0 4
|
||||
#define CLK_MM_MDP_RSZ1 5
|
||||
#define CLK_MM_MDP_TDSHP 6
|
||||
#define CLK_MM_MDP_WDMA 7
|
||||
#define CLK_MM_MDP_WROT 8
|
||||
#define CLK_MM_FAKE_ENG 9
|
||||
#define CLK_MM_DISP_OVL0 10
|
||||
#define CLK_MM_DISP_RDMA0 11
|
||||
#define CLK_MM_DISP_RDMA1 12
|
||||
#define CLK_MM_DISP_WDMA 13
|
||||
#define CLK_MM_DISP_COLOR 14
|
||||
#define CLK_MM_DISP_CCORR 15
|
||||
#define CLK_MM_DISP_AAL 16
|
||||
#define CLK_MM_DISP_GAMMA 17
|
||||
#define CLK_MM_DISP_DITHER 18
|
||||
#define CLK_MM_DISP_UFOE 19
|
||||
#define CLK_MM_DISP_PWM_MM 20
|
||||
#define CLK_MM_DISP_PWM_26M 21
|
||||
#define CLK_MM_DSI_ENGINE 22
|
||||
#define CLK_MM_DSI_DIGITAL 23
|
||||
#define CLK_MM_DPI0_ENGINE 24
|
||||
#define CLK_MM_DPI0_PXL 25
|
||||
#define CLK_MM_LVDS_PXL 26
|
||||
#define CLK_MM_LVDS_CTS 27
|
||||
#define CLK_MM_DPI1_ENGINE 28
|
||||
#define CLK_MM_DPI1_PXL 29
|
||||
#define CLK_MM_HDMI_PXL 30
|
||||
#define CLK_MM_HDMI_SPDIF 31
|
||||
#define CLK_MM_HDMI_ADSP_BCK 32
|
||||
#define CLK_MM_HDMI_PLL 33
|
||||
#define CLK_MM_NR_CLK 34
|
||||
|
||||
/* IMGSYS */
|
||||
|
||||
#define CLK_IMG_LARB1_SMI 0
|
||||
#define CLK_IMG_CAM_SMI 1
|
||||
#define CLK_IMG_CAM_CAM 2
|
||||
#define CLK_IMG_SEN_TG 3
|
||||
#define CLK_IMG_SEN_CAM 4
|
||||
#define CLK_IMG_VENC 5
|
||||
#define CLK_IMG_NR_CLK 6
|
||||
|
||||
/* VDECSYS */
|
||||
|
||||
#define CLK_VDEC_CKEN 0
|
||||
#define CLK_VDEC_LARB1_CKEN 1
|
||||
#define CLK_VDEC_NR_CLK 2
|
||||
|
||||
#endif /* _DT_BINDINGS_CLK_MT8167_H */
|
||||
1
include/dt-bindings/clock/qcom,dispcc-sm8150.h
Symbolic link
1
include/dt-bindings/clock/qcom,dispcc-sm8150.h
Symbolic link
@@ -0,0 +1 @@
|
||||
qcom,dispcc-sm8250.h
|
||||
66
include/dt-bindings/clock/qcom,dispcc-sm8250.h
Normal file
66
include/dt-bindings/clock/qcom,dispcc-sm8250.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef _DT_BINDINGS_CLK_QCOM_DISP_CC_SM8250_H
|
||||
#define _DT_BINDINGS_CLK_QCOM_DISP_CC_SM8250_H
|
||||
|
||||
/* DISP_CC clock registers */
|
||||
#define DISP_CC_MDSS_AHB_CLK 0
|
||||
#define DISP_CC_MDSS_AHB_CLK_SRC 1
|
||||
#define DISP_CC_MDSS_BYTE0_CLK 2
|
||||
#define DISP_CC_MDSS_BYTE0_CLK_SRC 3
|
||||
#define DISP_CC_MDSS_BYTE0_DIV_CLK_SRC 4
|
||||
#define DISP_CC_MDSS_BYTE0_INTF_CLK 5
|
||||
#define DISP_CC_MDSS_BYTE1_CLK 6
|
||||
#define DISP_CC_MDSS_BYTE1_CLK_SRC 7
|
||||
#define DISP_CC_MDSS_BYTE1_DIV_CLK_SRC 8
|
||||
#define DISP_CC_MDSS_BYTE1_INTF_CLK 9
|
||||
#define DISP_CC_MDSS_DP_AUX1_CLK 10
|
||||
#define DISP_CC_MDSS_DP_AUX1_CLK_SRC 11
|
||||
#define DISP_CC_MDSS_DP_AUX_CLK 12
|
||||
#define DISP_CC_MDSS_DP_AUX_CLK_SRC 13
|
||||
#define DISP_CC_MDSS_DP_LINK1_CLK 14
|
||||
#define DISP_CC_MDSS_DP_LINK1_CLK_SRC 15
|
||||
#define DISP_CC_MDSS_DP_LINK1_DIV_CLK_SRC 16
|
||||
#define DISP_CC_MDSS_DP_LINK1_INTF_CLK 17
|
||||
#define DISP_CC_MDSS_DP_LINK_CLK 18
|
||||
#define DISP_CC_MDSS_DP_LINK_CLK_SRC 19
|
||||
#define DISP_CC_MDSS_DP_LINK_DIV_CLK_SRC 20
|
||||
#define DISP_CC_MDSS_DP_LINK_INTF_CLK 21
|
||||
#define DISP_CC_MDSS_DP_PIXEL1_CLK 22
|
||||
#define DISP_CC_MDSS_DP_PIXEL1_CLK_SRC 23
|
||||
#define DISP_CC_MDSS_DP_PIXEL2_CLK 24
|
||||
#define DISP_CC_MDSS_DP_PIXEL2_CLK_SRC 25
|
||||
#define DISP_CC_MDSS_DP_PIXEL_CLK 26
|
||||
#define DISP_CC_MDSS_DP_PIXEL_CLK_SRC 27
|
||||
#define DISP_CC_MDSS_ESC0_CLK 28
|
||||
#define DISP_CC_MDSS_ESC0_CLK_SRC 29
|
||||
#define DISP_CC_MDSS_ESC1_CLK 30
|
||||
#define DISP_CC_MDSS_ESC1_CLK_SRC 31
|
||||
#define DISP_CC_MDSS_MDP_CLK 32
|
||||
#define DISP_CC_MDSS_MDP_CLK_SRC 33
|
||||
#define DISP_CC_MDSS_MDP_LUT_CLK 34
|
||||
#define DISP_CC_MDSS_NON_GDSC_AHB_CLK 35
|
||||
#define DISP_CC_MDSS_PCLK0_CLK 36
|
||||
#define DISP_CC_MDSS_PCLK0_CLK_SRC 37
|
||||
#define DISP_CC_MDSS_PCLK1_CLK 38
|
||||
#define DISP_CC_MDSS_PCLK1_CLK_SRC 39
|
||||
#define DISP_CC_MDSS_ROT_CLK 40
|
||||
#define DISP_CC_MDSS_ROT_CLK_SRC 41
|
||||
#define DISP_CC_MDSS_RSCC_AHB_CLK 42
|
||||
#define DISP_CC_MDSS_RSCC_VSYNC_CLK 43
|
||||
#define DISP_CC_MDSS_VSYNC_CLK 44
|
||||
#define DISP_CC_MDSS_VSYNC_CLK_SRC 45
|
||||
#define DISP_CC_PLL0 46
|
||||
#define DISP_CC_PLL1 47
|
||||
|
||||
/* DISP_CC Reset */
|
||||
#define DISP_CC_MDSS_CORE_BCR 0
|
||||
#define DISP_CC_MDSS_RSCC_BCR 1
|
||||
|
||||
/* DISP_CC GDSCR */
|
||||
#define MDSS_GDSC 0
|
||||
|
||||
#endif
|
||||
@@ -126,5 +126,41 @@
|
||||
#define GCC_USB3_PHY_AUX_CLK 116
|
||||
#define GCC_USB_HS_SYSTEM_CLK 117
|
||||
#define GCC_SDCC1_AHB_CLK 118
|
||||
#define GCC_LPASS_Q6_AXI_CLK 119
|
||||
#define GCC_MSS_Q6_BIMC_AXI_CLK 120
|
||||
#define GCC_PCIE_0_CFG_AHB_CLK 121
|
||||
#define GCC_PCIE_0_MSTR_AXI_CLK 122
|
||||
#define GCC_PCIE_0_SLV_AXI_CLK 123
|
||||
#define GCC_PCIE_1_CFG_AHB_CLK 124
|
||||
#define GCC_PCIE_1_MSTR_AXI_CLK 125
|
||||
#define GCC_PCIE_1_SLV_AXI_CLK 126
|
||||
#define GCC_PDM_AHB_CLK 127
|
||||
#define GCC_SDCC2_AHB_CLK 128
|
||||
#define GCC_SDCC3_AHB_CLK 129
|
||||
#define GCC_SDCC4_AHB_CLK 130
|
||||
#define GCC_TSIF_AHB_CLK 131
|
||||
#define GCC_UFS_AHB_CLK 132
|
||||
#define GCC_UFS_RX_SYMBOL_0_CLK 133
|
||||
#define GCC_UFS_RX_SYMBOL_1_CLK 134
|
||||
#define GCC_UFS_TX_SYMBOL_0_CLK 135
|
||||
#define GCC_UFS_TX_SYMBOL_1_CLK 136
|
||||
#define GCC_USB2_HS_PHY_SLEEP_CLK 137
|
||||
#define GCC_USB30_SLEEP_CLK 138
|
||||
#define GCC_USB_HS_AHB_CLK 139
|
||||
#define GCC_USB_PHY_CFG_AHB2PHY_CLK 140
|
||||
|
||||
/* GDSCs */
|
||||
#define PCIE_GDSC 0
|
||||
#define PCIE_0_GDSC 1
|
||||
#define PCIE_1_GDSC 2
|
||||
#define USB30_GDSC 3
|
||||
#define UFS_GDSC 4
|
||||
|
||||
/* Resets */
|
||||
#define USB3_PHY_RESET 0
|
||||
#define USB3PHY_PHY_RESET 1
|
||||
#define PCIE_PHY_0_RESET 2
|
||||
#define PCIE_PHY_1_RESET 3
|
||||
#define QUSB2_PHY_RESET 4
|
||||
|
||||
#endif
|
||||
|
||||
25
include/dt-bindings/clock/qcom,videocc-sm8150.h
Normal file
25
include/dt-bindings/clock/qcom,videocc-sm8150.h
Normal file
@@ -0,0 +1,25 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef _DT_BINDINGS_CLK_QCOM_VIDEO_CC_SM8150_H
|
||||
#define _DT_BINDINGS_CLK_QCOM_VIDEO_CC_SM8150_H
|
||||
|
||||
/* VIDEO_CC clocks */
|
||||
#define VIDEO_CC_IRIS_AHB_CLK 0
|
||||
#define VIDEO_CC_IRIS_CLK_SRC 1
|
||||
#define VIDEO_CC_MVS0_CORE_CLK 2
|
||||
#define VIDEO_CC_MVS1_CORE_CLK 3
|
||||
#define VIDEO_CC_MVSC_CORE_CLK 4
|
||||
#define VIDEO_CC_PLL0 5
|
||||
|
||||
/* VIDEO_CC Resets */
|
||||
#define VIDEO_CC_MVSC_CORE_CLK_BCR 0
|
||||
|
||||
/* VIDEO_CC GDSCRs */
|
||||
#define VENUS_GDSC 0
|
||||
#define VCODEC0_GDSC 1
|
||||
#define VCODEC1_GDSC 2
|
||||
|
||||
#endif
|
||||
34
include/dt-bindings/clock/qcom,videocc-sm8250.h
Normal file
34
include/dt-bindings/clock/qcom,videocc-sm8250.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef _DT_BINDINGS_CLK_QCOM_VIDEO_CC_SM8250_H
|
||||
#define _DT_BINDINGS_CLK_QCOM_VIDEO_CC_SM8250_H
|
||||
|
||||
/* VIDEO_CC clocks */
|
||||
#define VIDEO_CC_MVS0_CLK_SRC 0
|
||||
#define VIDEO_CC_MVS0C_CLK 1
|
||||
#define VIDEO_CC_MVS0C_DIV2_DIV_CLK_SRC 2
|
||||
#define VIDEO_CC_MVS1_CLK_SRC 3
|
||||
#define VIDEO_CC_MVS1_DIV2_CLK 4
|
||||
#define VIDEO_CC_MVS1C_CLK 5
|
||||
#define VIDEO_CC_MVS1C_DIV2_DIV_CLK_SRC 6
|
||||
#define VIDEO_CC_PLL0 7
|
||||
#define VIDEO_CC_PLL1 8
|
||||
|
||||
/* VIDEO_CC resets */
|
||||
#define VIDEO_CC_CVP_INTERFACE_BCR 0
|
||||
#define VIDEO_CC_CVP_MVS0_BCR 1
|
||||
#define VIDEO_CC_MVS0C_CLK_ARES 2
|
||||
#define VIDEO_CC_CVP_MVS0C_BCR 3
|
||||
#define VIDEO_CC_CVP_MVS1_BCR 4
|
||||
#define VIDEO_CC_MVS1C_CLK_ARES 5
|
||||
#define VIDEO_CC_CVP_MVS1C_BCR 6
|
||||
|
||||
#define MVS0C_GDSC 0
|
||||
#define MVS1C_GDSC 1
|
||||
#define MVS0_GDSC 2
|
||||
#define MVS1_GDSC 3
|
||||
|
||||
#endif
|
||||
55
include/dt-bindings/clock/r8a779a0-cpg-mssr.h
Normal file
55
include/dt-bindings/clock/r8a779a0-cpg-mssr.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Copyright (C) 2020 Renesas Electronics Corp.
|
||||
*/
|
||||
#ifndef __DT_BINDINGS_CLOCK_R8A779A0_CPG_MSSR_H__
|
||||
#define __DT_BINDINGS_CLOCK_R8A779A0_CPG_MSSR_H__
|
||||
|
||||
#include <dt-bindings/clock/renesas-cpg-mssr.h>
|
||||
|
||||
/* r8a779A0 CPG Core Clocks */
|
||||
#define R8A779A0_CLK_Z0 0
|
||||
#define R8A779A0_CLK_ZX 1
|
||||
#define R8A779A0_CLK_Z1 2
|
||||
#define R8A779A0_CLK_ZR 3
|
||||
#define R8A779A0_CLK_ZS 4
|
||||
#define R8A779A0_CLK_ZT 5
|
||||
#define R8A779A0_CLK_ZTR 6
|
||||
#define R8A779A0_CLK_S1D1 7
|
||||
#define R8A779A0_CLK_S1D2 8
|
||||
#define R8A779A0_CLK_S1D4 9
|
||||
#define R8A779A0_CLK_S1D8 10
|
||||
#define R8A779A0_CLK_S1D12 11
|
||||
#define R8A779A0_CLK_S3D1 12
|
||||
#define R8A779A0_CLK_S3D2 13
|
||||
#define R8A779A0_CLK_S3D4 14
|
||||
#define R8A779A0_CLK_LB 15
|
||||
#define R8A779A0_CLK_CP 16
|
||||
#define R8A779A0_CLK_CL 17
|
||||
#define R8A779A0_CLK_CL16MCK 18
|
||||
#define R8A779A0_CLK_ZB30 19
|
||||
#define R8A779A0_CLK_ZB30D2 20
|
||||
#define R8A779A0_CLK_ZB30D4 21
|
||||
#define R8A779A0_CLK_ZB31 22
|
||||
#define R8A779A0_CLK_ZB31D2 23
|
||||
#define R8A779A0_CLK_ZB31D4 24
|
||||
#define R8A779A0_CLK_SD0H 25
|
||||
#define R8A779A0_CLK_SD0 26
|
||||
#define R8A779A0_CLK_RPC 27
|
||||
#define R8A779A0_CLK_RPCD2 28
|
||||
#define R8A779A0_CLK_MSO 29
|
||||
#define R8A779A0_CLK_CANFD 30
|
||||
#define R8A779A0_CLK_CSI0 31
|
||||
#define R8A779A0_CLK_FRAY 32
|
||||
#define R8A779A0_CLK_DSI 33
|
||||
#define R8A779A0_CLK_VIP 34
|
||||
#define R8A779A0_CLK_ADGH 35
|
||||
#define R8A779A0_CLK_CNNDSP 36
|
||||
#define R8A779A0_CLK_ICU 37
|
||||
#define R8A779A0_CLK_ICUD2 38
|
||||
#define R8A779A0_CLK_VCBUS 39
|
||||
#define R8A779A0_CLK_CBFUSA 40
|
||||
#define R8A779A0_CLK_R 41
|
||||
#define R8A779A0_CLK_OSC 42
|
||||
|
||||
#endif /* __DT_BINDINGS_CLOCK_R8A779A0_CPG_MSSR_H__ */
|
||||
116
include/dt-bindings/clock/sun50i-a100-ccu.h
Normal file
116
include/dt-bindings/clock/sun50i-a100-ccu.h
Normal file
@@ -0,0 +1,116 @@
|
||||
/* SPDX-License-Identifier: (GPL-2.0+ or MIT) */
|
||||
/*
|
||||
* Copyright (c) 2020 Yangtao Li <frank@allwinnertech.com>
|
||||
*/
|
||||
|
||||
#ifndef _DT_BINDINGS_CLK_SUN50I_A100_H_
|
||||
#define _DT_BINDINGS_CLK_SUN50I_A100_H_
|
||||
|
||||
#define CLK_PLL_PERIPH0 3
|
||||
|
||||
#define CLK_CPUX 24
|
||||
|
||||
#define CLK_APB1 29
|
||||
|
||||
#define CLK_MBUS 31
|
||||
#define CLK_DE 32
|
||||
#define CLK_BUS_DE 33
|
||||
#define CLK_G2D 34
|
||||
#define CLK_BUS_G2D 35
|
||||
#define CLK_GPU 36
|
||||
#define CLK_BUS_GPU 37
|
||||
#define CLK_CE 38
|
||||
#define CLK_BUS_CE 39
|
||||
#define CLK_VE 40
|
||||
#define CLK_BUS_VE 41
|
||||
#define CLK_BUS_DMA 42
|
||||
#define CLK_BUS_MSGBOX 43
|
||||
#define CLK_BUS_SPINLOCK 44
|
||||
#define CLK_BUS_HSTIMER 45
|
||||
#define CLK_AVS 46
|
||||
#define CLK_BUS_DBG 47
|
||||
#define CLK_BUS_PSI 48
|
||||
#define CLK_BUS_PWM 49
|
||||
#define CLK_BUS_IOMMU 50
|
||||
#define CLK_MBUS_DMA 51
|
||||
#define CLK_MBUS_VE 52
|
||||
#define CLK_MBUS_CE 53
|
||||
#define CLK_MBUS_NAND 54
|
||||
#define CLK_MBUS_CSI 55
|
||||
#define CLK_MBUS_ISP 56
|
||||
#define CLK_MBUS_G2D 57
|
||||
|
||||
#define CLK_NAND0 59
|
||||
#define CLK_NAND1 60
|
||||
#define CLK_BUS_NAND 61
|
||||
#define CLK_MMC0 62
|
||||
#define CLK_MMC1 63
|
||||
#define CLK_MMC2 64
|
||||
#define CLK_MMC3 65
|
||||
#define CLK_BUS_MMC0 66
|
||||
#define CLK_BUS_MMC1 67
|
||||
#define CLK_BUS_MMC2 68
|
||||
#define CLK_BUS_UART0 69
|
||||
#define CLK_BUS_UART1 70
|
||||
#define CLK_BUS_UART2 71
|
||||
#define CLK_BUS_UART3 72
|
||||
#define CLK_BUS_UART4 73
|
||||
#define CLK_BUS_I2C0 74
|
||||
#define CLK_BUS_I2C1 75
|
||||
#define CLK_BUS_I2C2 76
|
||||
#define CLK_BUS_I2C3 77
|
||||
#define CLK_SPI0 78
|
||||
#define CLK_SPI1 79
|
||||
#define CLK_SPI2 80
|
||||
#define CLK_BUS_SPI0 81
|
||||
#define CLK_BUS_SPI1 82
|
||||
#define CLK_BUS_SPI2 83
|
||||
#define CLK_EMAC_25M 84
|
||||
#define CLK_BUS_EMAC 85
|
||||
#define CLK_IR_RX 86
|
||||
#define CLK_BUS_IR_RX 87
|
||||
#define CLK_IR_TX 88
|
||||
#define CLK_BUS_IR_TX 89
|
||||
#define CLK_BUS_GPADC 90
|
||||
#define CLK_BUS_THS 91
|
||||
#define CLK_I2S0 92
|
||||
#define CLK_I2S1 93
|
||||
#define CLK_I2S2 94
|
||||
#define CLK_I2S3 95
|
||||
#define CLK_BUS_I2S0 96
|
||||
#define CLK_BUS_I2S1 97
|
||||
#define CLK_BUS_I2S2 98
|
||||
#define CLK_BUS_I2S3 99
|
||||
#define CLK_SPDIF 100
|
||||
#define CLK_BUS_SPDIF 101
|
||||
#define CLK_DMIC 102
|
||||
#define CLK_BUS_DMIC 103
|
||||
#define CLK_AUDIO_DAC 104
|
||||
#define CLK_AUDIO_ADC 105
|
||||
#define CLK_AUDIO_4X 106
|
||||
#define CLK_BUS_AUDIO_CODEC 107
|
||||
#define CLK_USB_OHCI0 108
|
||||
#define CLK_USB_PHY0 109
|
||||
#define CLK_USB_OHCI1 110
|
||||
#define CLK_USB_PHY1 111
|
||||
#define CLK_BUS_OHCI0 112
|
||||
#define CLK_BUS_OHCI1 113
|
||||
#define CLK_BUS_EHCI0 114
|
||||
#define CLK_BUS_EHCI1 115
|
||||
#define CLK_BUS_OTG 116
|
||||
#define CLK_BUS_LRADC 117
|
||||
#define CLK_BUS_DPSS_TOP0 118
|
||||
#define CLK_BUS_DPSS_TOP1 119
|
||||
#define CLK_MIPI_DSI 120
|
||||
#define CLK_BUS_MIPI_DSI 121
|
||||
#define CLK_TCON_LCD 122
|
||||
#define CLK_BUS_TCON_LCD 123
|
||||
#define CLK_LEDC 124
|
||||
#define CLK_BUS_LEDC 125
|
||||
#define CLK_CSI_TOP 126
|
||||
#define CLK_CSI0_MCLK 127
|
||||
#define CLK_CSI1_MCLK 128
|
||||
#define CLK_BUS_CSI 129
|
||||
#define CLK_CSI_ISP 130
|
||||
|
||||
#endif /* _DT_BINDINGS_CLK_SUN50I_A100_H_ */
|
||||
23
include/dt-bindings/clock/sun50i-a100-r-ccu.h
Normal file
23
include/dt-bindings/clock/sun50i-a100-r-ccu.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Copyright (c) 2020 Yangtao Li <frank@allwinnertech.com>
|
||||
*/
|
||||
|
||||
#ifndef _DT_BINDINGS_CLK_SUN50I_A100_R_CCU_H_
|
||||
#define _DT_BINDINGS_CLK_SUN50I_A100_R_CCU_H_
|
||||
|
||||
#define CLK_R_APB1 2
|
||||
|
||||
#define CLK_R_APB1_TIMER 4
|
||||
#define CLK_R_APB1_TWD 5
|
||||
#define CLK_R_APB1_PWM 6
|
||||
#define CLK_R_APB1_BUS_PWM 7
|
||||
#define CLK_R_APB1_PPU 8
|
||||
#define CLK_R_APB2_UART 9
|
||||
#define CLK_R_APB2_I2C0 10
|
||||
#define CLK_R_APB2_I2C1 11
|
||||
#define CLK_R_APB1_IR 12
|
||||
#define CLK_R_APB1_BUS_IR 13
|
||||
#define CLK_R_AHB_BUS_RTC 14
|
||||
|
||||
#endif /* _DT_BINDINGS_CLK_SUN50I_A100_R_CCU_H_ */
|
||||
14
include/dt-bindings/clock/tegra234-clock.h
Normal file
14
include/dt-bindings/clock/tegra234-clock.h
Normal file
@@ -0,0 +1,14 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/* Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved. */
|
||||
|
||||
#ifndef DT_BINDINGS_CLOCK_TEGRA234_CLOCK_H
|
||||
#define DT_BINDINGS_CLOCK_TEGRA234_CLOCK_H
|
||||
|
||||
/** @brief output of gate CLK_ENB_FUSE */
|
||||
#define TEGRA234_CLK_FUSE 40
|
||||
/** @brief output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_SDMMC4 */
|
||||
#define TEGRA234_CLK_SDMMC4 123
|
||||
/** @brief output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_UARTA */
|
||||
#define TEGRA234_CLK_UARTA 155
|
||||
|
||||
#endif
|
||||
@@ -196,6 +196,7 @@
|
||||
#define VF610_CLK_TCON0 187
|
||||
#define VF610_CLK_TCON1 188
|
||||
#define VF610_CLK_CAAM 189
|
||||
#define VF610_CLK_END 190
|
||||
#define VF610_CLK_CRC 190
|
||||
#define VF610_CLK_END 191
|
||||
|
||||
#endif /* __DT_BINDINGS_CLOCK_VF610_H */
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* This header provides constants for J721E WIZ.
|
||||
*/
|
||||
|
||||
#ifndef _DT_BINDINGS_J721E_WIZ
|
||||
#define _DT_BINDINGS_J721E_WIZ
|
||||
|
||||
#define SERDES0_LANE0_QSGMII_LANE1 0x0
|
||||
#define SERDES0_LANE0_PCIE0_LANE0 0x1
|
||||
#define SERDES0_LANE0_USB3_0_SWAP 0x2
|
||||
|
||||
#define SERDES0_LANE1_QSGMII_LANE2 0x0
|
||||
#define SERDES0_LANE1_PCIE0_LANE1 0x1
|
||||
#define SERDES0_LANE1_USB3_0 0x2
|
||||
|
||||
#define SERDES1_LANE0_QSGMII_LANE3 0x0
|
||||
#define SERDES1_LANE0_PCIE1_LANE0 0x1
|
||||
#define SERDES1_LANE0_USB3_1_SWAP 0x2
|
||||
#define SERDES1_LANE0_SGMII_LANE0 0x3
|
||||
|
||||
#define SERDES1_LANE1_QSGMII_LANE4 0x0
|
||||
#define SERDES1_LANE1_PCIE1_LANE1 0x1
|
||||
#define SERDES1_LANE1_USB3_1 0x2
|
||||
#define SERDES1_LANE1_SGMII_LANE1 0x3
|
||||
|
||||
#define SERDES2_LANE0_PCIE2_LANE0 0x1
|
||||
#define SERDES2_LANE0_SGMII_LANE0 0x3
|
||||
#define SERDES2_LANE0_USB3_1_SWAP 0x2
|
||||
|
||||
#define SERDES2_LANE1_PCIE2_LANE1 0x1
|
||||
#define SERDES2_LANE1_USB3_1 0x2
|
||||
#define SERDES2_LANE1_SGMII_LANE1 0x3
|
||||
|
||||
#define SERDES3_LANE0_PCIE3_LANE0 0x1
|
||||
#define SERDES3_LANE0_USB3_0_SWAP 0x2
|
||||
|
||||
#define SERDES3_LANE1_PCIE3_LANE1 0x1
|
||||
#define SERDES3_LANE1_USB3_0 0x2
|
||||
|
||||
#define SERDES4_LANE0_EDP_LANE0 0x0
|
||||
#define SERDES4_LANE0_QSGMII_LANE5 0x2
|
||||
|
||||
#define SERDES4_LANE1_EDP_LANE1 0x0
|
||||
#define SERDES4_LANE1_QSGMII_LANE6 0x2
|
||||
|
||||
#define SERDES4_LANE2_EDP_LANE2 0x0
|
||||
#define SERDES4_LANE2_QSGMII_LANE7 0x2
|
||||
|
||||
#define SERDES4_LANE3_EDP_LANE3 0x0
|
||||
#define SERDES4_LANE3_QSGMII_LANE8 0x2
|
||||
|
||||
#endif /* _DT_BINDINGS_J721E_WIZ */
|
||||
93
include/dt-bindings/mux/ti-serdes.h
Normal file
93
include/dt-bindings/mux/ti-serdes.h
Normal file
@@ -0,0 +1,93 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* This header provides constants for SERDES MUX for TI SoCs
|
||||
*/
|
||||
|
||||
#ifndef _DT_BINDINGS_MUX_TI_SERDES
|
||||
#define _DT_BINDINGS_MUX_TI_SERDES
|
||||
|
||||
/* J721E */
|
||||
|
||||
#define J721E_SERDES0_LANE0_QSGMII_LANE1 0x0
|
||||
#define J721E_SERDES0_LANE0_PCIE0_LANE0 0x1
|
||||
#define J721E_SERDES0_LANE0_USB3_0_SWAP 0x2
|
||||
#define J721E_SERDES0_LANE0_IP4_UNUSED 0x3
|
||||
|
||||
#define J721E_SERDES0_LANE1_QSGMII_LANE2 0x0
|
||||
#define J721E_SERDES0_LANE1_PCIE0_LANE1 0x1
|
||||
#define J721E_SERDES0_LANE1_USB3_0 0x2
|
||||
#define J721E_SERDES0_LANE1_IP4_UNUSED 0x3
|
||||
|
||||
#define J721E_SERDES1_LANE0_QSGMII_LANE3 0x0
|
||||
#define J721E_SERDES1_LANE0_PCIE1_LANE0 0x1
|
||||
#define J721E_SERDES1_LANE0_USB3_1_SWAP 0x2
|
||||
#define J721E_SERDES1_LANE0_SGMII_LANE0 0x3
|
||||
|
||||
#define J721E_SERDES1_LANE1_QSGMII_LANE4 0x0
|
||||
#define J721E_SERDES1_LANE1_PCIE1_LANE1 0x1
|
||||
#define J721E_SERDES1_LANE1_USB3_1 0x2
|
||||
#define J721E_SERDES1_LANE1_SGMII_LANE1 0x3
|
||||
|
||||
#define J721E_SERDES2_LANE0_IP1_UNUSED 0x0
|
||||
#define J721E_SERDES2_LANE0_PCIE2_LANE0 0x1
|
||||
#define J721E_SERDES2_LANE0_USB3_1_SWAP 0x2
|
||||
#define J721E_SERDES2_LANE0_SGMII_LANE0 0x3
|
||||
|
||||
#define J721E_SERDES2_LANE1_IP1_UNUSED 0x0
|
||||
#define J721E_SERDES2_LANE1_PCIE2_LANE1 0x1
|
||||
#define J721E_SERDES2_LANE1_USB3_1 0x2
|
||||
#define J721E_SERDES2_LANE1_SGMII_LANE1 0x3
|
||||
|
||||
#define J721E_SERDES3_LANE0_IP1_UNUSED 0x0
|
||||
#define J721E_SERDES3_LANE0_PCIE3_LANE0 0x1
|
||||
#define J721E_SERDES3_LANE0_USB3_0_SWAP 0x2
|
||||
#define J721E_SERDES3_LANE0_IP4_UNUSED 0x3
|
||||
|
||||
#define J721E_SERDES3_LANE1_IP1_UNUSED 0x0
|
||||
#define J721E_SERDES3_LANE1_PCIE3_LANE1 0x1
|
||||
#define J721E_SERDES3_LANE1_USB3_0 0x2
|
||||
#define J721E_SERDES3_LANE1_IP4_UNUSED 0x3
|
||||
|
||||
#define J721E_SERDES4_LANE0_EDP_LANE0 0x0
|
||||
#define J721E_SERDES4_LANE0_IP2_UNUSED 0x1
|
||||
#define J721E_SERDES4_LANE0_QSGMII_LANE5 0x2
|
||||
#define J721E_SERDES4_LANE0_IP4_UNUSED 0x3
|
||||
|
||||
#define J721E_SERDES4_LANE1_EDP_LANE1 0x0
|
||||
#define J721E_SERDES4_LANE1_IP2_UNUSED 0x1
|
||||
#define J721E_SERDES4_LANE1_QSGMII_LANE6 0x2
|
||||
#define J721E_SERDES4_LANE1_IP4_UNUSED 0x3
|
||||
|
||||
#define J721E_SERDES4_LANE2_EDP_LANE2 0x0
|
||||
#define J721E_SERDES4_LANE2_IP2_UNUSED 0x1
|
||||
#define J721E_SERDES4_LANE2_QSGMII_LANE7 0x2
|
||||
#define J721E_SERDES4_LANE2_IP4_UNUSED 0x3
|
||||
|
||||
#define J721E_SERDES4_LANE3_EDP_LANE3 0x0
|
||||
#define J721E_SERDES4_LANE3_IP2_UNUSED 0x1
|
||||
#define J721E_SERDES4_LANE3_QSGMII_LANE8 0x2
|
||||
#define J721E_SERDES4_LANE3_IP4_UNUSED 0x3
|
||||
|
||||
/* J7200 */
|
||||
|
||||
#define J7200_SERDES0_LANE0_QSGMII_LANE3 0x0
|
||||
#define J7200_SERDES0_LANE0_PCIE1_LANE0 0x1
|
||||
#define J7200_SERDES0_LANE0_IP3_UNUSED 0x2
|
||||
#define J7200_SERDES0_LANE0_IP4_UNUSED 0x3
|
||||
|
||||
#define J7200_SERDES0_LANE1_QSGMII_LANE4 0x0
|
||||
#define J7200_SERDES0_LANE1_PCIE1_LANE1 0x1
|
||||
#define J7200_SERDES0_LANE1_IP3_UNUSED 0x2
|
||||
#define J7200_SERDES0_LANE1_IP4_UNUSED 0x3
|
||||
|
||||
#define J7200_SERDES0_LANE2_QSGMII_LANE1 0x0
|
||||
#define J7200_SERDES0_LANE2_PCIE1_LANE2 0x1
|
||||
#define J7200_SERDES0_LANE2_IP3_UNUSED 0x2
|
||||
#define J7200_SERDES0_LANE2_IP4_UNUSED 0x3
|
||||
|
||||
#define J7200_SERDES0_LANE3_QSGMII_LANE2 0x0
|
||||
#define J7200_SERDES0_LANE3_PCIE1_LANE3 0x1
|
||||
#define J7200_SERDES0_LANE3_USB 0x2
|
||||
#define J7200_SERDES0_LANE3_IP4_UNUSED 0x3
|
||||
|
||||
#endif /* _DT_BINDINGS_MUX_TI_SERDES */
|
||||
@@ -64,7 +64,7 @@
|
||||
#define OMAP3_WKUP_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x2a00) (val)
|
||||
#define DM814X_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x0800) (val)
|
||||
#define DM816X_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x0800) (val)
|
||||
#define AM33XX_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x0800) (val)
|
||||
#define AM33XX_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x0800) (val) (0)
|
||||
#define AM33XX_PADCONF(pa, conf, mux) OMAP_IOPAD_OFFSET((pa), 0x0800) (conf) (mux)
|
||||
|
||||
/*
|
||||
|
||||
14
include/dt-bindings/power/meson-axg-power.h
Normal file
14
include/dt-bindings/power/meson-axg-power.h
Normal file
@@ -0,0 +1,14 @@
|
||||
/* SPDX-License-Identifier: (GPL-2.0+ or MIT) */
|
||||
/*
|
||||
* Copyright (c) 2020 BayLibre, SAS
|
||||
* Author: Neil Armstrong <narmstrong@baylibre.com>
|
||||
*/
|
||||
|
||||
#ifndef _DT_BINDINGS_MESON_AXG_POWER_H
|
||||
#define _DT_BINDINGS_MESON_AXG_POWER_H
|
||||
|
||||
#define PWRC_AXG_VPU_ID 0
|
||||
#define PWRC_AXG_ETHERNET_MEM_ID 1
|
||||
#define PWRC_AXG_AUDIO_ID 2
|
||||
|
||||
#endif
|
||||
59
include/dt-bindings/power/r8a779a0-sysc.h
Normal file
59
include/dt-bindings/power/r8a779a0-sysc.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Copyright (C) 2020 Renesas Electronics Corp.
|
||||
*/
|
||||
#ifndef __DT_BINDINGS_POWER_R8A779A0_SYSC_H__
|
||||
#define __DT_BINDINGS_POWER_R8A779A0_SYSC_H__
|
||||
|
||||
/*
|
||||
* These power domain indices match the Power Domain Register Numbers (PDR)
|
||||
*/
|
||||
|
||||
#define R8A779A0_PD_A1E0D0C0 0
|
||||
#define R8A779A0_PD_A1E0D0C1 1
|
||||
#define R8A779A0_PD_A1E0D1C0 2
|
||||
#define R8A779A0_PD_A1E0D1C1 3
|
||||
#define R8A779A0_PD_A1E1D0C0 4
|
||||
#define R8A779A0_PD_A1E1D0C1 5
|
||||
#define R8A779A0_PD_A1E1D1C0 6
|
||||
#define R8A779A0_PD_A1E1D1C1 7
|
||||
#define R8A779A0_PD_A2E0D0 16
|
||||
#define R8A779A0_PD_A2E0D1 17
|
||||
#define R8A779A0_PD_A2E1D0 18
|
||||
#define R8A779A0_PD_A2E1D1 19
|
||||
#define R8A779A0_PD_A3E0 20
|
||||
#define R8A779A0_PD_A3E1 21
|
||||
#define R8A779A0_PD_3DG_A 24
|
||||
#define R8A779A0_PD_3DG_B 25
|
||||
#define R8A779A0_PD_A1CNN2 32
|
||||
#define R8A779A0_PD_A1DSP0 33
|
||||
#define R8A779A0_PD_A2IMP01 34
|
||||
#define R8A779A0_PD_A2DP0 35
|
||||
#define R8A779A0_PD_A2CV0 36
|
||||
#define R8A779A0_PD_A2CV1 37
|
||||
#define R8A779A0_PD_A2CV4 38
|
||||
#define R8A779A0_PD_A2CV6 39
|
||||
#define R8A779A0_PD_A2CN2 40
|
||||
#define R8A779A0_PD_A1CNN0 41
|
||||
#define R8A779A0_PD_A2CN0 42
|
||||
#define R8A779A0_PD_A3IR 43
|
||||
#define R8A779A0_PD_A1CNN1 44
|
||||
#define R8A779A0_PD_A1DSP1 45
|
||||
#define R8A779A0_PD_A2IMP23 46
|
||||
#define R8A779A0_PD_A2DP1 47
|
||||
#define R8A779A0_PD_A2CV2 48
|
||||
#define R8A779A0_PD_A2CV3 49
|
||||
#define R8A779A0_PD_A2CV5 50
|
||||
#define R8A779A0_PD_A2CV7 51
|
||||
#define R8A779A0_PD_A2CN1 52
|
||||
#define R8A779A0_PD_A3VIP0 56
|
||||
#define R8A779A0_PD_A3VIP1 57
|
||||
#define R8A779A0_PD_A3VIP2 58
|
||||
#define R8A779A0_PD_A3VIP3 59
|
||||
#define R8A779A0_PD_A3ISP01 60
|
||||
#define R8A779A0_PD_A3ISP23 61
|
||||
|
||||
/* Always-on power area */
|
||||
#define R8A779A0_PD_ALWAYS_ON 64
|
||||
|
||||
#endif /* __DT_BINDINGS_POWER_R8A779A0_SYSC_H__ */
|
||||
19
include/dt-bindings/power/summit,smb347-charger.h
Normal file
19
include/dt-bindings/power/summit,smb347-charger.h
Normal file
@@ -0,0 +1,19 @@
|
||||
/* SPDX-License-Identifier: (GPL-2.0-or-later or MIT) */
|
||||
/*
|
||||
* Author: David Heidelberg <david@ixit.cz>
|
||||
*/
|
||||
|
||||
#ifndef _DT_BINDINGS_SMB347_CHARGER_H
|
||||
#define _DT_BINDINGS_SMB347_CHARGER_H
|
||||
|
||||
/* Charging compensation method */
|
||||
#define SMB3XX_SOFT_TEMP_COMPENSATE_NONE 0
|
||||
#define SMB3XX_SOFT_TEMP_COMPENSATE_CURRENT 1
|
||||
#define SMB3XX_SOFT_TEMP_COMPENSATE_VOLTAGE 2
|
||||
|
||||
/* Charging enable control */
|
||||
#define SMB3XX_CHG_ENABLE_SW 0
|
||||
#define SMB3XX_CHG_ENABLE_PIN_ACTIVE_LOW 1
|
||||
#define SMB3XX_CHG_ENABLE_PIN_ACTIVE_HIGH 2
|
||||
|
||||
#endif
|
||||
@@ -58,7 +58,10 @@
|
||||
#define IMX8MQ_RESET_DDRC2_PRST 47 /* i.MX8MM/i.MX8MN does NOT support */
|
||||
#define IMX8MQ_RESET_DDRC2_CORE_RESET 48 /* i.MX8MM/i.MX8MN does NOT support */
|
||||
#define IMX8MQ_RESET_DDRC2_PHY_RESET 49 /* i.MX8MM/i.MX8MN does NOT support */
|
||||
#define IMX8MQ_RESET_SW_M4C_RST 50
|
||||
#define IMX8MQ_RESET_SW_M4P_RST 51
|
||||
#define IMX8MQ_RESET_M4_ENABLE 52
|
||||
|
||||
#define IMX8MQ_RESET_NUM 50
|
||||
#define IMX8MQ_RESET_NUM 53
|
||||
|
||||
#endif
|
||||
|
||||
68
include/dt-bindings/reset/sun50i-a100-ccu.h
Normal file
68
include/dt-bindings/reset/sun50i-a100-ccu.h
Normal file
@@ -0,0 +1,68 @@
|
||||
/* SPDX-License-Identifier: (GPL-2.0+ or MIT) */
|
||||
/*
|
||||
* Copyright (c) 2020 Yangtao Li <frank@allwinnertech.com>
|
||||
*/
|
||||
|
||||
#ifndef _DT_BINDINGS_RESET_SUN50I_A100_H_
|
||||
#define _DT_BINDINGS_RESET_SUN50I_A100_H_
|
||||
|
||||
#define RST_MBUS 0
|
||||
#define RST_BUS_DE 1
|
||||
#define RST_BUS_G2D 2
|
||||
#define RST_BUS_GPU 3
|
||||
#define RST_BUS_CE 4
|
||||
#define RST_BUS_VE 5
|
||||
#define RST_BUS_DMA 6
|
||||
#define RST_BUS_MSGBOX 7
|
||||
#define RST_BUS_SPINLOCK 8
|
||||
#define RST_BUS_HSTIMER 9
|
||||
#define RST_BUS_DBG 10
|
||||
#define RST_BUS_PSI 11
|
||||
#define RST_BUS_PWM 12
|
||||
#define RST_BUS_DRAM 13
|
||||
#define RST_BUS_NAND 14
|
||||
#define RST_BUS_MMC0 15
|
||||
#define RST_BUS_MMC1 16
|
||||
#define RST_BUS_MMC2 17
|
||||
#define RST_BUS_UART0 18
|
||||
#define RST_BUS_UART1 19
|
||||
#define RST_BUS_UART2 20
|
||||
#define RST_BUS_UART3 21
|
||||
#define RST_BUS_UART4 22
|
||||
#define RST_BUS_I2C0 23
|
||||
#define RST_BUS_I2C1 24
|
||||
#define RST_BUS_I2C2 25
|
||||
#define RST_BUS_I2C3 26
|
||||
#define RST_BUS_SPI0 27
|
||||
#define RST_BUS_SPI1 28
|
||||
#define RST_BUS_SPI2 29
|
||||
#define RST_BUS_EMAC 30
|
||||
#define RST_BUS_IR_RX 31
|
||||
#define RST_BUS_IR_TX 32
|
||||
#define RST_BUS_GPADC 33
|
||||
#define RST_BUS_THS 34
|
||||
#define RST_BUS_I2S0 35
|
||||
#define RST_BUS_I2S1 36
|
||||
#define RST_BUS_I2S2 37
|
||||
#define RST_BUS_I2S3 38
|
||||
#define RST_BUS_SPDIF 39
|
||||
#define RST_BUS_DMIC 40
|
||||
#define RST_BUS_AUDIO_CODEC 41
|
||||
#define RST_USB_PHY0 42
|
||||
#define RST_USB_PHY1 43
|
||||
#define RST_BUS_OHCI0 44
|
||||
#define RST_BUS_OHCI1 45
|
||||
#define RST_BUS_EHCI0 46
|
||||
#define RST_BUS_EHCI1 47
|
||||
#define RST_BUS_OTG 48
|
||||
#define RST_BUS_LRADC 49
|
||||
#define RST_BUS_DPSS_TOP0 50
|
||||
#define RST_BUS_DPSS_TOP1 51
|
||||
#define RST_BUS_MIPI_DSI 52
|
||||
#define RST_BUS_TCON_LCD 53
|
||||
#define RST_BUS_LVDS 54
|
||||
#define RST_BUS_LEDC 55
|
||||
#define RST_BUS_CSI 56
|
||||
#define RST_BUS_CSI_ISP 57
|
||||
|
||||
#endif /* _DT_BINDINGS_RESET_SUN50I_A100_H_ */
|
||||
18
include/dt-bindings/reset/sun50i-a100-r-ccu.h
Normal file
18
include/dt-bindings/reset/sun50i-a100-r-ccu.h
Normal file
@@ -0,0 +1,18 @@
|
||||
/* SPDX-License-Identifier: (GPL-2.0+ or MIT) */
|
||||
/*
|
||||
* Copyright (c) 2020 Yangtao Li <frank@allwinnertech.com>
|
||||
*/
|
||||
|
||||
#ifndef _DT_BINDINGS_RST_SUN50I_A100_R_CCU_H_
|
||||
#define _DT_BINDINGS_RST_SUN50I_A100_R_CCU_H_
|
||||
|
||||
#define RST_R_APB1_TIMER 0
|
||||
#define RST_R_APB1_BUS_PWM 1
|
||||
#define RST_R_APB1_PPU 2
|
||||
#define RST_R_APB2_UART 3
|
||||
#define RST_R_APB2_I2C0 4
|
||||
#define RST_R_APB2_I2C1 5
|
||||
#define RST_R_APB1_BUS_IR 6
|
||||
#define RST_R_AHB_BUS_RTC 7
|
||||
|
||||
#endif /* _DT_BINDINGS_RST_SUN50I_A100_R_CCU_H_ */
|
||||
10
include/dt-bindings/reset/tegra234-reset.h
Normal file
10
include/dt-bindings/reset/tegra234-reset.h
Normal file
@@ -0,0 +1,10 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/* Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. */
|
||||
|
||||
#ifndef DT_BINDINGS_RESET_TEGRA234_RESET_H
|
||||
#define DT_BINDINGS_RESET_TEGRA234_RESET_H
|
||||
|
||||
#define TEGRA234_RESET_SDMMC4 85
|
||||
#define TEGRA234_RESET_UARTA 100
|
||||
|
||||
#endif
|
||||
105
include/dt-bindings/reset/xlnx-versal-resets.h
Normal file
105
include/dt-bindings/reset/xlnx-versal-resets.h
Normal file
@@ -0,0 +1,105 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2020 Xilinx, Inc.
|
||||
*/
|
||||
|
||||
#ifndef _DT_BINDINGS_VERSAL_RESETS_H
|
||||
#define _DT_BINDINGS_VERSAL_RESETS_H
|
||||
|
||||
#define VERSAL_RST_PMC_POR (0xc30c001U)
|
||||
#define VERSAL_RST_PMC (0xc410002U)
|
||||
#define VERSAL_RST_PS_POR (0xc30c003U)
|
||||
#define VERSAL_RST_PL_POR (0xc30c004U)
|
||||
#define VERSAL_RST_NOC_POR (0xc30c005U)
|
||||
#define VERSAL_RST_FPD_POR (0xc30c006U)
|
||||
#define VERSAL_RST_ACPU_0_POR (0xc30c007U)
|
||||
#define VERSAL_RST_ACPU_1_POR (0xc30c008U)
|
||||
#define VERSAL_RST_OCM2_POR (0xc30c009U)
|
||||
#define VERSAL_RST_PS_SRST (0xc41000aU)
|
||||
#define VERSAL_RST_PL_SRST (0xc41000bU)
|
||||
#define VERSAL_RST_NOC (0xc41000cU)
|
||||
#define VERSAL_RST_NPI (0xc41000dU)
|
||||
#define VERSAL_RST_SYS_RST_1 (0xc41000eU)
|
||||
#define VERSAL_RST_SYS_RST_2 (0xc41000fU)
|
||||
#define VERSAL_RST_SYS_RST_3 (0xc410010U)
|
||||
#define VERSAL_RST_FPD (0xc410011U)
|
||||
#define VERSAL_RST_PL0 (0xc410012U)
|
||||
#define VERSAL_RST_PL1 (0xc410013U)
|
||||
#define VERSAL_RST_PL2 (0xc410014U)
|
||||
#define VERSAL_RST_PL3 (0xc410015U)
|
||||
#define VERSAL_RST_APU (0xc410016U)
|
||||
#define VERSAL_RST_ACPU_0 (0xc410017U)
|
||||
#define VERSAL_RST_ACPU_1 (0xc410018U)
|
||||
#define VERSAL_RST_ACPU_L2 (0xc410019U)
|
||||
#define VERSAL_RST_ACPU_GIC (0xc41001aU)
|
||||
#define VERSAL_RST_RPU_ISLAND (0xc41001bU)
|
||||
#define VERSAL_RST_RPU_AMBA (0xc41001cU)
|
||||
#define VERSAL_RST_R5_0 (0xc41001dU)
|
||||
#define VERSAL_RST_R5_1 (0xc41001eU)
|
||||
#define VERSAL_RST_SYSMON_PMC_SEQ_RST (0xc41001fU)
|
||||
#define VERSAL_RST_SYSMON_PMC_CFG_RST (0xc410020U)
|
||||
#define VERSAL_RST_SYSMON_FPD_CFG_RST (0xc410021U)
|
||||
#define VERSAL_RST_SYSMON_FPD_SEQ_RST (0xc410022U)
|
||||
#define VERSAL_RST_SYSMON_LPD (0xc410023U)
|
||||
#define VERSAL_RST_PDMA_RST1 (0xc410024U)
|
||||
#define VERSAL_RST_PDMA_RST0 (0xc410025U)
|
||||
#define VERSAL_RST_ADMA (0xc410026U)
|
||||
#define VERSAL_RST_TIMESTAMP (0xc410027U)
|
||||
#define VERSAL_RST_OCM (0xc410028U)
|
||||
#define VERSAL_RST_OCM2_RST (0xc410029U)
|
||||
#define VERSAL_RST_IPI (0xc41002aU)
|
||||
#define VERSAL_RST_SBI (0xc41002bU)
|
||||
#define VERSAL_RST_LPD (0xc41002cU)
|
||||
#define VERSAL_RST_QSPI (0xc10402dU)
|
||||
#define VERSAL_RST_OSPI (0xc10402eU)
|
||||
#define VERSAL_RST_SDIO_0 (0xc10402fU)
|
||||
#define VERSAL_RST_SDIO_1 (0xc104030U)
|
||||
#define VERSAL_RST_I2C_PMC (0xc104031U)
|
||||
#define VERSAL_RST_GPIO_PMC (0xc104032U)
|
||||
#define VERSAL_RST_GEM_0 (0xc104033U)
|
||||
#define VERSAL_RST_GEM_1 (0xc104034U)
|
||||
#define VERSAL_RST_SPARE (0xc104035U)
|
||||
#define VERSAL_RST_USB_0 (0xc104036U)
|
||||
#define VERSAL_RST_UART_0 (0xc104037U)
|
||||
#define VERSAL_RST_UART_1 (0xc104038U)
|
||||
#define VERSAL_RST_SPI_0 (0xc104039U)
|
||||
#define VERSAL_RST_SPI_1 (0xc10403aU)
|
||||
#define VERSAL_RST_CAN_FD_0 (0xc10403bU)
|
||||
#define VERSAL_RST_CAN_FD_1 (0xc10403cU)
|
||||
#define VERSAL_RST_I2C_0 (0xc10403dU)
|
||||
#define VERSAL_RST_I2C_1 (0xc10403eU)
|
||||
#define VERSAL_RST_GPIO_LPD (0xc10403fU)
|
||||
#define VERSAL_RST_TTC_0 (0xc104040U)
|
||||
#define VERSAL_RST_TTC_1 (0xc104041U)
|
||||
#define VERSAL_RST_TTC_2 (0xc104042U)
|
||||
#define VERSAL_RST_TTC_3 (0xc104043U)
|
||||
#define VERSAL_RST_SWDT_FPD (0xc104044U)
|
||||
#define VERSAL_RST_SWDT_LPD (0xc104045U)
|
||||
#define VERSAL_RST_USB (0xc104046U)
|
||||
#define VERSAL_RST_DPC (0xc208047U)
|
||||
#define VERSAL_RST_PMCDBG (0xc208048U)
|
||||
#define VERSAL_RST_DBG_TRACE (0xc208049U)
|
||||
#define VERSAL_RST_DBG_FPD (0xc20804aU)
|
||||
#define VERSAL_RST_DBG_TSTMP (0xc20804bU)
|
||||
#define VERSAL_RST_RPU0_DBG (0xc20804cU)
|
||||
#define VERSAL_RST_RPU1_DBG (0xc20804dU)
|
||||
#define VERSAL_RST_HSDP (0xc20804eU)
|
||||
#define VERSAL_RST_DBG_LPD (0xc20804fU)
|
||||
#define VERSAL_RST_CPM_POR (0xc30c050U)
|
||||
#define VERSAL_RST_CPM (0xc410051U)
|
||||
#define VERSAL_RST_CPMDBG (0xc208052U)
|
||||
#define VERSAL_RST_PCIE_CFG (0xc410053U)
|
||||
#define VERSAL_RST_PCIE_CORE0 (0xc410054U)
|
||||
#define VERSAL_RST_PCIE_CORE1 (0xc410055U)
|
||||
#define VERSAL_RST_PCIE_DMA (0xc410056U)
|
||||
#define VERSAL_RST_CMN (0xc410057U)
|
||||
#define VERSAL_RST_L2_0 (0xc410058U)
|
||||
#define VERSAL_RST_L2_1 (0xc410059U)
|
||||
#define VERSAL_RST_ADDR_REMAP (0xc41005aU)
|
||||
#define VERSAL_RST_CPI0 (0xc41005bU)
|
||||
#define VERSAL_RST_CPI1 (0xc41005cU)
|
||||
#define VERSAL_RST_XRAM (0xc30c05dU)
|
||||
#define VERSAL_RST_AIE_ARRAY (0xc10405eU)
|
||||
#define VERSAL_RST_AIE_SHIM (0xc10405fU)
|
||||
|
||||
#endif
|
||||
17
include/dt-bindings/soc/bcm6318-pm.h
Normal file
17
include/dt-bindings/soc/bcm6318-pm.h
Normal file
@@ -0,0 +1,17 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
|
||||
#ifndef __DT_BINDINGS_BMIPS_BCM6318_PM_H
|
||||
#define __DT_BINDINGS_BMIPS_BCM6318_PM_H
|
||||
|
||||
#define BCM6318_POWER_DOMAIN_PCIE 0
|
||||
#define BCM6318_POWER_DOMAIN_USB 1
|
||||
#define BCM6318_POWER_DOMAIN_EPHY0 2
|
||||
#define BCM6318_POWER_DOMAIN_EPHY1 3
|
||||
#define BCM6318_POWER_DOMAIN_EPHY2 4
|
||||
#define BCM6318_POWER_DOMAIN_EPHY3 5
|
||||
#define BCM6318_POWER_DOMAIN_LDO2P5 6
|
||||
#define BCM6318_POWER_DOMAIN_LDO2P9 7
|
||||
#define BCM6318_POWER_DOMAIN_SW1P0 8
|
||||
#define BCM6318_POWER_DOMAIN_PAD 9
|
||||
|
||||
#endif /* __DT_BINDINGS_BMIPS_BCM6318_PM_H */
|
||||
21
include/dt-bindings/soc/bcm63268-pm.h
Normal file
21
include/dt-bindings/soc/bcm63268-pm.h
Normal file
@@ -0,0 +1,21 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
|
||||
#ifndef __DT_BINDINGS_BMIPS_BCM63268_PM_H
|
||||
#define __DT_BINDINGS_BMIPS_BCM63268_PM_H
|
||||
|
||||
#define BCM63268_POWER_DOMAIN_SAR 0
|
||||
#define BCM63268_POWER_DOMAIN_IPSEC 1
|
||||
#define BCM63268_POWER_DOMAIN_MIPS 2
|
||||
#define BCM63268_POWER_DOMAIN_DECT 3
|
||||
#define BCM63268_POWER_DOMAIN_USBH 4
|
||||
#define BCM63268_POWER_DOMAIN_USBD 5
|
||||
#define BCM63268_POWER_DOMAIN_ROBOSW 6
|
||||
#define BCM63268_POWER_DOMAIN_PCM 7
|
||||
#define BCM63268_POWER_DOMAIN_PERIPH 8
|
||||
#define BCM63268_POWER_DOMAIN_VDSL_PHY 9
|
||||
#define BCM63268_POWER_DOMAIN_VDSL_MIPS 10
|
||||
#define BCM63268_POWER_DOMAIN_FAP 11
|
||||
#define BCM63268_POWER_DOMAIN_PCIE 12
|
||||
#define BCM63268_POWER_DOMAIN_WLAN_PADS 13
|
||||
|
||||
#endif /* __DT_BINDINGS_BMIPS_BCM63268_PM_H */
|
||||
17
include/dt-bindings/soc/bcm6328-pm.h
Normal file
17
include/dt-bindings/soc/bcm6328-pm.h
Normal file
@@ -0,0 +1,17 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
|
||||
#ifndef __DT_BINDINGS_BMIPS_BCM6328_PM_H
|
||||
#define __DT_BINDINGS_BMIPS_BCM6328_PM_H
|
||||
|
||||
#define BCM6328_POWER_DOMAIN_ADSL2_MIPS 0
|
||||
#define BCM6328_POWER_DOMAIN_ADSL2_PHY 1
|
||||
#define BCM6328_POWER_DOMAIN_ADSL2_AFE 2
|
||||
#define BCM6328_POWER_DOMAIN_SAR 3
|
||||
#define BCM6328_POWER_DOMAIN_PCM 4
|
||||
#define BCM6328_POWER_DOMAIN_USBD 5
|
||||
#define BCM6328_POWER_DOMAIN_USBH 6
|
||||
#define BCM6328_POWER_DOMAIN_PCIE 7
|
||||
#define BCM6328_POWER_DOMAIN_ROBOSW 8
|
||||
#define BCM6328_POWER_DOMAIN_EPHY 9
|
||||
|
||||
#endif /* __DT_BINDINGS_BMIPS_BCM6328_PM_H */
|
||||
21
include/dt-bindings/soc/bcm6362-pm.h
Normal file
21
include/dt-bindings/soc/bcm6362-pm.h
Normal file
@@ -0,0 +1,21 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
|
||||
#ifndef __DT_BINDINGS_BMIPS_BCM6362_PM_H
|
||||
#define __DT_BINDINGS_BMIPS_BCM6362_PM_H
|
||||
|
||||
#define BCM6362_POWER_DOMAIN_SAR 0
|
||||
#define BCM6362_POWER_DOMAIN_IPSEC 1
|
||||
#define BCM6362_POWER_DOMAIN_MIPS 2
|
||||
#define BCM6362_POWER_DOMAIN_DECT 3
|
||||
#define BCM6362_POWER_DOMAIN_USBH 4
|
||||
#define BCM6362_POWER_DOMAIN_USBD 5
|
||||
#define BCM6362_POWER_DOMAIN_ROBOSW 6
|
||||
#define BCM6362_POWER_DOMAIN_PCM 7
|
||||
#define BCM6362_POWER_DOMAIN_PERIPH 8
|
||||
#define BCM6362_POWER_DOMAIN_ADSL_PHY 9
|
||||
#define BCM6362_POWER_DOMAIN_GMII_PADS 10
|
||||
#define BCM6362_POWER_DOMAIN_FAP 11
|
||||
#define BCM6362_POWER_DOMAIN_PCIE 12
|
||||
#define BCM6362_POWER_DOMAIN_WLAN_PADS 13
|
||||
|
||||
#endif /* __DT_BINDINGS_BMIPS_BCM6362_PM_H */
|
||||
@@ -25,6 +25,7 @@ typedef void (*kunit_resource_free_t)(struct kunit_resource *);
|
||||
/**
|
||||
* struct kunit_resource - represents a *test managed resource*
|
||||
* @data: for the user to store arbitrary data.
|
||||
* @name: optional name
|
||||
* @free: a user supplied function to free the resource. Populated by
|
||||
* kunit_resource_alloc().
|
||||
*
|
||||
@@ -80,10 +81,10 @@ typedef void (*kunit_resource_free_t)(struct kunit_resource *);
|
||||
*/
|
||||
struct kunit_resource {
|
||||
void *data;
|
||||
const char *name; /* optional name */
|
||||
const char *name;
|
||||
kunit_resource_free_t free;
|
||||
|
||||
/* private: internal use only. */
|
||||
kunit_resource_free_t free;
|
||||
struct kref refcount;
|
||||
struct list_head node;
|
||||
};
|
||||
@@ -238,47 +239,79 @@ size_t kunit_suite_num_test_cases(struct kunit_suite *suite);
|
||||
unsigned int kunit_test_case_num(struct kunit_suite *suite,
|
||||
struct kunit_case *test_case);
|
||||
|
||||
int __kunit_test_suites_init(struct kunit_suite **suites);
|
||||
int __kunit_test_suites_init(struct kunit_suite * const * const suites);
|
||||
|
||||
void __kunit_test_suites_exit(struct kunit_suite **suites);
|
||||
|
||||
#if IS_BUILTIN(CONFIG_KUNIT)
|
||||
int kunit_run_all_tests(void);
|
||||
#else
|
||||
static inline int kunit_run_all_tests(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* IS_BUILTIN(CONFIG_KUNIT) */
|
||||
|
||||
#ifdef MODULE
|
||||
/**
|
||||
* kunit_test_suites_for_module() - used to register one or more
|
||||
* &struct kunit_suite with KUnit.
|
||||
*
|
||||
* @__suites: a statically allocated list of &struct kunit_suite.
|
||||
*
|
||||
* Registers @__suites with the test framework. See &struct kunit_suite for
|
||||
* more information.
|
||||
*
|
||||
* If a test suite is built-in, module_init() gets translated into
|
||||
* an initcall which we don't want as the idea is that for builtins
|
||||
* the executor will manage execution. So ensure we do not define
|
||||
* module_{init|exit} functions for the builtin case when registering
|
||||
* suites via kunit_test_suites() below.
|
||||
*/
|
||||
#define kunit_test_suites_for_module(__suites) \
|
||||
static int __init kunit_test_suites_init(void) \
|
||||
{ \
|
||||
return __kunit_test_suites_init(__suites); \
|
||||
} \
|
||||
module_init(kunit_test_suites_init); \
|
||||
\
|
||||
static void __exit kunit_test_suites_exit(void) \
|
||||
{ \
|
||||
return __kunit_test_suites_exit(__suites); \
|
||||
} \
|
||||
module_exit(kunit_test_suites_exit)
|
||||
#else
|
||||
#define kunit_test_suites_for_module(__suites)
|
||||
#endif /* MODULE */
|
||||
|
||||
#define __kunit_test_suites(unique_array, unique_suites, ...) \
|
||||
static struct kunit_suite *unique_array[] = { __VA_ARGS__, NULL }; \
|
||||
kunit_test_suites_for_module(unique_array); \
|
||||
static struct kunit_suite **unique_suites \
|
||||
__used __section(".kunit_test_suites") = unique_array
|
||||
|
||||
/**
|
||||
* kunit_test_suites() - used to register one or more &struct kunit_suite
|
||||
* with KUnit.
|
||||
*
|
||||
* @suites_list...: a statically allocated list of &struct kunit_suite.
|
||||
* @__suites: a statically allocated list of &struct kunit_suite.
|
||||
*
|
||||
* Registers @suites_list with the test framework. See &struct kunit_suite for
|
||||
* Registers @suites with the test framework. See &struct kunit_suite for
|
||||
* more information.
|
||||
*
|
||||
* When builtin, KUnit tests are all run as late_initcalls; this means
|
||||
* that they cannot test anything where tests must run at a different init
|
||||
* phase. One significant restriction resulting from this is that KUnit
|
||||
* cannot reliably test anything that is initialize in the late_init phase;
|
||||
* another is that KUnit is useless to test things that need to be run in
|
||||
* an earlier init phase.
|
||||
* When builtin, KUnit tests are all run via executor; this is done
|
||||
* by placing the array of struct kunit_suite * in the .kunit_test_suites
|
||||
* ELF section.
|
||||
*
|
||||
* An alternative is to build the tests as a module. Because modules
|
||||
* do not support multiple late_initcall()s, we need to initialize an
|
||||
* array of suites for a module.
|
||||
* An alternative is to build the tests as a module. Because modules do not
|
||||
* support multiple initcall()s, we need to initialize an array of suites for a
|
||||
* module.
|
||||
*
|
||||
* TODO(brendanhiggins@google.com): Don't run all KUnit tests as
|
||||
* late_initcalls. I have some future work planned to dispatch all KUnit
|
||||
* tests from the same place, and at the very least to do so after
|
||||
* everything else is definitely initialized.
|
||||
*/
|
||||
#define kunit_test_suites(suites_list...) \
|
||||
static struct kunit_suite *suites[] = {suites_list, NULL}; \
|
||||
static int kunit_test_suites_init(void) \
|
||||
{ \
|
||||
return __kunit_test_suites_init(suites); \
|
||||
} \
|
||||
late_initcall(kunit_test_suites_init); \
|
||||
static void __exit kunit_test_suites_exit(void) \
|
||||
{ \
|
||||
return __kunit_test_suites_exit(suites); \
|
||||
} \
|
||||
module_exit(kunit_test_suites_exit)
|
||||
#define kunit_test_suites(__suites...) \
|
||||
__kunit_test_suites(__UNIQUE_ID(array), \
|
||||
__UNIQUE_ID(suites), \
|
||||
##__suites)
|
||||
|
||||
#define kunit_test_suite(suite) kunit_test_suites(&suite)
|
||||
|
||||
@@ -348,6 +381,7 @@ static inline void kunit_put_resource(struct kunit_resource *res)
|
||||
* none is supplied, the resource data value is simply set to @data.
|
||||
* If an init function is supplied, @data is passed to it instead.
|
||||
* @free: a user-supplied function to free the resource (if needed).
|
||||
* @res: The resource.
|
||||
* @data: value to pass to init function or set in resource data field.
|
||||
*/
|
||||
int kunit_add_resource(struct kunit *test,
|
||||
@@ -361,7 +395,9 @@ int kunit_add_resource(struct kunit *test,
|
||||
* @test: The test context object.
|
||||
* @init: a user-supplied function to initialize the resource data, if needed.
|
||||
* @free: a user-supplied function to free the resource data, if needed.
|
||||
* @name_data: name and data to be set for resource.
|
||||
* @res: The resource.
|
||||
* @name: name to be set for resource.
|
||||
* @data: value to pass to init function or set in resource data field.
|
||||
*/
|
||||
int kunit_add_named_resource(struct kunit *test,
|
||||
kunit_resource_init_t init,
|
||||
@@ -499,8 +535,8 @@ static inline int kunit_destroy_named_resource(struct kunit *test,
|
||||
}
|
||||
|
||||
/**
|
||||
* kunit_remove_resource: remove resource from resource list associated with
|
||||
* test.
|
||||
* kunit_remove_resource() - remove resource from resource list associated with
|
||||
* test.
|
||||
* @test: The test context object.
|
||||
* @res: The resource to be removed.
|
||||
*
|
||||
@@ -1069,7 +1105,7 @@ do { \
|
||||
KUNIT_ASSERTION(test, \
|
||||
strcmp(__left, __right) op 0, \
|
||||
kunit_binary_str_assert, \
|
||||
KUNIT_INIT_BINARY_ASSERT_STRUCT(test, \
|
||||
KUNIT_INIT_BINARY_STR_ASSERT_STRUCT(test, \
|
||||
assert_type, \
|
||||
#op, \
|
||||
#left, \
|
||||
|
||||
@@ -35,6 +35,7 @@ struct kvm_pmu {
|
||||
u64 kvm_pmu_get_counter_value(struct kvm_vcpu *vcpu, u64 select_idx);
|
||||
void kvm_pmu_set_counter_value(struct kvm_vcpu *vcpu, u64 select_idx, u64 val);
|
||||
u64 kvm_pmu_valid_counter_mask(struct kvm_vcpu *vcpu);
|
||||
u64 kvm_pmu_get_pmceid(struct kvm_vcpu *vcpu, bool pmceid1);
|
||||
void kvm_pmu_vcpu_init(struct kvm_vcpu *vcpu);
|
||||
void kvm_pmu_vcpu_reset(struct kvm_vcpu *vcpu);
|
||||
void kvm_pmu_vcpu_destroy(struct kvm_vcpu *vcpu);
|
||||
@@ -109,6 +110,10 @@ static inline int kvm_arm_pmu_v3_enable(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline u64 kvm_pmu_get_pmceid(struct kvm_vcpu *vcpu, bool pmceid1)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1153,7 +1153,7 @@ struct acpi_probe_entry {
|
||||
#define ACPI_DECLARE_PROBE_ENTRY(table, name, table_id, subtable, \
|
||||
valid, data, fn) \
|
||||
static const struct acpi_probe_entry __acpi_probe_##name \
|
||||
__used __section(__##table##_acpi_probe_table) = { \
|
||||
__used __section("__" #table "_acpi_probe_table") = { \
|
||||
.id = table_id, \
|
||||
.type = subtable, \
|
||||
.subtable_valid = valid, \
|
||||
@@ -1164,7 +1164,7 @@ struct acpi_probe_entry {
|
||||
#define ACPI_DECLARE_SUBTABLE_PROBE_ENTRY(table, name, table_id, \
|
||||
subtable, valid, data, fn) \
|
||||
static const struct acpi_probe_entry __acpi_probe_##name \
|
||||
__used __section(__##table##_acpi_probe_table) = { \
|
||||
__used __section("__" #table "_acpi_probe_table") = { \
|
||||
.id = table_id, \
|
||||
.type = subtable, \
|
||||
.subtable_valid = valid, \
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
#define ARM_SMCCC_OWNER_OEM 3
|
||||
#define ARM_SMCCC_OWNER_STANDARD 4
|
||||
#define ARM_SMCCC_OWNER_STANDARD_HYP 5
|
||||
#define ARM_SMCCC_OWNER_VENDOR_HYP 6
|
||||
#define ARM_SMCCC_OWNER_TRUSTED_APP 48
|
||||
#define ARM_SMCCC_OWNER_TRUSTED_APP_END 49
|
||||
#define ARM_SMCCC_OWNER_TRUSTED_OS 50
|
||||
@@ -86,6 +87,8 @@
|
||||
ARM_SMCCC_SMC_32, \
|
||||
0, 0x7fff)
|
||||
|
||||
#define SMCCC_ARCH_WORKAROUND_RET_UNAFFECTED 1
|
||||
|
||||
/* Paravirtualised time calls (defined by ARM DEN0057A) */
|
||||
#define ARM_SMCCC_HV_PV_TIME_FEATURES \
|
||||
ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \
|
||||
@@ -227,87 +230,67 @@ asmlinkage void __arm_smccc_hvc(unsigned long a0, unsigned long a1,
|
||||
#define __count_args(...) \
|
||||
___count_args(__VA_ARGS__, 7, 6, 5, 4, 3, 2, 1, 0)
|
||||
|
||||
#define __constraint_write_0 \
|
||||
"+r" (r0), "=&r" (r1), "=&r" (r2), "=&r" (r3)
|
||||
#define __constraint_write_1 \
|
||||
"+r" (r0), "+r" (r1), "=&r" (r2), "=&r" (r3)
|
||||
#define __constraint_write_2 \
|
||||
"+r" (r0), "+r" (r1), "+r" (r2), "=&r" (r3)
|
||||
#define __constraint_write_3 \
|
||||
"+r" (r0), "+r" (r1), "+r" (r2), "+r" (r3)
|
||||
#define __constraint_write_4 __constraint_write_3
|
||||
#define __constraint_write_5 __constraint_write_4
|
||||
#define __constraint_write_6 __constraint_write_5
|
||||
#define __constraint_write_7 __constraint_write_6
|
||||
|
||||
#define __constraint_read_0
|
||||
#define __constraint_read_1
|
||||
#define __constraint_read_2
|
||||
#define __constraint_read_3
|
||||
#define __constraint_read_4 "r" (r4)
|
||||
#define __constraint_read_5 __constraint_read_4, "r" (r5)
|
||||
#define __constraint_read_6 __constraint_read_5, "r" (r6)
|
||||
#define __constraint_read_7 __constraint_read_6, "r" (r7)
|
||||
#define __constraint_read_0 "r" (arg0)
|
||||
#define __constraint_read_1 __constraint_read_0, "r" (arg1)
|
||||
#define __constraint_read_2 __constraint_read_1, "r" (arg2)
|
||||
#define __constraint_read_3 __constraint_read_2, "r" (arg3)
|
||||
#define __constraint_read_4 __constraint_read_3, "r" (arg4)
|
||||
#define __constraint_read_5 __constraint_read_4, "r" (arg5)
|
||||
#define __constraint_read_6 __constraint_read_5, "r" (arg6)
|
||||
#define __constraint_read_7 __constraint_read_6, "r" (arg7)
|
||||
|
||||
#define __declare_arg_0(a0, res) \
|
||||
struct arm_smccc_res *___res = res; \
|
||||
register unsigned long r0 asm("r0") = (u32)a0; \
|
||||
register unsigned long r1 asm("r1"); \
|
||||
register unsigned long r2 asm("r2"); \
|
||||
register unsigned long r3 asm("r3")
|
||||
register unsigned long arg0 asm("r0") = (u32)a0
|
||||
|
||||
#define __declare_arg_1(a0, a1, res) \
|
||||
typeof(a1) __a1 = a1; \
|
||||
struct arm_smccc_res *___res = res; \
|
||||
register unsigned long r0 asm("r0") = (u32)a0; \
|
||||
register unsigned long r1 asm("r1") = __a1; \
|
||||
register unsigned long r2 asm("r2"); \
|
||||
register unsigned long r3 asm("r3")
|
||||
register unsigned long arg0 asm("r0") = (u32)a0; \
|
||||
register typeof(a1) arg1 asm("r1") = __a1
|
||||
|
||||
#define __declare_arg_2(a0, a1, a2, res) \
|
||||
typeof(a1) __a1 = a1; \
|
||||
typeof(a2) __a2 = a2; \
|
||||
struct arm_smccc_res *___res = res; \
|
||||
register unsigned long r0 asm("r0") = (u32)a0; \
|
||||
register unsigned long r1 asm("r1") = __a1; \
|
||||
register unsigned long r2 asm("r2") = __a2; \
|
||||
register unsigned long r3 asm("r3")
|
||||
register unsigned long arg0 asm("r0") = (u32)a0; \
|
||||
register typeof(a1) arg1 asm("r1") = __a1; \
|
||||
register typeof(a2) arg2 asm("r2") = __a2
|
||||
|
||||
#define __declare_arg_3(a0, a1, a2, a3, res) \
|
||||
typeof(a1) __a1 = a1; \
|
||||
typeof(a2) __a2 = a2; \
|
||||
typeof(a3) __a3 = a3; \
|
||||
struct arm_smccc_res *___res = res; \
|
||||
register unsigned long r0 asm("r0") = (u32)a0; \
|
||||
register unsigned long r1 asm("r1") = __a1; \
|
||||
register unsigned long r2 asm("r2") = __a2; \
|
||||
register unsigned long r3 asm("r3") = __a3
|
||||
register unsigned long arg0 asm("r0") = (u32)a0; \
|
||||
register typeof(a1) arg1 asm("r1") = __a1; \
|
||||
register typeof(a2) arg2 asm("r2") = __a2; \
|
||||
register typeof(a3) arg3 asm("r3") = __a3
|
||||
|
||||
#define __declare_arg_4(a0, a1, a2, a3, a4, res) \
|
||||
typeof(a4) __a4 = a4; \
|
||||
__declare_arg_3(a0, a1, a2, a3, res); \
|
||||
register unsigned long r4 asm("r4") = __a4
|
||||
register typeof(a4) arg4 asm("r4") = __a4
|
||||
|
||||
#define __declare_arg_5(a0, a1, a2, a3, a4, a5, res) \
|
||||
typeof(a5) __a5 = a5; \
|
||||
__declare_arg_4(a0, a1, a2, a3, a4, res); \
|
||||
register unsigned long r5 asm("r5") = __a5
|
||||
register typeof(a5) arg5 asm("r5") = __a5
|
||||
|
||||
#define __declare_arg_6(a0, a1, a2, a3, a4, a5, a6, res) \
|
||||
typeof(a6) __a6 = a6; \
|
||||
__declare_arg_5(a0, a1, a2, a3, a4, a5, res); \
|
||||
register unsigned long r6 asm("r6") = __a6
|
||||
register typeof(a6) arg6 asm("r6") = __a6
|
||||
|
||||
#define __declare_arg_7(a0, a1, a2, a3, a4, a5, a6, a7, res) \
|
||||
typeof(a7) __a7 = a7; \
|
||||
__declare_arg_6(a0, a1, a2, a3, a4, a5, a6, res); \
|
||||
register unsigned long r7 asm("r7") = __a7
|
||||
register typeof(a7) arg7 asm("r7") = __a7
|
||||
|
||||
#define ___declare_args(count, ...) __declare_arg_ ## count(__VA_ARGS__)
|
||||
#define __declare_args(count, ...) ___declare_args(count, __VA_ARGS__)
|
||||
|
||||
#define ___constraints(count) \
|
||||
: __constraint_write_ ## count \
|
||||
: __constraint_read_ ## count \
|
||||
: "memory"
|
||||
#define __constraints(count) ___constraints(count)
|
||||
@@ -319,8 +302,13 @@ asmlinkage void __arm_smccc_hvc(unsigned long a0, unsigned long a1,
|
||||
*/
|
||||
#define __arm_smccc_1_1(inst, ...) \
|
||||
do { \
|
||||
register unsigned long r0 asm("r0"); \
|
||||
register unsigned long r1 asm("r1"); \
|
||||
register unsigned long r2 asm("r2"); \
|
||||
register unsigned long r3 asm("r3"); \
|
||||
__declare_args(__count_args(__VA_ARGS__), __VA_ARGS__); \
|
||||
asm volatile(inst "\n" \
|
||||
asm volatile(inst "\n" : \
|
||||
"=r" (r0), "=r" (r1), "=r" (r2), "=r" (r3) \
|
||||
__constraints(__count_args(__VA_ARGS__))); \
|
||||
if (___res) \
|
||||
*___res = (typeof(*___res)){r0, r1, r2, r3}; \
|
||||
@@ -366,7 +354,7 @@ asmlinkage void __arm_smccc_hvc(unsigned long a0, unsigned long a1,
|
||||
#define __fail_smccc_1_1(...) \
|
||||
do { \
|
||||
__declare_args(__count_args(__VA_ARGS__), __VA_ARGS__); \
|
||||
asm ("" __constraints(__count_args(__VA_ARGS__))); \
|
||||
asm ("" : __constraints(__count_args(__VA_ARGS__))); \
|
||||
if (___res) \
|
||||
___res->a0 = SMCCC_RET_NOT_SUPPORTED; \
|
||||
} while (0)
|
||||
|
||||
@@ -9,9 +9,19 @@
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/vmalloc.h>
|
||||
|
||||
struct ssb_sprom;
|
||||
|
||||
#ifdef CONFIG_BCM47XX_SPROM
|
||||
void bcm47xx_fill_sprom(struct ssb_sprom *sprom, const char *prefix,
|
||||
bool fallback);
|
||||
int bcm47xx_sprom_register_fallbacks(void);
|
||||
#else
|
||||
static inline void bcm47xx_fill_sprom(struct ssb_sprom *sprom,
|
||||
const char *prefix,
|
||||
bool fallback)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int bcm47xx_sprom_register_fallbacks(void)
|
||||
{
|
||||
return -ENOTSUPP;
|
||||
|
||||
@@ -84,7 +84,7 @@ struct bcm_tag {
|
||||
char flash_layout_ver[FLASHLAYOUTVER_LEN];
|
||||
/* 196-199: kernel+rootfs CRC32 */
|
||||
__u32 fskernel_crc;
|
||||
/* 200-215: Unused except on Alice Gate where is is information */
|
||||
/* 200-215: Unused except on Alice Gate where it is information */
|
||||
char information2[TAGINFO2_LEN];
|
||||
/* 216-219: CRC32 of image less imagetag (kernel for Alice Gate) */
|
||||
__u32 image_crc;
|
||||
|
||||
@@ -188,12 +188,10 @@ static inline unsigned fls_long(unsigned long l)
|
||||
|
||||
static inline int get_count_order(unsigned int count)
|
||||
{
|
||||
int order;
|
||||
if (count == 0)
|
||||
return -1;
|
||||
|
||||
order = fls(count) - 1;
|
||||
if (count & (count - 1))
|
||||
order++;
|
||||
return order;
|
||||
return fls(--count);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -206,10 +204,7 @@ static inline int get_count_order_long(unsigned long l)
|
||||
{
|
||||
if (l == 0UL)
|
||||
return -1;
|
||||
else if (l & (l - 1UL))
|
||||
return (int)fls_long(l);
|
||||
else
|
||||
return (int)fls_long(l) - 1;
|
||||
return (int)fls_long(--l);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -235,6 +235,8 @@ enum hctx_type {
|
||||
* @flags: Zero or more BLK_MQ_F_* flags.
|
||||
* @driver_data: Pointer to data owned by the block driver that created this
|
||||
* tag set.
|
||||
* @active_queues_shared_sbitmap:
|
||||
* number of active request queues per tag set.
|
||||
* @__bitmap_tags: A shared tags sbitmap, used over all hctx's
|
||||
* @__breserved_tags:
|
||||
* A shared reserved tags sbitmap, used over all hctx's
|
||||
|
||||
@@ -104,6 +104,24 @@ typedef u8 __bitwise blk_status_t;
|
||||
*/
|
||||
#define BLK_STS_ZONE_RESOURCE ((__force blk_status_t)14)
|
||||
|
||||
/*
|
||||
* BLK_STS_ZONE_OPEN_RESOURCE is returned from the driver in the completion
|
||||
* path if the device returns a status indicating that too many zone resources
|
||||
* are currently open. The same command should be successful if resubmitted
|
||||
* after the number of open zones decreases below the device's limits, which is
|
||||
* reported in the request_queue's max_open_zones.
|
||||
*/
|
||||
#define BLK_STS_ZONE_OPEN_RESOURCE ((__force blk_status_t)15)
|
||||
|
||||
/*
|
||||
* BLK_STS_ZONE_ACTIVE_RESOURCE is returned from the driver in the completion
|
||||
* path if the device returns a status indicating that too many zone resources
|
||||
* are currently active. The same command should be successful if resubmitted
|
||||
* after the number of active zones decreases below the device's limits, which
|
||||
* is reported in the request_queue's max_active_zones.
|
||||
*/
|
||||
#define BLK_STS_ZONE_ACTIVE_RESOURCE ((__force blk_status_t)16)
|
||||
|
||||
/**
|
||||
* blk_path_error - returns true if error may be path related
|
||||
* @error: status the request was completed with
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <linux/genhd.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/llist.h>
|
||||
#include <linux/minmax.h>
|
||||
#include <linux/timer.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/pagemap.h>
|
||||
|
||||
@@ -136,7 +136,7 @@ int __cgroup_bpf_check_dev_permission(short dev_type, u32 major, u32 minor,
|
||||
|
||||
int __cgroup_bpf_run_filter_sysctl(struct ctl_table_header *head,
|
||||
struct ctl_table *table, int write,
|
||||
void **buf, size_t *pcount, loff_t *ppos,
|
||||
char **buf, size_t *pcount, loff_t *ppos,
|
||||
enum bpf_attach_type type);
|
||||
|
||||
int __cgroup_bpf_run_filter_setsockopt(struct sock *sock, int *level,
|
||||
@@ -279,6 +279,31 @@ int bpf_percpu_cgroup_storage_update(struct bpf_map *map, void *key,
|
||||
#define BPF_CGROUP_RUN_PROG_UDP6_RECVMSG_LOCK(sk, uaddr) \
|
||||
BPF_CGROUP_RUN_SA_PROG_LOCK(sk, uaddr, BPF_CGROUP_UDP6_RECVMSG, NULL)
|
||||
|
||||
/* The SOCK_OPS"_SK" macro should be used when sock_ops->sk is not a
|
||||
* fullsock and its parent fullsock cannot be traced by
|
||||
* sk_to_full_sk().
|
||||
*
|
||||
* e.g. sock_ops->sk is a request_sock and it is under syncookie mode.
|
||||
* Its listener-sk is not attached to the rsk_listener.
|
||||
* In this case, the caller holds the listener-sk (unlocked),
|
||||
* set its sock_ops->sk to req_sk, and call this SOCK_OPS"_SK" with
|
||||
* the listener-sk such that the cgroup-bpf-progs of the
|
||||
* listener-sk will be run.
|
||||
*
|
||||
* Regardless of syncookie mode or not,
|
||||
* calling bpf_setsockopt on listener-sk will not make sense anyway,
|
||||
* so passing 'sock_ops->sk == req_sk' to the bpf prog is appropriate here.
|
||||
*/
|
||||
#define BPF_CGROUP_RUN_PROG_SOCK_OPS_SK(sock_ops, sk) \
|
||||
({ \
|
||||
int __ret = 0; \
|
||||
if (cgroup_bpf_enabled) \
|
||||
__ret = __cgroup_bpf_run_filter_sock_ops(sk, \
|
||||
sock_ops, \
|
||||
BPF_CGROUP_SOCK_OPS); \
|
||||
__ret; \
|
||||
})
|
||||
|
||||
#define BPF_CGROUP_RUN_PROG_SOCK_OPS(sock_ops) \
|
||||
({ \
|
||||
int __ret = 0; \
|
||||
|
||||
@@ -34,6 +34,8 @@ struct btf_type;
|
||||
struct exception_table_entry;
|
||||
struct seq_operations;
|
||||
struct bpf_iter_aux_info;
|
||||
struct bpf_local_storage;
|
||||
struct bpf_local_storage_map;
|
||||
|
||||
extern struct idr btf_idr;
|
||||
extern spinlock_t btf_idr_lock;
|
||||
@@ -80,7 +82,7 @@ struct bpf_map_ops {
|
||||
void *(*map_fd_get_ptr)(struct bpf_map *map, struct file *map_file,
|
||||
int fd);
|
||||
void (*map_fd_put_ptr)(void *ptr);
|
||||
u32 (*map_gen_lookup)(struct bpf_map *map, struct bpf_insn *insn_buf);
|
||||
int (*map_gen_lookup)(struct bpf_map *map, struct bpf_insn *insn_buf);
|
||||
u32 (*map_fd_sys_lookup_elem)(void *ptr);
|
||||
void (*map_seq_show_elem)(struct bpf_map *map, void *key,
|
||||
struct seq_file *m);
|
||||
@@ -104,6 +106,25 @@ struct bpf_map_ops {
|
||||
__poll_t (*map_poll)(struct bpf_map *map, struct file *filp,
|
||||
struct poll_table_struct *pts);
|
||||
|
||||
/* Functions called by bpf_local_storage maps */
|
||||
int (*map_local_storage_charge)(struct bpf_local_storage_map *smap,
|
||||
void *owner, u32 size);
|
||||
void (*map_local_storage_uncharge)(struct bpf_local_storage_map *smap,
|
||||
void *owner, u32 size);
|
||||
struct bpf_local_storage __rcu ** (*map_owner_storage_ptr)(void *owner);
|
||||
|
||||
/* map_meta_equal must be implemented for maps that can be
|
||||
* used as an inner map. It is a runtime check to ensure
|
||||
* an inner map can be inserted to an outer map.
|
||||
*
|
||||
* Some properties of the inner map has been used during the
|
||||
* verification time. When inserting an inner map at the runtime,
|
||||
* map_meta_equal has to ensure the inserting map has the same
|
||||
* properties that the verifier has used earlier.
|
||||
*/
|
||||
bool (*map_meta_equal)(const struct bpf_map *meta0,
|
||||
const struct bpf_map *meta1);
|
||||
|
||||
/* BTF name and id of struct allocated by map_alloc */
|
||||
const char * const map_btf_name;
|
||||
int *map_btf_id;
|
||||
@@ -227,6 +248,9 @@ int map_check_no_btf(const struct bpf_map *map,
|
||||
const struct btf_type *key_type,
|
||||
const struct btf_type *value_type);
|
||||
|
||||
bool bpf_map_meta_equal(const struct bpf_map *meta0,
|
||||
const struct bpf_map *meta1);
|
||||
|
||||
extern const struct bpf_map_ops bpf_map_offload_ops;
|
||||
|
||||
/* function argument constraints */
|
||||
@@ -268,6 +292,9 @@ enum bpf_arg_type {
|
||||
ARG_PTR_TO_ALLOC_MEM, /* pointer to dynamically allocated memory */
|
||||
ARG_PTR_TO_ALLOC_MEM_OR_NULL, /* pointer to dynamically allocated memory or NULL */
|
||||
ARG_CONST_ALLOC_SIZE_OR_ZERO, /* number of allocated bytes requested */
|
||||
ARG_PTR_TO_BTF_ID_SOCK_COMMON, /* pointer to in-kernel sock_common or bpf-mirrored bpf_sock */
|
||||
ARG_PTR_TO_PERCPU_BTF_ID, /* pointer to in-kernel percpu type */
|
||||
__BPF_ARG_TYPE_MAX,
|
||||
};
|
||||
|
||||
/* type of values returned from helper functions */
|
||||
@@ -281,6 +308,8 @@ enum bpf_return_type {
|
||||
RET_PTR_TO_SOCK_COMMON_OR_NULL, /* returns a pointer to a sock_common or NULL */
|
||||
RET_PTR_TO_ALLOC_MEM_OR_NULL, /* returns a pointer to dynamically allocated memory or NULL */
|
||||
RET_PTR_TO_BTF_ID_OR_NULL, /* returns a pointer to a btf_id or NULL */
|
||||
RET_PTR_TO_MEM_OR_BTF_ID_OR_NULL, /* returns a pointer to a valid memory or a btf_id or NULL */
|
||||
RET_PTR_TO_MEM_OR_BTF_ID, /* returns a pointer to a valid memory or a btf_id */
|
||||
};
|
||||
|
||||
/* eBPF function prototype used by verifier to allow BPF_CALLs from eBPF programs
|
||||
@@ -302,13 +331,18 @@ struct bpf_func_proto {
|
||||
};
|
||||
enum bpf_arg_type arg_type[5];
|
||||
};
|
||||
int *btf_id; /* BTF ids of arguments */
|
||||
bool (*check_btf_id)(u32 btf_id, u32 arg); /* if the argument btf_id is
|
||||
* valid. Often used if more
|
||||
* than one btf id is permitted
|
||||
* for this argument.
|
||||
*/
|
||||
union {
|
||||
struct {
|
||||
u32 *arg1_btf_id;
|
||||
u32 *arg2_btf_id;
|
||||
u32 *arg3_btf_id;
|
||||
u32 *arg4_btf_id;
|
||||
u32 *arg5_btf_id;
|
||||
};
|
||||
u32 *arg_btf_id[5];
|
||||
};
|
||||
int *ret_btf_id; /* return value btf_id */
|
||||
bool (*allowed)(const struct bpf_prog *prog);
|
||||
};
|
||||
|
||||
/* bpf_context is intentionally undefined structure. Pointer to bpf_context is
|
||||
@@ -352,14 +386,29 @@ enum bpf_reg_type {
|
||||
PTR_TO_TCP_SOCK_OR_NULL, /* reg points to struct tcp_sock or NULL */
|
||||
PTR_TO_TP_BUFFER, /* reg points to a writable raw tp's buffer */
|
||||
PTR_TO_XDP_SOCK, /* reg points to struct xdp_sock */
|
||||
PTR_TO_BTF_ID, /* reg points to kernel struct */
|
||||
PTR_TO_BTF_ID_OR_NULL, /* reg points to kernel struct or NULL */
|
||||
/* PTR_TO_BTF_ID points to a kernel struct that does not need
|
||||
* to be null checked by the BPF program. This does not imply the
|
||||
* pointer is _not_ null and in practice this can easily be a null
|
||||
* pointer when reading pointer chains. The assumption is program
|
||||
* context will handle null pointer dereference typically via fault
|
||||
* handling. The verifier must keep this in mind and can make no
|
||||
* assumptions about null or non-null when doing branch analysis.
|
||||
* Further, when passed into helpers the helpers can not, without
|
||||
* additional context, assume the value is non-null.
|
||||
*/
|
||||
PTR_TO_BTF_ID,
|
||||
/* PTR_TO_BTF_ID_OR_NULL points to a kernel struct that has not
|
||||
* been checked for null. Used primarily to inform the verifier
|
||||
* an explicit null check is required for this struct.
|
||||
*/
|
||||
PTR_TO_BTF_ID_OR_NULL,
|
||||
PTR_TO_MEM, /* reg points to valid memory region */
|
||||
PTR_TO_MEM_OR_NULL, /* reg points to valid memory region or NULL */
|
||||
PTR_TO_RDONLY_BUF, /* reg points to a readonly buffer */
|
||||
PTR_TO_RDONLY_BUF_OR_NULL, /* reg points to a readonly buffer or NULL */
|
||||
PTR_TO_RDWR_BUF, /* reg points to a read/write buffer */
|
||||
PTR_TO_RDWR_BUF_OR_NULL, /* reg points to a read/write buffer or NULL */
|
||||
PTR_TO_PERCPU_BTF_ID, /* reg points to a percpu kernel variable */
|
||||
};
|
||||
|
||||
/* The information passed from prog-specific *_is_valid_access
|
||||
@@ -514,6 +563,8 @@ int arch_prepare_bpf_trampoline(void *image, void *image_end,
|
||||
/* these two functions are called from generated trampoline */
|
||||
u64 notrace __bpf_prog_enter(void);
|
||||
void notrace __bpf_prog_exit(struct bpf_prog *prog, u64 start);
|
||||
void notrace __bpf_prog_enter_sleepable(void);
|
||||
void notrace __bpf_prog_exit_sleepable(void);
|
||||
|
||||
struct bpf_ksym {
|
||||
unsigned long start;
|
||||
@@ -559,6 +610,13 @@ struct bpf_trampoline {
|
||||
struct bpf_ksym ksym;
|
||||
};
|
||||
|
||||
struct bpf_attach_target_info {
|
||||
struct btf_func_model fmodel;
|
||||
long tgt_addr;
|
||||
const char *tgt_name;
|
||||
const struct btf_type *tgt_type;
|
||||
};
|
||||
|
||||
#define BPF_DISPATCHER_MAX 48 /* Fits in 2048B */
|
||||
|
||||
struct bpf_dispatcher_prog {
|
||||
@@ -586,9 +644,10 @@ static __always_inline unsigned int bpf_dispatcher_nop_func(
|
||||
return bpf_func(ctx, insnsi);
|
||||
}
|
||||
#ifdef CONFIG_BPF_JIT
|
||||
struct bpf_trampoline *bpf_trampoline_lookup(u64 key);
|
||||
int bpf_trampoline_link_prog(struct bpf_prog *prog);
|
||||
int bpf_trampoline_unlink_prog(struct bpf_prog *prog);
|
||||
int bpf_trampoline_link_prog(struct bpf_prog *prog, struct bpf_trampoline *tr);
|
||||
int bpf_trampoline_unlink_prog(struct bpf_prog *prog, struct bpf_trampoline *tr);
|
||||
struct bpf_trampoline *bpf_trampoline_get(u64 key,
|
||||
struct bpf_attach_target_info *tgt_info);
|
||||
void bpf_trampoline_put(struct bpf_trampoline *tr);
|
||||
#define BPF_DISPATCHER_INIT(_name) { \
|
||||
.mutex = __MUTEX_INITIALIZER(_name.mutex), \
|
||||
@@ -633,18 +692,21 @@ void bpf_image_ksym_del(struct bpf_ksym *ksym);
|
||||
void bpf_ksym_add(struct bpf_ksym *ksym);
|
||||
void bpf_ksym_del(struct bpf_ksym *ksym);
|
||||
#else
|
||||
static inline struct bpf_trampoline *bpf_trampoline_lookup(u64 key)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
static inline int bpf_trampoline_link_prog(struct bpf_prog *prog)
|
||||
static inline int bpf_trampoline_link_prog(struct bpf_prog *prog,
|
||||
struct bpf_trampoline *tr)
|
||||
{
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
static inline int bpf_trampoline_unlink_prog(struct bpf_prog *prog)
|
||||
static inline int bpf_trampoline_unlink_prog(struct bpf_prog *prog,
|
||||
struct bpf_trampoline *tr)
|
||||
{
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
static inline struct bpf_trampoline *bpf_trampoline_get(u64 key,
|
||||
struct bpf_attach_target_info *tgt_info)
|
||||
{
|
||||
return ERR_PTR(-EOPNOTSUPP);
|
||||
}
|
||||
static inline void bpf_trampoline_put(struct bpf_trampoline *tr) {}
|
||||
#define DEFINE_BPF_DISPATCHER(name)
|
||||
#define DECLARE_BPF_DISPATCHER(name)
|
||||
@@ -670,16 +732,19 @@ enum bpf_jit_poke_reason {
|
||||
|
||||
/* Descriptor of pokes pointing /into/ the JITed image. */
|
||||
struct bpf_jit_poke_descriptor {
|
||||
void *ip;
|
||||
void *tailcall_target;
|
||||
void *tailcall_bypass;
|
||||
void *bypass_addr;
|
||||
union {
|
||||
struct {
|
||||
struct bpf_map *map;
|
||||
u32 key;
|
||||
} tail_call;
|
||||
};
|
||||
bool ip_stable;
|
||||
bool tailcall_target_stable;
|
||||
u8 adj_off;
|
||||
u16 reason;
|
||||
u32 insn_idx;
|
||||
};
|
||||
|
||||
/* reg_type info for ctx arguments */
|
||||
@@ -704,13 +769,18 @@ struct bpf_prog_aux {
|
||||
u32 max_rdonly_access;
|
||||
u32 max_rdwr_access;
|
||||
const struct bpf_ctx_arg_aux *ctx_arg_info;
|
||||
struct bpf_prog *linked_prog;
|
||||
struct mutex dst_mutex; /* protects dst_* pointers below, *after* prog becomes visible */
|
||||
struct bpf_prog *dst_prog;
|
||||
struct bpf_trampoline *dst_trampoline;
|
||||
enum bpf_prog_type saved_dst_prog_type;
|
||||
enum bpf_attach_type saved_dst_attach_type;
|
||||
bool verifier_zext; /* Zero extensions has been inserted by verifier. */
|
||||
bool offload_requested;
|
||||
bool attach_btf_trace; /* true if attaching to BTF-enabled raw tp */
|
||||
bool func_proto_unreliable;
|
||||
bool sleepable;
|
||||
bool tail_call_reachable;
|
||||
enum bpf_tramp_prog_type trampoline_prog_type;
|
||||
struct bpf_trampoline *trampoline;
|
||||
struct hlist_node tramp_hlist;
|
||||
/* BTF_KIND_FUNC_PROTO for valid attach_btf_id */
|
||||
const struct btf_type *attach_func_proto;
|
||||
@@ -723,6 +793,7 @@ struct bpf_prog_aux {
|
||||
struct bpf_ksym ksym;
|
||||
const struct bpf_prog_ops *ops;
|
||||
struct bpf_map **used_maps;
|
||||
struct mutex used_maps_mutex; /* mutex for used_maps and used_map_cnt */
|
||||
struct bpf_prog *prog;
|
||||
struct user_struct *user;
|
||||
u64 load_time; /* ns since boottime */
|
||||
@@ -1218,12 +1289,18 @@ typedef int (*bpf_iter_attach_target_t)(struct bpf_prog *prog,
|
||||
union bpf_iter_link_info *linfo,
|
||||
struct bpf_iter_aux_info *aux);
|
||||
typedef void (*bpf_iter_detach_target_t)(struct bpf_iter_aux_info *aux);
|
||||
typedef void (*bpf_iter_show_fdinfo_t) (const struct bpf_iter_aux_info *aux,
|
||||
struct seq_file *seq);
|
||||
typedef int (*bpf_iter_fill_link_info_t)(const struct bpf_iter_aux_info *aux,
|
||||
struct bpf_link_info *info);
|
||||
|
||||
#define BPF_ITER_CTX_ARG_MAX 2
|
||||
struct bpf_iter_reg {
|
||||
const char *target;
|
||||
bpf_iter_attach_target_t attach_target;
|
||||
bpf_iter_detach_target_t detach_target;
|
||||
bpf_iter_show_fdinfo_t show_fdinfo;
|
||||
bpf_iter_fill_link_info_t fill_link_info;
|
||||
u32 ctx_arg_info_size;
|
||||
struct bpf_ctx_arg_aux ctx_arg_info[BPF_ITER_CTX_ARG_MAX];
|
||||
const struct bpf_iter_seq_info *seq_info;
|
||||
@@ -1250,6 +1327,10 @@ int bpf_iter_new_fd(struct bpf_link *link);
|
||||
bool bpf_link_is_iter(struct bpf_link *link);
|
||||
struct bpf_prog *bpf_iter_get_info(struct bpf_iter_meta *meta, bool in_stop);
|
||||
int bpf_iter_run_prog(struct bpf_prog *prog, void *ctx);
|
||||
void bpf_iter_map_show_fdinfo(const struct bpf_iter_aux_info *aux,
|
||||
struct seq_file *seq);
|
||||
int bpf_iter_map_fill_link_info(const struct bpf_iter_aux_info *aux,
|
||||
struct bpf_link_info *info);
|
||||
|
||||
int bpf_percpu_hash_copy(struct bpf_map *map, void *key, void *value);
|
||||
int bpf_percpu_array_copy(struct bpf_map *map, void *key, void *value);
|
||||
@@ -1292,6 +1373,8 @@ int bpf_check(struct bpf_prog **fp, union bpf_attr *attr,
|
||||
union bpf_attr __user *uattr);
|
||||
void bpf_patch_call_args(struct bpf_insn *insn, u32 stack_depth);
|
||||
|
||||
struct btf *bpf_get_btf_vmlinux(void);
|
||||
|
||||
/* Map specifics */
|
||||
struct xdp_buff;
|
||||
struct sk_buff;
|
||||
@@ -1333,6 +1416,9 @@ int bpf_prog_test_run_tracing(struct bpf_prog *prog,
|
||||
int bpf_prog_test_run_flow_dissector(struct bpf_prog *prog,
|
||||
const union bpf_attr *kattr,
|
||||
union bpf_attr __user *uattr);
|
||||
int bpf_prog_test_run_raw_tp(struct bpf_prog *prog,
|
||||
const union bpf_attr *kattr,
|
||||
union bpf_attr __user *uattr);
|
||||
bool btf_ctx_access(int off, int size, enum bpf_access_type type,
|
||||
const struct bpf_prog *prog,
|
||||
struct bpf_insn_access_aux *info);
|
||||
@@ -1340,8 +1426,8 @@ int btf_struct_access(struct bpf_verifier_log *log,
|
||||
const struct btf_type *t, int off, int size,
|
||||
enum bpf_access_type atype,
|
||||
u32 *next_btf_id);
|
||||
int btf_resolve_helper_id(struct bpf_verifier_log *log,
|
||||
const struct bpf_func_proto *fn, int);
|
||||
bool btf_struct_ids_match(struct bpf_verifier_log *log,
|
||||
int off, u32 id, u32 need_type_id);
|
||||
|
||||
int btf_distill_func_proto(struct bpf_verifier_log *log,
|
||||
struct btf *btf,
|
||||
@@ -1354,10 +1440,11 @@ int btf_check_func_arg_match(struct bpf_verifier_env *env, int subprog,
|
||||
struct bpf_reg_state *regs);
|
||||
int btf_prepare_func_args(struct bpf_verifier_env *env, int subprog,
|
||||
struct bpf_reg_state *reg);
|
||||
int btf_check_type_match(struct bpf_verifier_env *env, struct bpf_prog *prog,
|
||||
int btf_check_type_match(struct bpf_verifier_log *log, const struct bpf_prog *prog,
|
||||
struct btf *btf, const struct btf_type *t);
|
||||
|
||||
struct bpf_prog *bpf_prog_by_id(u32 id);
|
||||
struct bpf_link *bpf_link_by_id(u32 id);
|
||||
|
||||
const struct bpf_func_proto *bpf_base_func_proto(enum bpf_func_id func_id);
|
||||
#else /* !CONFIG_BPF_SYSCALL */
|
||||
@@ -1637,6 +1724,7 @@ int sock_map_prog_update(struct bpf_map *map, struct bpf_prog *prog,
|
||||
struct bpf_prog *old, u32 which);
|
||||
int sock_map_get_from_fd(const union bpf_attr *attr, struct bpf_prog *prog);
|
||||
int sock_map_prog_detach(const union bpf_attr *attr, enum bpf_prog_type ptype);
|
||||
int sock_map_update_elem_sys(struct bpf_map *map, void *key, void *value, u64 flags);
|
||||
void sock_map_unhash(struct sock *sk);
|
||||
void sock_map_close(struct sock *sk, long timeout);
|
||||
#else
|
||||
@@ -1658,6 +1746,12 @@ static inline int sock_map_prog_detach(const union bpf_attr *attr,
|
||||
{
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
static inline int sock_map_update_elem_sys(struct bpf_map *map, void *key, void *value,
|
||||
u64 flags)
|
||||
{
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
#endif /* CONFIG_BPF_STREAM_PARSER */
|
||||
|
||||
#if defined(CONFIG_INET) && defined(CONFIG_BPF_SYSCALL)
|
||||
@@ -1736,6 +1830,10 @@ extern const struct bpf_func_proto bpf_skc_to_tcp_sock_proto;
|
||||
extern const struct bpf_func_proto bpf_skc_to_tcp_timewait_sock_proto;
|
||||
extern const struct bpf_func_proto bpf_skc_to_tcp_request_sock_proto;
|
||||
extern const struct bpf_func_proto bpf_skc_to_udp6_sock_proto;
|
||||
extern const struct bpf_func_proto bpf_copy_from_user_proto;
|
||||
extern const struct bpf_func_proto bpf_snprintf_btf_proto;
|
||||
extern const struct bpf_func_proto bpf_per_cpu_ptr_proto;
|
||||
extern const struct bpf_func_proto bpf_this_cpu_ptr_proto;
|
||||
|
||||
const struct bpf_func_proto *bpf_tracing_func_proto(
|
||||
enum bpf_func_id func_id, const struct bpf_prog *prog);
|
||||
@@ -1850,4 +1948,7 @@ enum bpf_text_poke_type {
|
||||
int bpf_arch_text_poke(void *ip, enum bpf_text_poke_type t,
|
||||
void *addr1, void *addr2);
|
||||
|
||||
struct btf_id_set;
|
||||
bool btf_id_set_contains(const struct btf_id_set *set, u32 id);
|
||||
|
||||
#endif /* _LINUX_BPF_H */
|
||||
|
||||
163
include/linux/bpf_local_storage.h
Normal file
163
include/linux/bpf_local_storage.h
Normal file
@@ -0,0 +1,163 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Copyright (c) 2019 Facebook
|
||||
* Copyright 2020 Google LLC.
|
||||
*/
|
||||
|
||||
#ifndef _BPF_LOCAL_STORAGE_H
|
||||
#define _BPF_LOCAL_STORAGE_H
|
||||
|
||||
#include <linux/bpf.h>
|
||||
#include <linux/rculist.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/hash.h>
|
||||
#include <linux/types.h>
|
||||
#include <uapi/linux/btf.h>
|
||||
|
||||
#define BPF_LOCAL_STORAGE_CACHE_SIZE 16
|
||||
|
||||
struct bpf_local_storage_map_bucket {
|
||||
struct hlist_head list;
|
||||
raw_spinlock_t lock;
|
||||
};
|
||||
|
||||
/* Thp map is not the primary owner of a bpf_local_storage_elem.
|
||||
* Instead, the container object (eg. sk->sk_bpf_storage) is.
|
||||
*
|
||||
* The map (bpf_local_storage_map) is for two purposes
|
||||
* 1. Define the size of the "local storage". It is
|
||||
* the map's value_size.
|
||||
*
|
||||
* 2. Maintain a list to keep track of all elems such
|
||||
* that they can be cleaned up during the map destruction.
|
||||
*
|
||||
* When a bpf local storage is being looked up for a
|
||||
* particular object, the "bpf_map" pointer is actually used
|
||||
* as the "key" to search in the list of elem in
|
||||
* the respective bpf_local_storage owned by the object.
|
||||
*
|
||||
* e.g. sk->sk_bpf_storage is the mini-map with the "bpf_map" pointer
|
||||
* as the searching key.
|
||||
*/
|
||||
struct bpf_local_storage_map {
|
||||
struct bpf_map map;
|
||||
/* Lookup elem does not require accessing the map.
|
||||
*
|
||||
* Updating/Deleting requires a bucket lock to
|
||||
* link/unlink the elem from the map. Having
|
||||
* multiple buckets to improve contention.
|
||||
*/
|
||||
struct bpf_local_storage_map_bucket *buckets;
|
||||
u32 bucket_log;
|
||||
u16 elem_size;
|
||||
u16 cache_idx;
|
||||
};
|
||||
|
||||
struct bpf_local_storage_data {
|
||||
/* smap is used as the searching key when looking up
|
||||
* from the object's bpf_local_storage.
|
||||
*
|
||||
* Put it in the same cacheline as the data to minimize
|
||||
* the number of cachelines access during the cache hit case.
|
||||
*/
|
||||
struct bpf_local_storage_map __rcu *smap;
|
||||
u8 data[] __aligned(8);
|
||||
};
|
||||
|
||||
/* Linked to bpf_local_storage and bpf_local_storage_map */
|
||||
struct bpf_local_storage_elem {
|
||||
struct hlist_node map_node; /* Linked to bpf_local_storage_map */
|
||||
struct hlist_node snode; /* Linked to bpf_local_storage */
|
||||
struct bpf_local_storage __rcu *local_storage;
|
||||
struct rcu_head rcu;
|
||||
/* 8 bytes hole */
|
||||
/* The data is stored in aother cacheline to minimize
|
||||
* the number of cachelines access during a cache hit.
|
||||
*/
|
||||
struct bpf_local_storage_data sdata ____cacheline_aligned;
|
||||
};
|
||||
|
||||
struct bpf_local_storage {
|
||||
struct bpf_local_storage_data __rcu *cache[BPF_LOCAL_STORAGE_CACHE_SIZE];
|
||||
struct hlist_head list; /* List of bpf_local_storage_elem */
|
||||
void *owner; /* The object that owns the above "list" of
|
||||
* bpf_local_storage_elem.
|
||||
*/
|
||||
struct rcu_head rcu;
|
||||
raw_spinlock_t lock; /* Protect adding/removing from the "list" */
|
||||
};
|
||||
|
||||
/* U16_MAX is much more than enough for sk local storage
|
||||
* considering a tcp_sock is ~2k.
|
||||
*/
|
||||
#define BPF_LOCAL_STORAGE_MAX_VALUE_SIZE \
|
||||
min_t(u32, \
|
||||
(KMALLOC_MAX_SIZE - MAX_BPF_STACK - \
|
||||
sizeof(struct bpf_local_storage_elem)), \
|
||||
(U16_MAX - sizeof(struct bpf_local_storage_elem)))
|
||||
|
||||
#define SELEM(_SDATA) \
|
||||
container_of((_SDATA), struct bpf_local_storage_elem, sdata)
|
||||
#define SDATA(_SELEM) (&(_SELEM)->sdata)
|
||||
|
||||
#define BPF_LOCAL_STORAGE_CACHE_SIZE 16
|
||||
|
||||
struct bpf_local_storage_cache {
|
||||
spinlock_t idx_lock;
|
||||
u64 idx_usage_counts[BPF_LOCAL_STORAGE_CACHE_SIZE];
|
||||
};
|
||||
|
||||
#define DEFINE_BPF_STORAGE_CACHE(name) \
|
||||
static struct bpf_local_storage_cache name = { \
|
||||
.idx_lock = __SPIN_LOCK_UNLOCKED(name.idx_lock), \
|
||||
}
|
||||
|
||||
u16 bpf_local_storage_cache_idx_get(struct bpf_local_storage_cache *cache);
|
||||
void bpf_local_storage_cache_idx_free(struct bpf_local_storage_cache *cache,
|
||||
u16 idx);
|
||||
|
||||
/* Helper functions for bpf_local_storage */
|
||||
int bpf_local_storage_map_alloc_check(union bpf_attr *attr);
|
||||
|
||||
struct bpf_local_storage_map *bpf_local_storage_map_alloc(union bpf_attr *attr);
|
||||
|
||||
struct bpf_local_storage_data *
|
||||
bpf_local_storage_lookup(struct bpf_local_storage *local_storage,
|
||||
struct bpf_local_storage_map *smap,
|
||||
bool cacheit_lockit);
|
||||
|
||||
void bpf_local_storage_map_free(struct bpf_local_storage_map *smap);
|
||||
|
||||
int bpf_local_storage_map_check_btf(const struct bpf_map *map,
|
||||
const struct btf *btf,
|
||||
const struct btf_type *key_type,
|
||||
const struct btf_type *value_type);
|
||||
|
||||
void bpf_selem_link_storage_nolock(struct bpf_local_storage *local_storage,
|
||||
struct bpf_local_storage_elem *selem);
|
||||
|
||||
bool bpf_selem_unlink_storage_nolock(struct bpf_local_storage *local_storage,
|
||||
struct bpf_local_storage_elem *selem,
|
||||
bool uncharge_omem);
|
||||
|
||||
void bpf_selem_unlink(struct bpf_local_storage_elem *selem);
|
||||
|
||||
void bpf_selem_link_map(struct bpf_local_storage_map *smap,
|
||||
struct bpf_local_storage_elem *selem);
|
||||
|
||||
void bpf_selem_unlink_map(struct bpf_local_storage_elem *selem);
|
||||
|
||||
struct bpf_local_storage_elem *
|
||||
bpf_selem_alloc(struct bpf_local_storage_map *smap, void *owner, void *value,
|
||||
bool charge_mem);
|
||||
|
||||
int
|
||||
bpf_local_storage_alloc(void *owner,
|
||||
struct bpf_local_storage_map *smap,
|
||||
struct bpf_local_storage_elem *first_selem);
|
||||
|
||||
struct bpf_local_storage_data *
|
||||
bpf_local_storage_update(void *owner, struct bpf_local_storage_map *smap,
|
||||
void *value, u64 map_flags);
|
||||
|
||||
#endif /* _BPF_LOCAL_STORAGE_H */
|
||||
@@ -17,9 +17,28 @@
|
||||
#include <linux/lsm_hook_defs.h>
|
||||
#undef LSM_HOOK
|
||||
|
||||
struct bpf_storage_blob {
|
||||
struct bpf_local_storage __rcu *storage;
|
||||
};
|
||||
|
||||
extern struct lsm_blob_sizes bpf_lsm_blob_sizes;
|
||||
|
||||
int bpf_lsm_verify_prog(struct bpf_verifier_log *vlog,
|
||||
const struct bpf_prog *prog);
|
||||
|
||||
static inline struct bpf_storage_blob *bpf_inode(
|
||||
const struct inode *inode)
|
||||
{
|
||||
if (unlikely(!inode->i_security))
|
||||
return NULL;
|
||||
|
||||
return inode->i_security + bpf_lsm_blob_sizes.lbs_inode;
|
||||
}
|
||||
|
||||
extern const struct bpf_func_proto bpf_inode_storage_get_proto;
|
||||
extern const struct bpf_func_proto bpf_inode_storage_delete_proto;
|
||||
void bpf_inode_storage_free(struct inode *inode);
|
||||
|
||||
#else /* !CONFIG_BPF_LSM */
|
||||
|
||||
static inline int bpf_lsm_verify_prog(struct bpf_verifier_log *vlog,
|
||||
@@ -28,6 +47,16 @@ static inline int bpf_lsm_verify_prog(struct bpf_verifier_log *vlog,
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
static inline struct bpf_storage_blob *bpf_inode(
|
||||
const struct inode *inode)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline void bpf_inode_storage_free(struct inode *inode)
|
||||
{
|
||||
}
|
||||
|
||||
#endif /* CONFIG_BPF_LSM */
|
||||
|
||||
#endif /* _LINUX_BPF_LSM_H */
|
||||
|
||||
@@ -107,6 +107,9 @@ BPF_MAP_TYPE(BPF_MAP_TYPE_SK_STORAGE, sk_storage_map_ops)
|
||||
BPF_MAP_TYPE(BPF_MAP_TYPE_SOCKMAP, sock_map_ops)
|
||||
BPF_MAP_TYPE(BPF_MAP_TYPE_SOCKHASH, sock_hash_ops)
|
||||
#endif
|
||||
#ifdef CONFIG_BPF_LSM
|
||||
BPF_MAP_TYPE(BPF_MAP_TYPE_INODE_STORAGE, inode_storage_map_ops)
|
||||
#endif
|
||||
BPF_MAP_TYPE(BPF_MAP_TYPE_CPUMAP, cpu_map_ops)
|
||||
#if defined(CONFIG_XDP_SOCKETS)
|
||||
BPF_MAP_TYPE(BPF_MAP_TYPE_XSKMAP, xsk_map_ops)
|
||||
|
||||
@@ -308,6 +308,13 @@ struct bpf_insn_aux_data {
|
||||
u32 map_index; /* index into used_maps[] */
|
||||
u32 map_off; /* offset from value base address */
|
||||
};
|
||||
struct {
|
||||
enum bpf_reg_type reg_type; /* type of pseudo_btf_id */
|
||||
union {
|
||||
u32 btf_id; /* btf_id for struct typed var */
|
||||
u32 mem_size; /* mem_size for non-struct typed var */
|
||||
};
|
||||
} btf_var;
|
||||
};
|
||||
u64 map_key_state; /* constant (32 bit) key tracking for maps */
|
||||
int ctx_field_size; /* the ctx field size for load insn, maybe 0 */
|
||||
@@ -347,8 +354,9 @@ static inline bool bpf_verifier_log_full(const struct bpf_verifier_log *log)
|
||||
|
||||
static inline bool bpf_verifier_log_needed(const struct bpf_verifier_log *log)
|
||||
{
|
||||
return (log->level && log->ubuf && !bpf_verifier_log_full(log)) ||
|
||||
log->level == BPF_LOG_KERNEL;
|
||||
return log &&
|
||||
((log->level && log->ubuf && !bpf_verifier_log_full(log)) ||
|
||||
log->level == BPF_LOG_KERNEL);
|
||||
}
|
||||
|
||||
#define BPF_MAX_SUBPROGS 256
|
||||
@@ -358,6 +366,9 @@ struct bpf_subprog_info {
|
||||
u32 start; /* insn idx of function entry point */
|
||||
u32 linfo_idx; /* The idx to the main_prog->aux->linfo */
|
||||
u16 stack_depth; /* max. stack depth used by this function */
|
||||
bool has_tail_call;
|
||||
bool tail_call_reachable;
|
||||
bool has_ld_abs;
|
||||
};
|
||||
|
||||
/* single container for all structs
|
||||
@@ -446,4 +457,17 @@ bpf_prog_offload_remove_insns(struct bpf_verifier_env *env, u32 off, u32 cnt);
|
||||
int check_ctx_reg(struct bpf_verifier_env *env,
|
||||
const struct bpf_reg_state *reg, int regno);
|
||||
|
||||
/* this lives here instead of in bpf.h because it needs to dereference tgt_prog */
|
||||
static inline u64 bpf_trampoline_compute_key(const struct bpf_prog *tgt_prog,
|
||||
u32 btf_id)
|
||||
{
|
||||
return tgt_prog ? (((u64)tgt_prog->aux->id) << 32 | btf_id) : btf_id;
|
||||
}
|
||||
|
||||
int bpf_check_attach_target(struct bpf_verifier_log *log,
|
||||
const struct bpf_prog *prog,
|
||||
const struct bpf_prog *tgt_prog,
|
||||
u32 btf_id,
|
||||
struct bpf_attach_target_info *tgt_info);
|
||||
|
||||
#endif /* _LINUX_BPF_VERIFIER_H */
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#define PHY_ID_BCM57780 0x03625d90
|
||||
#define PHY_ID_BCM89610 0x03625cd0
|
||||
|
||||
#define PHY_ID_BCM72113 0x35905310
|
||||
#define PHY_ID_BCM7250 0xae025280
|
||||
#define PHY_ID_BCM7255 0xae025120
|
||||
#define PHY_ID_BCM7260 0xae025190
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <uapi/linux/btf.h>
|
||||
#include <uapi/linux/bpf.h>
|
||||
|
||||
#define BTF_TYPE_EMIT(type) ((void)(type *)0)
|
||||
|
||||
@@ -13,6 +14,7 @@ struct btf;
|
||||
struct btf_member;
|
||||
struct btf_type;
|
||||
union bpf_attr;
|
||||
struct btf_show;
|
||||
|
||||
extern const struct file_operations btf_fops;
|
||||
|
||||
@@ -46,8 +48,45 @@ int btf_get_info_by_fd(const struct btf *btf,
|
||||
const struct btf_type *btf_type_id_size(const struct btf *btf,
|
||||
u32 *type_id,
|
||||
u32 *ret_size);
|
||||
|
||||
/*
|
||||
* Options to control show behaviour.
|
||||
* - BTF_SHOW_COMPACT: no formatting around type information
|
||||
* - BTF_SHOW_NONAME: no struct/union member names/types
|
||||
* - BTF_SHOW_PTR_RAW: show raw (unobfuscated) pointer values;
|
||||
* equivalent to %px.
|
||||
* - BTF_SHOW_ZERO: show zero-valued struct/union members; they
|
||||
* are not displayed by default
|
||||
* - BTF_SHOW_UNSAFE: skip use of bpf_probe_read() to safely read
|
||||
* data before displaying it.
|
||||
*/
|
||||
#define BTF_SHOW_COMPACT BTF_F_COMPACT
|
||||
#define BTF_SHOW_NONAME BTF_F_NONAME
|
||||
#define BTF_SHOW_PTR_RAW BTF_F_PTR_RAW
|
||||
#define BTF_SHOW_ZERO BTF_F_ZERO
|
||||
#define BTF_SHOW_UNSAFE (1ULL << 4)
|
||||
|
||||
void btf_type_seq_show(const struct btf *btf, u32 type_id, void *obj,
|
||||
struct seq_file *m);
|
||||
int btf_type_seq_show_flags(const struct btf *btf, u32 type_id, void *obj,
|
||||
struct seq_file *m, u64 flags);
|
||||
|
||||
/*
|
||||
* Copy len bytes of string representation of obj of BTF type_id into buf.
|
||||
*
|
||||
* @btf: struct btf object
|
||||
* @type_id: type id of type obj points to
|
||||
* @obj: pointer to typed data
|
||||
* @buf: buffer to write to
|
||||
* @len: maximum length to write to buf
|
||||
* @flags: show options (see above)
|
||||
*
|
||||
* Return: length that would have been/was copied as per snprintf, or
|
||||
* negative error.
|
||||
*/
|
||||
int btf_type_snprintf_show(const struct btf *btf, u32 type_id, void *obj,
|
||||
char *buf, int len, u64 flags);
|
||||
|
||||
int btf_get_fd_by_id(u32 id);
|
||||
u32 btf_id(const struct btf *btf);
|
||||
bool btf_member_is_reg_int(const struct btf *btf, const struct btf_type *s,
|
||||
@@ -64,14 +103,18 @@ const struct btf_type *btf_type_resolve_func_ptr(const struct btf *btf,
|
||||
u32 id, u32 *res_id);
|
||||
const struct btf_type *
|
||||
btf_resolve_size(const struct btf *btf, const struct btf_type *type,
|
||||
u32 *type_size, const struct btf_type **elem_type,
|
||||
u32 *total_nelems);
|
||||
u32 *type_size);
|
||||
|
||||
#define for_each_member(i, struct_type, member) \
|
||||
for (i = 0, member = btf_type_member(struct_type); \
|
||||
i < btf_type_vlen(struct_type); \
|
||||
i++, member++)
|
||||
|
||||
#define for_each_vsi(i, datasec_type, member) \
|
||||
for (i = 0, member = btf_type_var_secinfo(datasec_type); \
|
||||
i < btf_type_vlen(datasec_type); \
|
||||
i++, member++)
|
||||
|
||||
static inline bool btf_type_is_ptr(const struct btf_type *t)
|
||||
{
|
||||
return BTF_INFO_KIND(t->info) == BTF_KIND_PTR;
|
||||
@@ -107,6 +150,21 @@ static inline bool btf_type_is_func_proto(const struct btf_type *t)
|
||||
return BTF_INFO_KIND(t->info) == BTF_KIND_FUNC_PROTO;
|
||||
}
|
||||
|
||||
static inline bool btf_type_is_var(const struct btf_type *t)
|
||||
{
|
||||
return BTF_INFO_KIND(t->info) == BTF_KIND_VAR;
|
||||
}
|
||||
|
||||
/* union is only a special case of struct:
|
||||
* all its offsetof(member) == 0
|
||||
*/
|
||||
static inline bool btf_type_is_struct(const struct btf_type *t)
|
||||
{
|
||||
u8 kind = BTF_INFO_KIND(t->info);
|
||||
|
||||
return kind == BTF_KIND_STRUCT || kind == BTF_KIND_UNION;
|
||||
}
|
||||
|
||||
static inline u16 btf_type_vlen(const struct btf_type *t)
|
||||
{
|
||||
return BTF_INFO_VLEN(t->info);
|
||||
@@ -141,6 +199,12 @@ static inline const struct btf_member *btf_type_member(const struct btf_type *t)
|
||||
return (const struct btf_member *)(t + 1);
|
||||
}
|
||||
|
||||
static inline const struct btf_var_secinfo *btf_type_var_secinfo(
|
||||
const struct btf_type *t)
|
||||
{
|
||||
return (const struct btf_var_secinfo *)(t + 1);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BPF_SYSCALL
|
||||
const struct btf_type *btf_type_by_id(const struct btf *btf, u32 type_id);
|
||||
const char *btf_name_by_offset(const struct btf *btf, u32 offset);
|
||||
|
||||
@@ -3,6 +3,11 @@
|
||||
#ifndef _LINUX_BTF_IDS_H
|
||||
#define _LINUX_BTF_IDS_H
|
||||
|
||||
struct btf_id_set {
|
||||
u32 cnt;
|
||||
u32 ids[];
|
||||
};
|
||||
|
||||
#ifdef CONFIG_DEBUG_INFO_BTF
|
||||
|
||||
#include <linux/compiler.h> /* for __PASTE */
|
||||
@@ -62,7 +67,7 @@ asm( \
|
||||
".pushsection " BTF_IDS_SECTION ",\"a\"; \n" \
|
||||
"." #scope " " #name "; \n" \
|
||||
#name ":; \n" \
|
||||
".popsection; \n"); \
|
||||
".popsection; \n");
|
||||
|
||||
#define BTF_ID_LIST(name) \
|
||||
__BTF_ID_LIST(name, local) \
|
||||
@@ -71,6 +76,13 @@ extern u32 name[];
|
||||
#define BTF_ID_LIST_GLOBAL(name) \
|
||||
__BTF_ID_LIST(name, globl)
|
||||
|
||||
/* The BTF_ID_LIST_SINGLE macro defines a BTF_ID_LIST with
|
||||
* a single entry.
|
||||
*/
|
||||
#define BTF_ID_LIST_SINGLE(name, prefix, typename) \
|
||||
BTF_ID_LIST(name) \
|
||||
BTF_ID(prefix, typename)
|
||||
|
||||
/*
|
||||
* The BTF_ID_UNUSED macro defines 4 zero bytes.
|
||||
* It's used when we want to define 'unused' entry
|
||||
@@ -88,12 +100,57 @@ asm( \
|
||||
".zero 4 \n" \
|
||||
".popsection; \n");
|
||||
|
||||
/*
|
||||
* The BTF_SET_START/END macros pair defines sorted list of
|
||||
* BTF IDs plus its members count, with following layout:
|
||||
*
|
||||
* BTF_SET_START(list)
|
||||
* BTF_ID(type1, name1)
|
||||
* BTF_ID(type2, name2)
|
||||
* BTF_SET_END(list)
|
||||
*
|
||||
* __BTF_ID__set__list:
|
||||
* .zero 4
|
||||
* list:
|
||||
* __BTF_ID__type1__name1__3:
|
||||
* .zero 4
|
||||
* __BTF_ID__type2__name2__4:
|
||||
* .zero 4
|
||||
*
|
||||
*/
|
||||
#define __BTF_SET_START(name, scope) \
|
||||
asm( \
|
||||
".pushsection " BTF_IDS_SECTION ",\"a\"; \n" \
|
||||
"." #scope " __BTF_ID__set__" #name "; \n" \
|
||||
"__BTF_ID__set__" #name ":; \n" \
|
||||
".zero 4 \n" \
|
||||
".popsection; \n");
|
||||
|
||||
#define BTF_SET_START(name) \
|
||||
__BTF_ID_LIST(name, local) \
|
||||
__BTF_SET_START(name, local)
|
||||
|
||||
#define BTF_SET_START_GLOBAL(name) \
|
||||
__BTF_ID_LIST(name, globl) \
|
||||
__BTF_SET_START(name, globl)
|
||||
|
||||
#define BTF_SET_END(name) \
|
||||
asm( \
|
||||
".pushsection " BTF_IDS_SECTION ",\"a\"; \n" \
|
||||
".size __BTF_ID__set__" #name ", .-" #name " \n" \
|
||||
".popsection; \n"); \
|
||||
extern struct btf_id_set name;
|
||||
|
||||
#else
|
||||
|
||||
#define BTF_ID_LIST(name) static u32 name[5];
|
||||
#define BTF_ID(prefix, name)
|
||||
#define BTF_ID_UNUSED
|
||||
#define BTF_ID_LIST_GLOBAL(name) u32 name[1];
|
||||
#define BTF_ID_LIST_SINGLE(name, prefix, typename) static u32 name[1];
|
||||
#define BTF_SET_START(name) static struct btf_id_set name = { 0 };
|
||||
#define BTF_SET_START_GLOBAL(name) static struct btf_id_set name = { 0 };
|
||||
#define BTF_SET_END(name)
|
||||
|
||||
#endif /* CONFIG_DEBUG_INFO_BTF */
|
||||
|
||||
|
||||
@@ -7,10 +7,14 @@
|
||||
#ifndef __LINUX_BVEC_ITER_H
|
||||
#define __LINUX_BVEC_ITER_H
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/bug.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/limits.h>
|
||||
#include <linux/minmax.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
struct page;
|
||||
|
||||
/**
|
||||
* struct bio_vec - a contiguous range of physical memory addresses
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
* but may get written to during init, so can't live in .rodata (via "const").
|
||||
*/
|
||||
#ifndef __ro_after_init
|
||||
#define __ro_after_init __attribute__((__section__(".data..ro_after_init")))
|
||||
#define __ro_after_init __section(".data..ro_after_init")
|
||||
#endif
|
||||
|
||||
#ifndef ____cacheline_aligned
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
* linux/can/core.h
|
||||
*
|
||||
* Protoypes and definitions for CAN protocol modules using the PF_CAN core
|
||||
* Prototypes and definitions for CAN protocol modules using the PF_CAN core
|
||||
*
|
||||
* Authors: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
|
||||
* Urs Thuermann <urs.thuermann@volkswagen.de>
|
||||
@@ -18,13 +18,6 @@
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/netdevice.h>
|
||||
|
||||
#define CAN_VERSION "20170425"
|
||||
|
||||
/* increment this number each time you change some user-space interface */
|
||||
#define CAN_ABI_VERSION "9"
|
||||
|
||||
#define CAN_VERSION_STRING "rev " CAN_VERSION " abi " CAN_ABI_VERSION
|
||||
|
||||
#define DNAME(dev) ((dev) ? (dev)->name : "any")
|
||||
|
||||
/**
|
||||
|
||||
@@ -82,15 +82,30 @@ struct can_priv {
|
||||
#endif
|
||||
};
|
||||
|
||||
#define CAN_SYNC_SEG 1
|
||||
|
||||
/*
|
||||
* can_bit_time() - Duration of one bit
|
||||
*
|
||||
* Please refer to ISO 11898-1:2015, section 11.3.1.1 "Bit time" for
|
||||
* additional information.
|
||||
*
|
||||
* Return: the number of time quanta in one bit.
|
||||
*/
|
||||
static inline unsigned int can_bit_time(const struct can_bittiming *bt)
|
||||
{
|
||||
return CAN_SYNC_SEG + bt->prop_seg + bt->phase_seg1 + bt->phase_seg2;
|
||||
}
|
||||
|
||||
/*
|
||||
* get_can_dlc(value) - helper macro to cast a given data length code (dlc)
|
||||
* to __u8 and ensure the dlc value to be max. 8 bytes.
|
||||
* to u8 and ensure the dlc value to be max. 8 bytes.
|
||||
*
|
||||
* To be used in the CAN netdriver receive path to ensure conformance with
|
||||
* ISO 11898-1 Chapter 8.4.2.3 (DLC field)
|
||||
*/
|
||||
#define get_can_dlc(i) (min_t(__u8, (i), CAN_MAX_DLC))
|
||||
#define get_canfd_dlc(i) (min_t(__u8, (i), CANFD_MAX_DLC))
|
||||
#define get_can_dlc(i) (min_t(u8, (i), CAN_MAX_DLC))
|
||||
#define get_canfd_dlc(i) (min_t(u8, (i), CANFD_MAX_DLC))
|
||||
|
||||
/* Check for outgoing skbs that have not been created by the CAN subsystem */
|
||||
static inline bool can_skb_headroom_valid(struct net_device *dev,
|
||||
@@ -108,7 +123,7 @@ static inline bool can_skb_headroom_valid(struct net_device *dev,
|
||||
|
||||
skb->ip_summed = CHECKSUM_UNNECESSARY;
|
||||
|
||||
/* preform proper loopback on capable devices */
|
||||
/* perform proper loopback on capable devices */
|
||||
if (dev->flags & IFF_ECHO)
|
||||
skb->pkt_type = PACKET_LOOPBACK;
|
||||
else
|
||||
@@ -201,8 +216,8 @@ void can_bus_off(struct net_device *dev);
|
||||
void can_change_state(struct net_device *dev, struct can_frame *cf,
|
||||
enum can_state tx_state, enum can_state rx_state);
|
||||
|
||||
void can_put_echo_skb(struct sk_buff *skb, struct net_device *dev,
|
||||
unsigned int idx);
|
||||
int can_put_echo_skb(struct sk_buff *skb, struct net_device *dev,
|
||||
unsigned int idx);
|
||||
struct sk_buff *__can_get_echo_skb(struct net_device *dev, unsigned int idx,
|
||||
u8 *len_ptr);
|
||||
unsigned int can_get_echo_skb(struct net_device *dev, unsigned int idx);
|
||||
|
||||
@@ -35,6 +35,9 @@ int can_rx_offload_add_timestamp(struct net_device *dev,
|
||||
int can_rx_offload_add_fifo(struct net_device *dev,
|
||||
struct can_rx_offload *offload,
|
||||
unsigned int weight);
|
||||
int can_rx_offload_add_manual(struct net_device *dev,
|
||||
struct can_rx_offload *offload,
|
||||
unsigned int weight);
|
||||
int can_rx_offload_irq_offload_timestamp(struct can_rx_offload *offload,
|
||||
u64 reg);
|
||||
int can_rx_offload_irq_offload_fifo(struct can_rx_offload *offload);
|
||||
|
||||
@@ -61,21 +61,17 @@ static inline void can_skb_set_owner(struct sk_buff *skb, struct sock *sk)
|
||||
*/
|
||||
static inline struct sk_buff *can_create_echo_skb(struct sk_buff *skb)
|
||||
{
|
||||
if (skb_shared(skb)) {
|
||||
struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC);
|
||||
struct sk_buff *nskb;
|
||||
|
||||
if (likely(nskb)) {
|
||||
can_skb_set_owner(nskb, skb->sk);
|
||||
consume_skb(skb);
|
||||
return nskb;
|
||||
} else {
|
||||
kfree_skb(skb);
|
||||
return NULL;
|
||||
}
|
||||
nskb = skb_clone(skb, GFP_ATOMIC);
|
||||
if (unlikely(!nskb)) {
|
||||
kfree_skb(skb);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* we can assume to have an unshared skb with proper owner */
|
||||
return skb;
|
||||
can_skb_set_owner(nskb, skb->sk);
|
||||
consume_skb(skb);
|
||||
return nskb;
|
||||
}
|
||||
|
||||
#endif /* !_CAN_SKB_H */
|
||||
|
||||
@@ -54,7 +54,7 @@ struct ceph_connection_operations {
|
||||
int (*check_message_signature) (struct ceph_msg *msg);
|
||||
};
|
||||
|
||||
/* use format string %s%d */
|
||||
/* use format string %s%lld */
|
||||
#define ENTITY_NAME(n) ceph_entity_type_name((n).type), le64_to_cpu((n).num)
|
||||
|
||||
struct ceph_messenger {
|
||||
|
||||
@@ -142,7 +142,7 @@ int ceph_monc_get_version(struct ceph_mon_client *monc, const char *what,
|
||||
int ceph_monc_get_version_async(struct ceph_mon_client *monc, const char *what,
|
||||
ceph_monc_callback_t cb, u64 private_data);
|
||||
|
||||
int ceph_monc_blacklist_add(struct ceph_mon_client *monc,
|
||||
int ceph_monc_blocklist_add(struct ceph_mon_client *monc,
|
||||
struct ceph_entity_addr *client_addr);
|
||||
|
||||
extern int ceph_monc_open_session(struct ceph_mon_client *monc);
|
||||
|
||||
@@ -137,6 +137,17 @@ int ceph_oid_aprintf(struct ceph_object_id *oid, gfp_t gfp,
|
||||
const char *fmt, ...);
|
||||
void ceph_oid_destroy(struct ceph_object_id *oid);
|
||||
|
||||
struct workspace_manager {
|
||||
struct list_head idle_ws;
|
||||
spinlock_t ws_lock;
|
||||
/* Number of free workspaces */
|
||||
int free_ws;
|
||||
/* Total number of allocated workspaces */
|
||||
atomic_t total_ws;
|
||||
/* Waiters for a free workspace */
|
||||
wait_queue_head_t ws_wait;
|
||||
};
|
||||
|
||||
struct ceph_pg_mapping {
|
||||
struct rb_node node;
|
||||
struct ceph_pg pgid;
|
||||
@@ -184,8 +195,7 @@ struct ceph_osdmap {
|
||||
* the list of osds that store+replicate them. */
|
||||
struct crush_map *crush;
|
||||
|
||||
struct mutex crush_workspace_mutex;
|
||||
void *crush_workspace;
|
||||
struct workspace_manager crush_wsm;
|
||||
};
|
||||
|
||||
static inline bool ceph_osd_exists(struct ceph_osdmap *map, int osd)
|
||||
|
||||
@@ -424,7 +424,7 @@ enum {
|
||||
};
|
||||
|
||||
#define EOLDSNAPC ERESTART /* ORDERSNAP flag set; writer has old snapc*/
|
||||
#define EBLACKLISTED ESHUTDOWN /* blacklisted */
|
||||
#define EBLOCKLISTED ESHUTDOWN /* blocklisted */
|
||||
|
||||
/* xattr comparison */
|
||||
enum {
|
||||
|
||||
56
include/linux/clk/samsung.h
Normal file
56
include/linux/clk/samsung.h
Normal file
@@ -0,0 +1,56 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Copyright (c) 2020 Krzysztof Kozlowski <krzk@kernel.org>
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_CLK_SAMSUNG_H_
|
||||
#define __LINUX_CLK_SAMSUNG_H_
|
||||
|
||||
#include <linux/compiler_types.h>
|
||||
|
||||
struct device_node;
|
||||
|
||||
#ifdef CONFIG_ARCH_S3C64XX
|
||||
void s3c64xx_clk_init(struct device_node *np, unsigned long xtal_f,
|
||||
unsigned long xusbxti_f, bool s3c6400,
|
||||
void __iomem *base);
|
||||
#else
|
||||
static inline void s3c64xx_clk_init(struct device_node *np,
|
||||
unsigned long xtal_f,
|
||||
unsigned long xusbxti_f,
|
||||
bool s3c6400, void __iomem *base) { }
|
||||
#endif /* CONFIG_ARCH_S3C64XX */
|
||||
|
||||
#ifdef CONFIG_S3C2410_COMMON_CLK
|
||||
void s3c2410_common_clk_init(struct device_node *np, unsigned long xti_f,
|
||||
int current_soc,
|
||||
void __iomem *reg_base);
|
||||
#else
|
||||
static inline void s3c2410_common_clk_init(struct device_node *np,
|
||||
unsigned long xti_f,
|
||||
int current_soc,
|
||||
void __iomem *reg_base) { }
|
||||
#endif /* CONFIG_S3C2410_COMMON_CLK */
|
||||
|
||||
#ifdef CONFIG_S3C2412_COMMON_CLK
|
||||
void s3c2412_common_clk_init(struct device_node *np, unsigned long xti_f,
|
||||
unsigned long ext_f, void __iomem *reg_base);
|
||||
#else
|
||||
static inline void s3c2412_common_clk_init(struct device_node *np,
|
||||
unsigned long xti_f,
|
||||
unsigned long ext_f,
|
||||
void __iomem *reg_base) { }
|
||||
#endif /* CONFIG_S3C2412_COMMON_CLK */
|
||||
|
||||
#ifdef CONFIG_S3C2443_COMMON_CLK
|
||||
void s3c2443_common_clk_init(struct device_node *np, unsigned long xti_f,
|
||||
int current_soc,
|
||||
void __iomem *reg_base);
|
||||
#else
|
||||
static inline void s3c2443_common_clk_init(struct device_node *np,
|
||||
unsigned long xti_f,
|
||||
int current_soc,
|
||||
void __iomem *reg_base) { }
|
||||
#endif /* CONFIG_S3C2443_COMMON_CLK */
|
||||
|
||||
#endif /* __LINUX_CLK_SAMSUNG_H_ */
|
||||
@@ -8,8 +8,10 @@
|
||||
+ __clang_patchlevel__)
|
||||
|
||||
#if CLANG_VERSION < 100001
|
||||
#ifndef __BPF_TRACING__
|
||||
# error Sorry, your version of Clang is too old - please use 10.0.1 or newer.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Compiler specific definitions for Clang compiler */
|
||||
|
||||
@@ -60,12 +62,6 @@
|
||||
#define COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW 1
|
||||
#endif
|
||||
|
||||
/* The following are for compatibility with GCC, from compiler-gcc.h,
|
||||
* and may be redefined here because they should not be shared with other
|
||||
* compilers, like ICC.
|
||||
*/
|
||||
#define barrier() __asm__ __volatile__("" : : : "memory")
|
||||
|
||||
#if __has_feature(shadow_call_stack)
|
||||
# define __noscs __attribute__((__no_sanitize__("shadow-call-stack")))
|
||||
#endif
|
||||
|
||||
@@ -15,25 +15,6 @@
|
||||
# error Sorry, your version of GCC is too old - please use 4.9 or newer.
|
||||
#endif
|
||||
|
||||
/* Optimization barrier */
|
||||
|
||||
/* The "volatile" is due to gcc bugs */
|
||||
#define barrier() __asm__ __volatile__("": : :"memory")
|
||||
/*
|
||||
* This version is i.e. to prevent dead stores elimination on @ptr
|
||||
* where gcc and llvm may behave differently when otherwise using
|
||||
* normal barrier(): while gcc behavior gets along with a normal
|
||||
* barrier(), llvm needs an explicit input variable to be assumed
|
||||
* clobbered. The issue is as follows: while the inline asm might
|
||||
* access any memory it wants, the compiler could have fit all of
|
||||
* @ptr into memory registers instead, and since @ptr never escaped
|
||||
* from that, it proved that the inline asm wasn't touching any of
|
||||
* it. This version works well with both compilers, i.e. we're telling
|
||||
* the compiler that the inline asm absolutely may see the contents
|
||||
* of @ptr. See also: https://llvm.org/bugs/show_bug.cgi?id=15495
|
||||
*/
|
||||
#define barrier_data(ptr) __asm__ __volatile__("": :"r"(ptr) :"memory")
|
||||
|
||||
/*
|
||||
* This macro obfuscates arithmetic on a variable address so that gcc
|
||||
* shouldn't recognize the original var, and make assumptions about it.
|
||||
@@ -175,5 +156,3 @@
|
||||
#else
|
||||
#define __diag_GCC_8(s)
|
||||
#endif
|
||||
|
||||
#define __no_fgcse __attribute__((optimize("-fno-gcse")))
|
||||
|
||||
@@ -24,7 +24,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
|
||||
long ______r; \
|
||||
static struct ftrace_likely_data \
|
||||
__aligned(4) \
|
||||
__section(_ftrace_annotated_branch) \
|
||||
__section("_ftrace_annotated_branch") \
|
||||
______f = { \
|
||||
.data.func = __func__, \
|
||||
.data.file = __FILE__, \
|
||||
@@ -60,7 +60,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
|
||||
#define __trace_if_value(cond) ({ \
|
||||
static struct ftrace_branch_data \
|
||||
__aligned(4) \
|
||||
__section(_ftrace_branch) \
|
||||
__section("_ftrace_branch") \
|
||||
__if_trace = { \
|
||||
.func = __func__, \
|
||||
.file = __FILE__, \
|
||||
@@ -80,11 +80,25 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
|
||||
|
||||
/* Optimization barrier */
|
||||
#ifndef barrier
|
||||
# define barrier() __memory_barrier()
|
||||
/* The "volatile" is due to gcc bugs */
|
||||
# define barrier() __asm__ __volatile__("": : :"memory")
|
||||
#endif
|
||||
|
||||
#ifndef barrier_data
|
||||
# define barrier_data(ptr) barrier()
|
||||
/*
|
||||
* This version is i.e. to prevent dead stores elimination on @ptr
|
||||
* where gcc and llvm may behave differently when otherwise using
|
||||
* normal barrier(): while gcc behavior gets along with a normal
|
||||
* barrier(), llvm needs an explicit input variable to be assumed
|
||||
* clobbered. The issue is as follows: while the inline asm might
|
||||
* access any memory it wants, the compiler could have fit all of
|
||||
* @ptr into memory registers instead, and since @ptr never escaped
|
||||
* from that, it proved that the inline asm wasn't touching any of
|
||||
* it. This version works well with both compilers, i.e. we're telling
|
||||
* the compiler that the inline asm absolutely may see the contents
|
||||
* of @ptr. See also: https://llvm.org/bugs/show_bug.cgi?id=15495
|
||||
*/
|
||||
# define barrier_data(ptr) __asm__ __volatile__("": :"r"(ptr) :"memory")
|
||||
#endif
|
||||
|
||||
/* workaround for GCC PR82365 if needed */
|
||||
@@ -118,7 +132,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
|
||||
".popsection\n\t"
|
||||
|
||||
/* Annotate a C jump table to allow objtool to follow the code flow */
|
||||
#define __annotate_jump_table __section(.rodata..c_jump_table)
|
||||
#define __annotate_jump_table __section(".rodata..c_jump_table")
|
||||
|
||||
#else
|
||||
#define annotate_reachable()
|
||||
@@ -206,7 +220,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
|
||||
* visible to the compiler.
|
||||
*/
|
||||
#define __ADDRESSABLE(sym) \
|
||||
static void * __section(.discard.addressable) __used \
|
||||
static void * __section(".discard.addressable") __used \
|
||||
__UNIQUE_ID(__PASTE(__addressable_,sym)) = (void *)&sym;
|
||||
|
||||
/**
|
||||
|
||||
@@ -254,7 +254,7 @@
|
||||
* gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html#index-section-variable-attribute
|
||||
* clang: https://clang.llvm.org/docs/AttributeReference.html#section-declspec-allocate
|
||||
*/
|
||||
#define __section(S) __attribute__((__section__(#S)))
|
||||
#define __section(section) __attribute__((__section__(section)))
|
||||
|
||||
/*
|
||||
* gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-unused-function-attribute
|
||||
|
||||
@@ -247,10 +247,6 @@ struct ftrace_likely_data {
|
||||
#define asm_inline asm
|
||||
#endif
|
||||
|
||||
#ifndef __no_fgcse
|
||||
# define __no_fgcse
|
||||
#endif
|
||||
|
||||
/* Are two types/vars the same type (ignoring qualifiers)? */
|
||||
#define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
|
||||
|
||||
|
||||
51
include/linux/cookie.h
Normal file
51
include/linux/cookie.h
Normal file
@@ -0,0 +1,51 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef __LINUX_COOKIE_H
|
||||
#define __LINUX_COOKIE_H
|
||||
|
||||
#include <linux/atomic.h>
|
||||
#include <linux/percpu.h>
|
||||
#include <asm/local.h>
|
||||
|
||||
struct pcpu_gen_cookie {
|
||||
local_t nesting;
|
||||
u64 last;
|
||||
} __aligned(16);
|
||||
|
||||
struct gen_cookie {
|
||||
struct pcpu_gen_cookie __percpu *local;
|
||||
atomic64_t forward_last ____cacheline_aligned_in_smp;
|
||||
atomic64_t reverse_last;
|
||||
};
|
||||
|
||||
#define COOKIE_LOCAL_BATCH 4096
|
||||
|
||||
#define DEFINE_COOKIE(name) \
|
||||
static DEFINE_PER_CPU(struct pcpu_gen_cookie, __##name); \
|
||||
static struct gen_cookie name = { \
|
||||
.local = &__##name, \
|
||||
.forward_last = ATOMIC64_INIT(0), \
|
||||
.reverse_last = ATOMIC64_INIT(0), \
|
||||
}
|
||||
|
||||
static __always_inline u64 gen_cookie_next(struct gen_cookie *gc)
|
||||
{
|
||||
struct pcpu_gen_cookie *local = this_cpu_ptr(gc->local);
|
||||
u64 val;
|
||||
|
||||
if (likely(local_inc_return(&local->nesting) == 1)) {
|
||||
val = local->last;
|
||||
if (__is_defined(CONFIG_SMP) &&
|
||||
unlikely((val & (COOKIE_LOCAL_BATCH - 1)) == 0)) {
|
||||
s64 next = atomic64_add_return(COOKIE_LOCAL_BATCH,
|
||||
&gc->forward_last);
|
||||
val = next - COOKIE_LOCAL_BATCH;
|
||||
}
|
||||
local->last = ++val;
|
||||
} else {
|
||||
val = atomic64_dec_return(&gc->reverse_last);
|
||||
}
|
||||
local_dec(&local->nesting);
|
||||
return val;
|
||||
}
|
||||
|
||||
#endif /* __LINUX_COOKIE_H */
|
||||
@@ -7,6 +7,12 @@
|
||||
#include <linux/fs.h>
|
||||
#include <asm/siginfo.h>
|
||||
|
||||
struct core_vma_metadata {
|
||||
unsigned long start, end;
|
||||
unsigned long flags;
|
||||
unsigned long dump_size;
|
||||
};
|
||||
|
||||
/*
|
||||
* These are the only things you should do on a core-file: use only these
|
||||
* functions to write out all the necessary info.
|
||||
@@ -16,6 +22,11 @@ extern int dump_skip(struct coredump_params *cprm, size_t nr);
|
||||
extern int dump_emit(struct coredump_params *cprm, const void *addr, int nr);
|
||||
extern int dump_align(struct coredump_params *cprm, int align);
|
||||
extern void dump_truncate(struct coredump_params *cprm);
|
||||
int dump_user_range(struct coredump_params *cprm, unsigned long start,
|
||||
unsigned long len);
|
||||
int dump_vma_snapshot(struct coredump_params *cprm, int *vma_count,
|
||||
struct core_vma_metadata **vma_meta,
|
||||
size_t *vma_data_size_ptr);
|
||||
#ifdef CONFIG_COREDUMP
|
||||
extern void do_coredump(const kernel_siginfo_t *siginfo);
|
||||
#else
|
||||
|
||||
@@ -173,7 +173,7 @@ void cpu_startup_entry(enum cpuhp_state state);
|
||||
void cpu_idle_poll_ctrl(bool enable);
|
||||
|
||||
/* Attach to any functions which should be considered cpuidle. */
|
||||
#define __cpuidle __attribute__((__section__(".cpuidle.text")))
|
||||
#define __cpuidle __section(".cpuidle.text")
|
||||
|
||||
bool cpu_in_idle(unsigned long pc);
|
||||
|
||||
|
||||
@@ -109,6 +109,12 @@ struct cpufreq_policy {
|
||||
bool fast_switch_possible;
|
||||
bool fast_switch_enabled;
|
||||
|
||||
/*
|
||||
* Set if the CPUFREQ_GOV_STRICT_TARGET flag is set for the current
|
||||
* governor.
|
||||
*/
|
||||
bool strict_target;
|
||||
|
||||
/*
|
||||
* Preferred average time interval between consecutive invocations of
|
||||
* the driver to set the frequency for this policy. To be set by the
|
||||
@@ -298,7 +304,7 @@ __ATTR(_name, 0644, show_##_name, store_##_name)
|
||||
|
||||
struct cpufreq_driver {
|
||||
char name[CPUFREQ_NAME_LEN];
|
||||
u8 flags;
|
||||
u16 flags;
|
||||
void *driver_data;
|
||||
|
||||
/* needed by all drivers */
|
||||
@@ -422,9 +428,18 @@ struct cpufreq_driver {
|
||||
*/
|
||||
#define CPUFREQ_IS_COOLING_DEV BIT(7)
|
||||
|
||||
/*
|
||||
* Set by drivers that need to update internale upper and lower boundaries along
|
||||
* with the target frequency and so the core and governors should also invoke
|
||||
* the diver if the target frequency does not change, but the policy min or max
|
||||
* may have changed.
|
||||
*/
|
||||
#define CPUFREQ_NEED_UPDATE_LIMITS BIT(8)
|
||||
|
||||
int cpufreq_register_driver(struct cpufreq_driver *driver_data);
|
||||
int cpufreq_unregister_driver(struct cpufreq_driver *driver_data);
|
||||
|
||||
bool cpufreq_driver_test_flags(u16 flags);
|
||||
const char *cpufreq_get_current_driver(void);
|
||||
void *cpufreq_get_driver_data(void);
|
||||
|
||||
@@ -561,12 +576,20 @@ struct cpufreq_governor {
|
||||
char *buf);
|
||||
int (*store_setspeed) (struct cpufreq_policy *policy,
|
||||
unsigned int freq);
|
||||
/* For governors which change frequency dynamically by themselves */
|
||||
bool dynamic_switching;
|
||||
struct list_head governor_list;
|
||||
struct module *owner;
|
||||
u8 flags;
|
||||
};
|
||||
|
||||
/* Governor flags */
|
||||
|
||||
/* For governors which change frequency dynamically by themselves */
|
||||
#define CPUFREQ_GOV_DYNAMIC_SWITCHING BIT(0)
|
||||
|
||||
/* For governors wanting the target frequency to be set exactly */
|
||||
#define CPUFREQ_GOV_STRICT_TARGET BIT(1)
|
||||
|
||||
|
||||
/* Pass a target to the cpufreq driver */
|
||||
unsigned int cpufreq_driver_fast_switch(struct cpufreq_policy *policy,
|
||||
unsigned int target_freq);
|
||||
|
||||
@@ -183,6 +183,7 @@ enum cpuhp_state {
|
||||
CPUHP_AP_PERF_POWERPC_THREAD_IMC_ONLINE,
|
||||
CPUHP_AP_PERF_POWERPC_TRACE_IMC_ONLINE,
|
||||
CPUHP_AP_PERF_POWERPC_HV_24x7_ONLINE,
|
||||
CPUHP_AP_PERF_POWERPC_HV_GPCI_ONLINE,
|
||||
CPUHP_AP_WATCHDOG_ONLINE,
|
||||
CPUHP_AP_WORKQUEUE_ONLINE,
|
||||
CPUHP_AP_RCUTREE_ONLINE,
|
||||
|
||||
@@ -271,13 +271,8 @@ struct cpuidle_governor {
|
||||
void (*reflect) (struct cpuidle_device *dev, int index);
|
||||
};
|
||||
|
||||
#ifdef CONFIG_CPU_IDLE
|
||||
extern int cpuidle_register_governor(struct cpuidle_governor *gov);
|
||||
extern s64 cpuidle_governor_latency_req(unsigned int cpu);
|
||||
#else
|
||||
static inline int cpuidle_register_governor(struct cpuidle_governor *gov)
|
||||
{return 0;}
|
||||
#endif
|
||||
|
||||
#define __CPU_PM_CPU_IDLE_ENTER(low_level_idle_enter, \
|
||||
idx, \
|
||||
|
||||
@@ -346,6 +346,9 @@ struct crush_work_bucket {
|
||||
|
||||
struct crush_work {
|
||||
struct crush_work_bucket **work; /* Per-bucket working store */
|
||||
#ifdef __KERNEL__
|
||||
struct list_head item;
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
@@ -149,6 +149,7 @@ int dax_writeback_mapping_range(struct address_space *mapping,
|
||||
struct dax_device *dax_dev, struct writeback_control *wbc);
|
||||
|
||||
struct page *dax_layout_busy_page(struct address_space *mapping);
|
||||
struct page *dax_layout_busy_page_range(struct address_space *mapping, loff_t start, loff_t end);
|
||||
dax_entry_t dax_lock_page(struct page *page);
|
||||
void dax_unlock_page(struct page *page, dax_entry_t cookie);
|
||||
#else
|
||||
@@ -179,6 +180,11 @@ static inline struct page *dax_layout_busy_page(struct address_space *mapping)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline struct page *dax_layout_busy_page_range(struct address_space *mapping, pgoff_t start, pgoff_t nr_pages)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline int dax_writeback_mapping_range(struct address_space *mapping,
|
||||
struct dax_device *dax_dev, struct writeback_control *wbc)
|
||||
{
|
||||
|
||||
@@ -144,10 +144,9 @@ void debugfs_create_u32_array(const char *name, umode_t mode,
|
||||
struct dentry *parent,
|
||||
struct debugfs_u32_array *array);
|
||||
|
||||
struct dentry *debugfs_create_devm_seqfile(struct device *dev, const char *name,
|
||||
struct dentry *parent,
|
||||
int (*read_fn)(struct seq_file *s,
|
||||
void *data));
|
||||
void debugfs_create_devm_seqfile(struct device *dev, const char *name,
|
||||
struct dentry *parent,
|
||||
int (*read_fn)(struct seq_file *s, void *data));
|
||||
|
||||
bool debugfs_initialized(void);
|
||||
|
||||
@@ -327,13 +326,12 @@ static inline void debugfs_create_u32_array(const char *name, umode_t mode,
|
||||
{
|
||||
}
|
||||
|
||||
static inline struct dentry *debugfs_create_devm_seqfile(struct device *dev,
|
||||
const char *name,
|
||||
struct dentry *parent,
|
||||
int (*read_fn)(struct seq_file *s,
|
||||
void *data))
|
||||
static inline void debugfs_create_devm_seqfile(struct device *dev,
|
||||
const char *name,
|
||||
struct dentry *parent,
|
||||
int (*read_fn)(struct seq_file *s,
|
||||
void *data))
|
||||
{
|
||||
return ERR_PTR(-ENODEV);
|
||||
}
|
||||
|
||||
static inline ssize_t debugfs_read_file_bool(struct file *file,
|
||||
|
||||
@@ -228,12 +228,7 @@ int devfreq_resume_device(struct devfreq *devfreq);
|
||||
void devfreq_suspend(void);
|
||||
void devfreq_resume(void);
|
||||
|
||||
/**
|
||||
* update_devfreq() - Reevaluate the device and configure frequency
|
||||
* @devfreq: the devfreq device
|
||||
*
|
||||
* Note: devfreq->lock must be held
|
||||
*/
|
||||
/* update_devfreq() - Reevaluate the device and configure frequency */
|
||||
int update_devfreq(struct devfreq *devfreq);
|
||||
|
||||
/* Helper functions for devfreq user device driver with OPP. */
|
||||
|
||||
@@ -203,6 +203,29 @@ static inline int dma_mmap_from_global_coherent(struct vm_area_struct *vma,
|
||||
}
|
||||
#endif /* CONFIG_DMA_DECLARE_COHERENT */
|
||||
|
||||
int dma_common_get_sgtable(struct device *dev, struct sg_table *sgt,
|
||||
void *cpu_addr, dma_addr_t dma_addr, size_t size,
|
||||
unsigned long attrs);
|
||||
int dma_common_mmap(struct device *dev, struct vm_area_struct *vma,
|
||||
void *cpu_addr, dma_addr_t dma_addr, size_t size,
|
||||
unsigned long attrs);
|
||||
struct page *dma_common_alloc_pages(struct device *dev, size_t size,
|
||||
dma_addr_t *dma_handle, enum dma_data_direction dir, gfp_t gfp);
|
||||
void dma_common_free_pages(struct device *dev, size_t size, struct page *vaddr,
|
||||
dma_addr_t dma_handle, enum dma_data_direction dir);
|
||||
|
||||
struct page **dma_common_find_pages(void *cpu_addr);
|
||||
void *dma_common_contiguous_remap(struct page *page, size_t size, pgprot_t prot,
|
||||
const void *caller);
|
||||
void *dma_common_pages_remap(struct page **pages, size_t size, pgprot_t prot,
|
||||
const void *caller);
|
||||
void dma_common_free_remap(void *cpu_addr, size_t size);
|
||||
|
||||
struct page *dma_alloc_from_pool(struct device *dev, size_t size,
|
||||
void **cpu_addr, gfp_t flags,
|
||||
bool (*phys_addr_ok)(struct device *, phys_addr_t, size_t));
|
||||
bool dma_free_from_pool(struct device *dev, void *start, size_t size);
|
||||
|
||||
#ifdef CONFIG_ARCH_HAS_DMA_COHERENCE_H
|
||||
#include <asm/dma-coherence.h>
|
||||
#elif defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE) || \
|
||||
|
||||
@@ -389,30 +389,6 @@ static inline void dma_sync_sgtable_for_device(struct device *dev,
|
||||
#define dma_get_sgtable(d, t, v, h, s) dma_get_sgtable_attrs(d, t, v, h, s, 0)
|
||||
#define dma_mmap_coherent(d, v, c, h, s) dma_mmap_attrs(d, v, c, h, s, 0)
|
||||
|
||||
extern int dma_common_mmap(struct device *dev, struct vm_area_struct *vma,
|
||||
void *cpu_addr, dma_addr_t dma_addr, size_t size,
|
||||
unsigned long attrs);
|
||||
struct page *dma_common_alloc_pages(struct device *dev, size_t size,
|
||||
dma_addr_t *dma_handle, enum dma_data_direction dir, gfp_t gfp);
|
||||
void dma_common_free_pages(struct device *dev, size_t size, struct page *vaddr,
|
||||
dma_addr_t dma_handle, enum dma_data_direction dir);
|
||||
struct page **dma_common_find_pages(void *cpu_addr);
|
||||
void *dma_common_contiguous_remap(struct page *page, size_t size,
|
||||
pgprot_t prot, const void *caller);
|
||||
|
||||
void *dma_common_pages_remap(struct page **pages, size_t size,
|
||||
pgprot_t prot, const void *caller);
|
||||
void dma_common_free_remap(void *cpu_addr, size_t size);
|
||||
|
||||
struct page *dma_alloc_from_pool(struct device *dev, size_t size,
|
||||
void **cpu_addr, gfp_t flags,
|
||||
bool (*phys_addr_ok)(struct device *, phys_addr_t, size_t));
|
||||
bool dma_free_from_pool(struct device *dev, void *start, size_t size);
|
||||
|
||||
int
|
||||
dma_common_get_sgtable(struct device *dev, struct sg_table *sgt, void *cpu_addr,
|
||||
dma_addr_t dma_addr, size_t size, unsigned long attrs);
|
||||
|
||||
static inline void *dma_alloc_coherent(struct device *dev, size_t size,
|
||||
dma_addr_t *dma_handle, gfp_t gfp)
|
||||
{
|
||||
|
||||
@@ -47,7 +47,7 @@ struct cppi5_host_desc_t {
|
||||
u32 buf_info1;
|
||||
u32 org_buf_len;
|
||||
u64 org_buf_ptr;
|
||||
u32 epib[0];
|
||||
u32 epib[];
|
||||
} __packed;
|
||||
|
||||
#define CPPI5_DESC_MIN_ALIGN (16U)
|
||||
@@ -139,7 +139,7 @@ struct cppi5_desc_epib_t {
|
||||
*/
|
||||
struct cppi5_monolithic_desc_t {
|
||||
struct cppi5_desc_hdr_t hdr;
|
||||
u32 epib[0];
|
||||
u32 epib[];
|
||||
};
|
||||
|
||||
#define CPPI5_INFO2_MDESC_DATA_OFFSET_SHIFT (18U)
|
||||
|
||||
@@ -5,37 +5,49 @@
|
||||
#ifndef _NET_DSA_8021Q_H
|
||||
#define _NET_DSA_8021Q_H
|
||||
|
||||
#include <linux/refcount.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
struct dsa_switch;
|
||||
struct sk_buff;
|
||||
struct net_device;
|
||||
struct packet_type;
|
||||
struct dsa_8021q_context;
|
||||
|
||||
struct dsa_8021q_crosschip_link {
|
||||
struct list_head list;
|
||||
int port;
|
||||
struct dsa_switch *other_ds;
|
||||
struct dsa_8021q_context *other_ctx;
|
||||
int other_port;
|
||||
refcount_t refcount;
|
||||
};
|
||||
|
||||
struct dsa_8021q_ops {
|
||||
int (*vlan_add)(struct dsa_switch *ds, int port, u16 vid, u16 flags);
|
||||
int (*vlan_del)(struct dsa_switch *ds, int port, u16 vid);
|
||||
};
|
||||
|
||||
struct dsa_8021q_context {
|
||||
const struct dsa_8021q_ops *ops;
|
||||
struct dsa_switch *ds;
|
||||
struct list_head crosschip_links;
|
||||
/* EtherType of RX VID, used for filtering on master interface */
|
||||
__be16 proto;
|
||||
};
|
||||
|
||||
#define DSA_8021Q_N_SUBVLAN 8
|
||||
|
||||
#if IS_ENABLED(CONFIG_NET_DSA_TAG_8021Q)
|
||||
|
||||
int dsa_port_setup_8021q_tagging(struct dsa_switch *ds, int index,
|
||||
bool enabled);
|
||||
int dsa_8021q_setup(struct dsa_8021q_context *ctx, bool enabled);
|
||||
|
||||
int dsa_8021q_crosschip_bridge_join(struct dsa_switch *ds, int port,
|
||||
struct dsa_switch *other_ds,
|
||||
int other_port,
|
||||
struct list_head *crosschip_links);
|
||||
int dsa_8021q_crosschip_bridge_join(struct dsa_8021q_context *ctx, int port,
|
||||
struct dsa_8021q_context *other_ctx,
|
||||
int other_port);
|
||||
|
||||
int dsa_8021q_crosschip_bridge_leave(struct dsa_switch *ds, int port,
|
||||
struct dsa_switch *other_ds,
|
||||
int other_port,
|
||||
struct list_head *crosschip_links);
|
||||
int dsa_8021q_crosschip_bridge_leave(struct dsa_8021q_context *ctx, int port,
|
||||
struct dsa_8021q_context *other_ctx,
|
||||
int other_port);
|
||||
|
||||
struct sk_buff *dsa_8021q_xmit(struct sk_buff *skb, struct net_device *netdev,
|
||||
u16 tpid, u16 tci);
|
||||
@@ -56,24 +68,21 @@ bool vid_is_dsa_8021q(u16 vid);
|
||||
|
||||
#else
|
||||
|
||||
int dsa_port_setup_8021q_tagging(struct dsa_switch *ds, int index,
|
||||
bool enabled)
|
||||
int dsa_8021q_setup(struct dsa_8021q_context *ctx, bool enabled)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dsa_8021q_crosschip_bridge_join(struct dsa_switch *ds, int port,
|
||||
struct dsa_switch *other_ds,
|
||||
int other_port,
|
||||
struct list_head *crosschip_links)
|
||||
int dsa_8021q_crosschip_bridge_join(struct dsa_8021q_context *ctx, int port,
|
||||
struct dsa_8021q_context *other_ctx,
|
||||
int other_port)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dsa_8021q_crosschip_bridge_leave(struct dsa_switch *ds, int port,
|
||||
struct dsa_switch *other_ds,
|
||||
int other_port,
|
||||
struct list_head *crosschip_links)
|
||||
int dsa_8021q_crosschip_bridge_leave(struct dsa_8021q_context *ctx, int port,
|
||||
struct dsa_8021q_context *other_ctx,
|
||||
int other_port)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ void __dynamic_ibdev_dbg(struct _ddebug *descriptor,
|
||||
|
||||
#define DEFINE_DYNAMIC_DEBUG_METADATA(name, fmt) \
|
||||
static struct _ddebug __aligned(8) \
|
||||
__section(__dyndbg) name = { \
|
||||
__section("__dyndbg") name = { \
|
||||
.modname = KBUILD_MODNAME, \
|
||||
.function = __func__, \
|
||||
.filename = __FILE__, \
|
||||
|
||||
@@ -241,6 +241,27 @@ bool ethtool_convert_link_mode_to_legacy_u32(u32 *legacy_u32,
|
||||
ETHTOOL_COALESCE_PKT_RATE_LOW | ETHTOOL_COALESCE_PKT_RATE_HIGH | \
|
||||
ETHTOOL_COALESCE_RATE_SAMPLE_INTERVAL)
|
||||
|
||||
#define ETHTOOL_STAT_NOT_SET (~0ULL)
|
||||
|
||||
/**
|
||||
* struct ethtool_pause_stats - statistics for IEEE 802.3x pause frames
|
||||
* @tx_pause_frames: transmitted pause frame count. Reported to user space
|
||||
* as %ETHTOOL_A_PAUSE_STAT_TX_FRAMES.
|
||||
*
|
||||
* Equivalent to `30.3.4.2 aPAUSEMACCtrlFramesTransmitted`
|
||||
* from the standard.
|
||||
*
|
||||
* @rx_pause_frames: received pause frame count. Reported to user space
|
||||
* as %ETHTOOL_A_PAUSE_STAT_RX_FRAMES. Equivalent to:
|
||||
*
|
||||
* Equivalent to `30.3.4.3 aPAUSEMACCtrlFramesReceived`
|
||||
* from the standard.
|
||||
*/
|
||||
struct ethtool_pause_stats {
|
||||
u64 tx_pause_frames;
|
||||
u64 rx_pause_frames;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ethtool_ops - optional netdev operations
|
||||
* @supported_coalesce_params: supported types of interrupt coalescing.
|
||||
@@ -282,6 +303,9 @@ bool ethtool_convert_link_mode_to_legacy_u32(u32 *legacy_u32,
|
||||
* Returns a negative error code or zero.
|
||||
* @get_ringparam: Report ring sizes
|
||||
* @set_ringparam: Set ring sizes. Returns a negative error code or zero.
|
||||
* @get_pause_stats: Report pause frame statistics. Drivers must not zero
|
||||
* statistics which they don't report. The stats structure is initialized
|
||||
* to ETHTOOL_STAT_NOT_SET indicating driver does not report statistics.
|
||||
* @get_pauseparam: Report pause parameters
|
||||
* @set_pauseparam: Set pause parameters. Returns a negative error code
|
||||
* or zero.
|
||||
@@ -418,6 +442,8 @@ struct ethtool_ops {
|
||||
struct ethtool_ringparam *);
|
||||
int (*set_ringparam)(struct net_device *,
|
||||
struct ethtool_ringparam *);
|
||||
void (*get_pause_stats)(struct net_device *dev,
|
||||
struct ethtool_pause_stats *pause_stats);
|
||||
void (*get_pauseparam)(struct net_device *,
|
||||
struct ethtool_pauseparam*);
|
||||
int (*set_pauseparam)(struct net_device *,
|
||||
@@ -479,6 +505,10 @@ struct ethtool_ops {
|
||||
struct ethtool_fecparam *);
|
||||
void (*get_ethtool_phy_stats)(struct net_device *,
|
||||
struct ethtool_stats *, u64 *);
|
||||
int (*get_phy_tunable)(struct net_device *,
|
||||
const struct ethtool_tunable *, void *);
|
||||
int (*set_phy_tunable)(struct net_device *,
|
||||
const struct ethtool_tunable *, const void *);
|
||||
};
|
||||
|
||||
int ethtool_check_ops(const struct ethtool_ops *ops);
|
||||
|
||||
@@ -130,7 +130,7 @@ struct kernel_symbol {
|
||||
* discarded in the final link stage.
|
||||
*/
|
||||
#define __ksym_marker(sym) \
|
||||
static int __ksym_marker_##sym[0] __section(.discard.ksym) __used
|
||||
static int __ksym_marker_##sym[0] __section(".discard.ksym") __used
|
||||
|
||||
#define __EXPORT_SYMBOL(sym, sec, ns) \
|
||||
__ksym_marker(sym); \
|
||||
|
||||
@@ -38,9 +38,6 @@
|
||||
#define F2FS_MAX_QUOTAS 3
|
||||
|
||||
#define F2FS_ENC_UTF8_12_1 1
|
||||
#define F2FS_ENC_STRICT_MODE_FL (1 << 0)
|
||||
#define f2fs_has_strict_mode(sbi) \
|
||||
(sbi->s_encoding_flags & F2FS_ENC_STRICT_MODE_FL)
|
||||
|
||||
#define F2FS_IO_SIZE(sbi) (1 << F2FS_OPTION(sbi).write_io_size_bits) /* Blocks */
|
||||
#define F2FS_IO_SIZE_KB(sbi) (1 << (F2FS_OPTION(sbi).write_io_size_bits + 2)) /* KB */
|
||||
|
||||
22
include/linux/fault-inject-usercopy.h
Normal file
22
include/linux/fault-inject-usercopy.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef __LINUX_FAULT_INJECT_USERCOPY_H__
|
||||
#define __LINUX_FAULT_INJECT_USERCOPY_H__
|
||||
|
||||
/*
|
||||
* This header provides a wrapper for injecting failures to user space memory
|
||||
* access functions.
|
||||
*/
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#ifdef CONFIG_FAULT_INJECTION_USERCOPY
|
||||
|
||||
bool should_fail_usercopy(void);
|
||||
|
||||
#else
|
||||
|
||||
static inline bool should_fail_usercopy(void) { return false; }
|
||||
|
||||
#endif /* CONFIG_FAULT_INJECTION_USERCOPY */
|
||||
|
||||
#endif /* __LINUX_FAULT_INJECT_USERCOPY_H__ */
|
||||
@@ -8,7 +8,7 @@
|
||||
/* List of all valid flags for the open/openat flags argument: */
|
||||
#define VALID_OPEN_FLAGS \
|
||||
(O_RDONLY | O_WRONLY | O_RDWR | O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC | \
|
||||
O_APPEND | O_NDELAY | O_NONBLOCK | O_NDELAY | __O_SYNC | O_DSYNC | \
|
||||
O_APPEND | O_NDELAY | O_NONBLOCK | __O_SYNC | O_DSYNC | \
|
||||
FASYNC | O_DIRECT | O_LARGEFILE | O_DIRECTORY | O_NOFOLLOW | \
|
||||
O_NOATIME | O_CLOEXEC | O_PATH | __O_TMPFILE)
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user