mirror of
https://github.com/torvalds/linux.git
synced 2024-12-20 18:11:47 +00:00
b24413180f
Many source files in the tree are missing licensing information, which makes it harder for compliance tools to determine the correct license. By default all files without license information are under the default license of the kernel, which is GPL version 2. Update the files which contain no license information with the 'GPL-2.0' SPDX license identifier. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This patch is based on work done by Thomas Gleixner and Kate Stewart and Philippe Ombredanne. How this work was done: Patches were generated and checked against linux-4.14-rc6 for a subset of the use cases: - file had no licensing information it it. - file was a */uapi/* one with no licensing information in it, - file was a */uapi/* one with existing licensing information, Further patches will be generated in subsequent months to fix up cases where non-standard license headers were used, and references to license had to be inferred by heuristics based on keywords. The analysis to determine which SPDX License Identifier to be applied to a file was done in a spreadsheet of side by side results from of the output of two independent scanners (ScanCode & Windriver) producing SPDX tag:value files created by Philippe Ombredanne. Philippe prepared the base worksheet, and did an initial spot review of a few 1000 files. The 4.13 kernel was the starting point of the analysis with 60,537 files assessed. Kate Stewart did a file by file comparison of the scanner results in the spreadsheet to determine which SPDX license identifier(s) to be applied to the file. She confirmed any determination that was not immediately clear with lawyers working with the Linux Foundation. Criteria used to select files for SPDX license identifier tagging was: - Files considered eligible had to be source code files. - Make and config files were included as candidates if they contained >5 lines of source - File already had some variant of a license header in it (even if <5 lines). All documentation files were explicitly excluded. The following heuristics were used to determine which SPDX license identifiers to apply. - when both scanners couldn't find any license traces, file was considered to have no license information in it, and the top level COPYING file license applied. For non */uapi/* files that summary was: SPDX license identifier # files ---------------------------------------------------|------- GPL-2.0 11139 and resulted in the first patch in this series. If that file was a */uapi/* path one, it was "GPL-2.0 WITH Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was: SPDX license identifier # files ---------------------------------------------------|------- GPL-2.0 WITH Linux-syscall-note 930 and resulted in the second patch in this series. - if a file had some form of licensing information in it, and was one of the */uapi/* ones, it was denoted with the Linux-syscall-note if any GPL family license was found in the file or had no licensing in it (per prior point). Results summary: SPDX license identifier # files ---------------------------------------------------|------ GPL-2.0 WITH Linux-syscall-note 270 GPL-2.0+ WITH Linux-syscall-note 169 ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21 ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17 LGPL-2.1+ WITH Linux-syscall-note 15 GPL-1.0+ WITH Linux-syscall-note 14 ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5 LGPL-2.0+ WITH Linux-syscall-note 4 LGPL-2.1 WITH Linux-syscall-note 3 ((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3 ((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1 and that resulted in the third patch in this series. - when the two scanners agreed on the detected license(s), that became the concluded license(s). - when there was disagreement between the two scanners (one detected a license but the other didn't, or they both detected different licenses) a manual inspection of the file occurred. - In most cases a manual inspection of the information in the file resulted in a clear resolution of the license that should apply (and which scanner probably needed to revisit its heuristics). - When it was not immediately clear, the license identifier was confirmed with lawyers working with the Linux Foundation. - If there was any question as to the appropriate license identifier, the file was flagged for further research and to be revisited later in time. In total, over 70 hours of logged manual review was done on the spreadsheet to determine the SPDX license identifiers to apply to the source files by Kate, Philippe, Thomas and, in some cases, confirmation by lawyers working with the Linux Foundation. Kate also obtained a third independent scan of the 4.13 code base from FOSSology, and compared selected files where the other two scanners disagreed against that SPDX file, to see if there was new insights. The Windriver scanner is based on an older version of FOSSology in part, so they are related. Thomas did random spot checks in about 500 files from the spreadsheets for the uapi headers and agreed with SPDX license identifier in the files he inspected. For the non-uapi files Thomas did random spot checks in about 15000 files. In initial set of patches against 4.14-rc6, 3 files were found to have copy/paste license identifier errors, and have been fixed to reflect the correct identifier. Additionally Philippe spent 10 hours this week doing a detailed manual inspection and review of the 12,461 patched files from the initial patch version early this week with: - a full scancode scan run, collecting the matched texts, detected license ids and scores - reviewing anything where there was a license detected (about 500+ files) to ensure that the applied SPDX license was correct - reviewing anything where there was no detection but the patch license was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied SPDX license was correct This produced a worksheet with 20 files needing minor correction. This worksheet was then exported into 3 different .csv files for the different types of files to be modified. These .csv files were then reviewed by Greg. Thomas wrote a script to parse the csv files and add the proper SPDX tag to the file, in the format that the file expected. This script was further refined by Greg based on the output to detect more types of files automatically and to distinguish between header and source .c files (which need different comment types.) Finally Greg ran the script using the .csv files to generate the patches. Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
198 lines
6.5 KiB
C
198 lines
6.5 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __ARCH_DOVE_MPP_CODED_H
|
|
#define __ARCH_DOVE_MPP_CODED_H
|
|
|
|
#define MPP(_num, _sel, _in, _out) ( \
|
|
/* MPP number */ ((_num) & 0xff) | \
|
|
/* MPP select value */ (((_sel) & 0xf) << 8) | \
|
|
/* may be input signal */ ((!!(_in)) << 12) | \
|
|
/* may be output signal */ ((!!(_out)) << 13))
|
|
|
|
#define MPP0_GPIO0 MPP(0, 0x0, 1, 1)
|
|
#define MPP0_UA2_RTSn MPP(0, 0x2, 0, 0)
|
|
#define MPP0_SDIO0_CD MPP(0, 0x3, 0, 0)
|
|
#define MPP0_LCD0_PWM MPP(0, 0xf, 0, 0)
|
|
|
|
#define MPP1_GPIO1 MPP(1, 0x0, 1, 1)
|
|
#define MPP1_UA2_CTSn MPP(1, 0x2, 0, 0)
|
|
#define MPP1_SDIO0_WP MPP(1, 0x3, 0, 0)
|
|
#define MPP1_LCD1_PWM MPP(1, 0xf, 0, 0)
|
|
|
|
#define MPP2_GPIO2 MPP(2, 0x0, 1, 1)
|
|
#define MPP2_SATA_PRESENT MPP(2, 0x1, 0, 0)
|
|
#define MPP2_UA2_TXD MPP(2, 0x2, 0, 0)
|
|
#define MPP2_SDIO0_BUS_POWER MPP(2, 0x3, 0, 0)
|
|
#define MPP2_UA_RTSn1 MPP(2, 0x4, 0, 0)
|
|
|
|
#define MPP3_GPIO3 MPP(3, 0x0, 1, 1)
|
|
#define MPP3_SATA_ACT MPP(3, 0x1, 0, 0)
|
|
#define MPP3_UA2_RXD MPP(3, 0x2, 0, 0)
|
|
#define MPP3_SDIO0_LED_CTRL MPP(3, 0x3, 0, 0)
|
|
#define MPP3_UA_CTSn1 MPP(3, 0x4, 0, 0)
|
|
#define MPP3_SPI_LCD_CS1 MPP(3, 0xf, 0, 0)
|
|
|
|
#define MPP4_GPIO4 MPP(4, 0x0, 1, 1)
|
|
#define MPP4_UA3_RTSn MPP(4, 0x2, 0, 0)
|
|
#define MPP4_SDIO1_CD MPP(4, 0x3, 0, 0)
|
|
#define MPP4_SPI_1_MISO MPP(4, 0x4, 0, 0)
|
|
|
|
#define MPP5_GPIO5 MPP(5, 0x0, 1, 1)
|
|
#define MPP5_UA3_CTSn MPP(5, 0x2, 0, 0)
|
|
#define MPP5_SDIO1_WP MPP(5, 0x3, 0, 0)
|
|
#define MPP5_SPI_1_CS MPP(5, 0x4, 0, 0)
|
|
|
|
#define MPP6_GPIO6 MPP(6, 0x0, 1, 1)
|
|
#define MPP6_UA3_TXD MPP(6, 0x2, 0, 0)
|
|
#define MPP6_SDIO1_BUS_POWER MPP(6, 0x3, 0, 0)
|
|
#define MPP6_SPI_1_MOSI MPP(6, 0x4, 0, 0)
|
|
|
|
#define MPP7_GPIO7 MPP(7, 0x0, 1, 1)
|
|
#define MPP7_UA3_RXD MPP(7, 0x2, 0, 0)
|
|
#define MPP7_SDIO1_LED_CTRL MPP(7, 0x3, 0, 0)
|
|
#define MPP7_SPI_1_SCK MPP(7, 0x4, 0, 0)
|
|
|
|
#define MPP8_GPIO8 MPP(8, 0x0, 1, 1)
|
|
#define MPP8_WD_RST_OUT MPP(8, 0x1, 0, 0)
|
|
|
|
#define MPP9_GPIO9 MPP(9, 0x0, 1, 1)
|
|
#define MPP9_PEX1_CLKREQn MPP(9, 0x5, 0, 0)
|
|
|
|
#define MPP10_GPIO10 MPP(10, 0x0, 1, 1)
|
|
#define MPP10_SSP_SCLK MPP(10, 0x5, 0, 0)
|
|
|
|
#define MPP11_GPIO11 MPP(11, 0x0, 1, 1)
|
|
#define MPP11_SATA_PRESENT MPP(11, 0x1, 0, 0)
|
|
#define MPP11_SATA_ACT MPP(11, 0x2, 0, 0)
|
|
#define MPP11_SDIO0_LED_CTRL MPP(11, 0x3, 0, 0)
|
|
#define MPP11_SDIO1_LED_CTRL MPP(11, 0x4, 0, 0)
|
|
#define MPP11_PEX0_CLKREQn MPP(11, 0x5, 0, 0)
|
|
|
|
#define MPP12_GPIO12 MPP(12, 0x0, 1, 1)
|
|
#define MPP12_SATA_ACT MPP(12, 0x1, 0, 0)
|
|
#define MPP12_UA2_RTSn MPP(12, 0x2, 0, 0)
|
|
#define MPP12_AD0_I2S_EXT_MCLK MPP(12, 0x3, 0, 0)
|
|
#define MPP12_SDIO1_CD MPP(12, 0x4, 0, 0)
|
|
|
|
#define MPP13_GPIO13 MPP(13, 0x0, 1, 1)
|
|
#define MPP13_UA2_CTSn MPP(13, 0x2, 0, 0)
|
|
#define MPP13_AD1_I2S_EXT_MCLK MPP(13, 0x3, 0, 0)
|
|
#define MPP13_SDIO1WP MPP(13, 0x4, 0, 0)
|
|
#define MPP13_SSP_EXTCLK MPP(13, 0x5, 0, 0)
|
|
|
|
#define MPP14_GPIO14 MPP(14, 0x0, 1, 1)
|
|
#define MPP14_UA2_TXD MPP(14, 0x2, 0, 0)
|
|
#define MPP14_SDIO1_BUS_POWER MPP(14, 0x4, 0, 0)
|
|
#define MPP14_SSP_RXD MPP(14, 0x5, 0, 0)
|
|
|
|
#define MPP15_GPIO15 MPP(15, 0x0, 1, 1)
|
|
#define MPP15_UA2_RXD MPP(15, 0x2, 0, 0)
|
|
#define MPP15_SDIO1_LED_CTRL MPP(15, 0x4, 0, 0)
|
|
#define MPP15_SSP_SFRM MPP(15, 0x5, 0, 0)
|
|
|
|
#define MPP16_GPIO16 MPP(16, 0x0, 1, 1)
|
|
#define MPP16_UA3_RTSn MPP(16, 0x2, 0, 0)
|
|
#define MPP16_SDIO0_CD MPP(16, 0x3, 0, 0)
|
|
#define MPP16_SPI_LCD_CS1 MPP(16, 0x4, 0, 0)
|
|
#define MPP16_AC97_SDATA_IN1 MPP(16, 0x5, 0, 0)
|
|
|
|
#define MPP17_GPIO17 MPP(17, 0x0, 1, 1)
|
|
#define MPP17_AC97_SYSCLK_OUT MPP(17, 0x1, 0, 0)
|
|
#define MPP17_UA3_CTSn MPP(17, 0x2, 0, 0)
|
|
#define MPP17_SDIO0_WP MPP(17, 0x3, 0, 0)
|
|
#define MPP17_TW_SDA2 MPP(17, 0x4, 0, 0)
|
|
#define MPP17_AC97_SDATA_IN2 MPP(17, 0x5, 0, 0)
|
|
|
|
#define MPP18_GPIO18 MPP(18, 0x0, 1, 1)
|
|
#define MPP18_UA3_TXD MPP(18, 0x2, 0, 0)
|
|
#define MPP18_SDIO0_BUS_POWER MPP(18, 0x3, 0, 0)
|
|
#define MPP18_LCD0_PWM MPP(18, 0x4, 0, 0)
|
|
#define MPP18_AC_SDATA_IN3 MPP(18, 0x5, 0, 0)
|
|
|
|
#define MPP19_GPIO19 MPP(19, 0x0, 1, 1)
|
|
#define MPP19_UA3_RXD MPP(19, 0x2, 0, 0)
|
|
#define MPP19_SDIO0_LED_CTRL MPP(19, 0x3, 0, 0)
|
|
#define MPP19_TW_SCK2 MPP(19, 0x4, 0, 0)
|
|
|
|
#define MPP20_GPIO20 MPP(20, 0x0, 1, 1)
|
|
#define MPP20_AC97_SYSCLK_OUT MPP(20, 0x1, 0, 0)
|
|
#define MPP20_SPI_LCD_MISO MPP(20, 0x2, 0, 0)
|
|
#define MPP20_SDIO1_CD MPP(20, 0x3, 0, 0)
|
|
#define MPP20_SDIO0_CD MPP(20, 0x5, 0, 0)
|
|
#define MPP20_SPI_1_MISO MPP(20, 0x6, 0, 0)
|
|
|
|
#define MPP21_GPIO21 MPP(21, 0x0, 1, 1)
|
|
#define MPP21_UA1_RTSn MPP(21, 0x1, 0, 0)
|
|
#define MPP21_SPI_LCD_CS0 MPP(21, 0x2, 0, 0)
|
|
#define MPP21_SDIO1_WP MPP(21, 0x3, 0, 0)
|
|
#define MPP21_SSP_SFRM MPP(21, 0x4, 0, 0)
|
|
#define MPP21_SDIO0_WP MPP(21, 0x5, 0, 0)
|
|
#define MPP21_SPI_1_CS MPP(21, 0x6, 0, 0)
|
|
|
|
#define MPP22_GPIO22 MPP(22, 0x0, 1, 1)
|
|
#define MPP22_UA1_CTSn MPP(22, 0x1, 0, 0)
|
|
#define MPP22_SPI_LCD_MOSI MPP(22, 0x2, 0, 0)
|
|
#define MPP22_SDIO1_BUS_POWER MPP(22, 0x3, 0, 0)
|
|
#define MPP22_SSP_TXD MPP(22, 0x4, 0, 0)
|
|
#define MPP22_SDIO0_BUS_POWER MPP(22, 0x5, 0, 0)
|
|
#define MPP22_SPI_1_MOSI MPP(22, 0x6, 0, 0)
|
|
|
|
#define MPP23_GPIO23 MPP(23, 0x0, 1, 1)
|
|
#define MPP23_SPI_LCD_SCK MPP(23, 0x2, 0, 0)
|
|
#define MPP23_SDIO1_LED_CTRL MPP(23, 0x3, 0, 0)
|
|
#define MPP23_SSP_SCLK MPP(23, 0x4, 0, 0)
|
|
#define MPP23_SDIO0_LED_CTRL MPP(23, 0x5, 0, 0)
|
|
#define MPP23_SPI_1_SCK MPP(23, 0x6, 0, 0)
|
|
|
|
#define MPP_MAX 23
|
|
|
|
#define MPP_GRP(_grp, _mode) MPP((_grp), (_mode), 0, 0)
|
|
|
|
/* for MPP groups _num is a group index */
|
|
enum dove_mpp_grp_idx {
|
|
MPP_24_39 = 2,
|
|
MPP_40_45 = 0,
|
|
MPP_46_51 = 1,
|
|
MPP_58_61 = 5,
|
|
MPP_62_63 = 4,
|
|
MPP_GRP_MAX = 5,
|
|
};
|
|
|
|
#define MPP_GRP_24_39_GPIO MPP_GRP(MPP_24_39, 0x1)
|
|
#define MPP_GRP_24_39_CAM MPP_GRP(MPP_24_39, 0x0)
|
|
|
|
#define MPP_GRP_40_45_GPIO MPP_GRP(MPP_40_45, 0x1)
|
|
#define MPP_GRP_40_45_SD0 MPP_GRP(MPP_40_45, 0x0)
|
|
|
|
#define MPP_GRP_46_51_GPIO MPP_GRP(MPP_46_51, 0x1)
|
|
#define MPP_GRP_46_51_SD1 MPP_GRP(MPP_46_51, 0x0)
|
|
|
|
#define MPP_GRP_58_61_GPIO MPP_GRP(MPP_58_61, 0x1)
|
|
#define MPP_GRP_58_61_SPI MPP_GRP(MPP_58_61, 0x0)
|
|
|
|
#define MPP_GRP_62_63_GPIO MPP_GRP(MPP_62_63, 0x1)
|
|
#define MPP_GRP_62_63_UA1 MPP_GRP(MPP_62_63, 0x0)
|
|
|
|
/* The MPP[64:71] control differs from other groups */
|
|
#define MPP_GRP_NFC_64_71_GPO 0x1
|
|
#define MPP_GRP_NFC_64_71_NFC 0x0
|
|
|
|
/*
|
|
* The MPP[52:57] functionality is encoded by 4 bits in different
|
|
* registers. The _num field in this case encodes those bits in
|
|
* correspodence with Table 135 of 88AP510 Functional specification
|
|
*/
|
|
#define MPP_GRP_AU1_52_57_AU1 0x0
|
|
#define MPP_GRP_AU1_52_57_AU1_GPIO57 0x2
|
|
#define MPP_GRP_AU1_52_57_GPIO 0xa
|
|
#define MPP_GRP_AU1_52_57_TW_GPIO 0xb
|
|
#define MPP_GRP_AU1_52_57_AU1_SSP 0xc
|
|
#define MPP_GRP_AU1_52_57_SSP_GPIO 0xe
|
|
#define MPP_GRP_AU1_52_57_SSP_TW 0xf
|
|
|
|
void dove_mpp_conf(unsigned int *mpp_list,
|
|
unsigned int *mpp_grp_list,
|
|
unsigned int grp_au1_52_57,
|
|
unsigned int grp_nfc_64_71);
|
|
|
|
#endif /* __ARCH_DOVE_MPP_CODED_H */
|