Skip to content

Commit 40a258e

Browse files
committed
Initial files for the meta-ltd OE/Yocto layer
Based on meta-96boards and duplicating HiKey's kernel (for validation and development, before pushing additional updates). Signed-off-by: Ricardo Salveti <[email protected]>
0 parents  commit 40a258e

23 files changed

+4072
-0
lines changed

COPYING.MIT

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Permission is hereby granted, free of charge, to any person obtaining a copy
2+
of this software and associated documentation files (the "Software"), to deal
3+
in the Software without restriction, including without limitation the rights
4+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
5+
copies of the Software, and to permit persons to whom the Software is
6+
furnished to do so, subject to the following conditions:
7+
8+
The above copyright notice and this permission notice shall be included in
9+
all copies or substantial portions of the Software.
10+
11+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
17+
THE SOFTWARE.

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Meta-LTD
2+
================================
3+
4+
OpenEmbedded/Yocto Project development layer for LTD related work.

conf/layer.conf

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# We might have a conf and classes directory, append to BBPATH
2+
BBPATH .= ":${LAYERDIR}"
3+
4+
# We have a recipes directory, add to BBFILES
5+
BBFILES += "${LAYERDIR}/recipes*/*/*.bb ${LAYERDIR}/recipes*/*/*.bbappend"
6+
7+
BBFILE_COLLECTIONS += "meta-ltd"
8+
BBFILE_PATTERN_meta-ltd := "^${LAYERDIR}/"
9+
BBFILE_PRIORITY_meta-ltd = "9"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Support additional firmware for WiLink8 modules
2+
# TIInit_11.8.32.bts is required for bluetooth support but this particular
3+
# version is not available in the linux-firmware repository.
4+
#
5+
SRC_URI_append_hikey = "\
6+
https://git.ti.com/ti-bt/service-packs/blobs/raw/ccb94e6adf7f13f774c42f731c27a8aec8e1d388/initscripts/TIInit_11.8.32.bts;name=TIInit_11.8.32 \
7+
"
8+
SRC_URI[TIInit_11.8.32.md5sum] = "a76788680905c30979038f9e6aa407f3"
9+
SRC_URI[TIInit_11.8.32.sha256sum] = "26ab0608e39fab95a6a55070c2f8364c92aad34442e8349abda71cee4da3277a"
10+
11+
do_install_append_hikey() {
12+
cp ${WORKDIR}/TIInit_11.8.32.bts ${D}/lib/firmware/ti-connectivity/
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
From 81c9833b810ba2d3e7351256ad4ee1eaba1bc2a3 Mon Sep 17 00:00:00 2001
2+
From: Xinliang Liu <[email protected]>
3+
Date: Mon, 28 Dec 2015 17:30:58 +0800
4+
Subject: [PATCH 01/10] drivers/gpu: Add ARM Mali Utgard r6p0 driver
5+
6+
Add ARM Mali Utgard driver
7+
8+
The assumption is that the contents of directory driver/src/devicedrv/mali/
9+
from DX910-SW-99002-r6p0-01rel0.tgz is unpacked into drivers/gpu/arm/utgard/
10+
in the kernel source tree.
11+
12+
Signed-off-by: Xinliang Liu <[email protected]>
13+
---
14+
drivers/gpu/Makefile | 2 +-
15+
drivers/gpu/arm/Kconfig | 1 +
16+
drivers/gpu/arm/Makefile | 1 +
17+
drivers/video/Kconfig | 1 +
18+
19+
---
20+
drivers/gpu/Makefile | 2 +-
21+
drivers/gpu/arm/Kconfig | 1 +
22+
drivers/gpu/arm/Makefile | 1 +
23+
drivers/video/Kconfig | 1 +
24+
4 files changed, 4 insertions(+), 1 deletion(-)
25+
26+
--- a/drivers/gpu/Makefile
27+
+++ b/drivers/gpu/Makefile
28+
@@ -2,5 +2,5 @@
29+
# taken to initialize them in the correct order. Link order is the only way
30+
# to ensure this currently.
31+
obj-$(CONFIG_TEGRA_HOST1X) += host1x/
32+
-obj-y += drm/ vga/
33+
+obj-y += drm/ vga/ arm/
34+
obj-$(CONFIG_IMX_IPUV3_CORE) += ipu-v3/
35+
--- /dev/null
36+
+++ b/drivers/gpu/arm/Kconfig
37+
@@ -0,0 +1 @@
38+
+source "drivers/gpu/arm/utgard/Kconfig"
39+
--- /dev/null
40+
+++ b/drivers/gpu/arm/Makefile
41+
@@ -0,0 +1 @@
42+
+obj-y += utgard/
43+
--- a/drivers/video/Kconfig
44+
+++ b/drivers/video/Kconfig
45+
@@ -18,6 +18,7 @@ source "drivers/gpu/vga/Kconfig"
46+
source "drivers/gpu/host1x/Kconfig"
47+
source "drivers/gpu/ipu-v3/Kconfig"
48+
49+
+source "drivers/gpu/arm/Kconfig"
50+
source "drivers/gpu/drm/Kconfig"
51+
52+
menu "Frame buffer Devices"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
From a0bc5c81f625789df71fb845d47c82f8d282436b Mon Sep 17 00:00:00 2001
2+
From: Fathi Boudra <[email protected]>
3+
Date: Fri, 2 Dec 2016 14:04:49 +0200
4+
Subject: [PATCH 1/1] linux-hikey: dts: add mali configuration in the device
5+
tree
6+
7+
Signed-off-by: Fathi Boudra <[email protected]>
8+
---
9+
arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 38 +++++++++++++++++++++++++++++++
10+
1 file changed, 38 insertions(+)
11+
12+
diff --git a/arch/arm64/boot/dts/hisilicon/hi6220.dtsi b/arch/arm64/boot/dts/hisilicon/hi6220.dtsi
13+
index ea5204e..ccb9425 100644
14+
--- a/arch/arm64/boot/dts/hisilicon/hi6220.dtsi
15+
+++ b/arch/arm64/boot/dts/hisilicon/hi6220.dtsi
16+
@@ -937,5 +937,43 @@
17+
};
18+
};
19+
};
20+
+
21+
+ mali:mali@f4080000 {
22+
+ compatible = "arm,mali-450", "arm,mali-utgard";
23+
+ reg = <0x0 0x3f100000 0x0 0x00708000>;
24+
+ clocks = <&media_ctrl HI6220_G3D_CLK>,
25+
+ <&media_ctrl HI6220_G3D_PCLK>;
26+
+ clock-names = "clk_g3d", "pclk_g3d";
27+
+ mali_def_freq = <500>;
28+
+ pclk_freq = <144>;
29+
+ dfs_steps = <2>;
30+
+ dfs_lockprf = <1>;
31+
+ dfs_limit_max_prf = <1>;
32+
+ dfs_profile_num = <2>;
33+
+ dfs_profiles = <250 3 0>, <500 1 0>;
34+
+ mali_type = <2>;
35+
+
36+
+ interrupt-parent = <&gic>;
37+
+ interrupts = <1 126 4>, /*gp*/
38+
+ <1 126 4>, /*gp mmu*/
39+
+ <1 126 4>, /*pp bc*/
40+
+ <1 126 4>, /*pmu*/
41+
+ <1 126 4>, /*pp0*/
42+
+ <1 126 4>,
43+
+ <1 126 4>, /*pp1*/
44+
+ <1 126 4>,
45+
+ <1 126 4>, /*pp2*/
46+
+ <1 126 4>,
47+
+ <1 126 4>, /*pp4*/
48+
+ <1 126 4>,
49+
+ <1 126 4>, /*pp5*/
50+
+ <1 126 4>,
51+
+ <1 126 4>, /*pp6*/
52+
+ <1 126 4>;
53+
+ interrupt-names = "IRQGP", "IRQGPMMU", "IRQPP", "IRQPMU",
54+
+ "IRQPP0", "IRQPPMMU0", "IRQPP1", "IRQPPMMU1",
55+
+ "IRQPP2", "IRQPPMMU2","IRQPP4", "IRQPPMMU4",
56+
+ "IRQPP5", "IRQPPMMU5", "IRQPP6", "IRQPPMMU6";
57+
+ };
58+
};
59+
};
60+
--
61+
2.10.2
62+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
From fe903e3266d484312b98b8cdd2e2f59d80d23a60 Mon Sep 17 00:00:00 2001
2+
From: Zoltan Kuscsik <[email protected]>
3+
Date: Thu, 1 Dec 2016 12:54:46 +0100
4+
Subject: [PATCH 1/2] mali, dma-mapping: use unsigned long for dma_attrs
5+
6+
---
7+
drivers/gpu/arm/utgard/linux/mali_memory_os_alloc.c | 11 ++++++-----
8+
1 file changed, 6 insertions(+), 5 deletions(-)
9+
10+
diff --git a/drivers/gpu/arm/utgard/linux/mali_memory_os_alloc.c b/drivers/gpu/arm/utgard/linux/mali_memory_os_alloc.c
11+
index 1a6cc06..e016de6 100755
12+
--- a/drivers/gpu/arm/utgard/linux/mali_memory_os_alloc.c
13+
+++ b/drivers/gpu/arm/utgard/linux/mali_memory_os_alloc.c
14+
@@ -26,9 +26,10 @@
15+
#define MALI_OS_MEMORY_KERNEL_BUFFER_SIZE_IN_PAGES (MALI_OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB * 256)
16+
#define MALI_OS_MEMORY_POOL_TRIM_JIFFIES (10 * CONFIG_HZ) /* Default to 10s */
17+
18+
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
19+
-/* Write combine dma_attrs */
20+
-static DEFINE_DMA_ATTRS(dma_attrs_wc);
21+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
22+
+static unsigned long dma_attrs_wc;
23+
+#else
24+
+#error("Only Kernel version >=4.9 supported)
25+
#endif
26+
27+
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0)
28+
@@ -750,8 +751,8 @@ _mali_osk_errcode_t mali_mem_os_init(void)
29+
return _MALI_OSK_ERR_NOMEM;
30+
}
31+
32+
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
33+
- dma_set_attr(DMA_ATTR_WRITE_COMBINE, &dma_attrs_wc);
34+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
35+
+ dma_attrs_wc |= DMA_ATTR_WRITE_COMBINE;
36+
#endif
37+
38+
register_shrinker(&mali_mem_os_allocator.shrinker);
39+
--
40+
1.9.1
41+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
From c0c014f7409a9dd2d3a4d340f91cd1fab8b9846a Mon Sep 17 00:00:00 2001
2+
From: Leo Yan <[email protected]>
3+
Date: Thu, 16 Jun 2016 14:56:54 +0800
4+
Subject: [PATCH 1/1] thermal: hisilicon: use dev_dbg when bind sensors
5+
6+
Current code use dev_err to output log if kernel cannot bind any one
7+
sensor in initialization. This is a strictly checking to make sure all
8+
four sensors have to be used for system.
9+
10+
After enable thermal power allocator, usually system only use one sensor
11+
for multiple actors. This patch changes to use dev_dbg so that avoid
12+
confusion in boot log, and remove duplicate printing log.
13+
14+
Signed-off-by: Leo Yan <[email protected]>
15+
---
16+
drivers/thermal/hisi_thermal.c | 7 ++-----
17+
1 file changed, 2 insertions(+), 5 deletions(-)
18+
19+
diff --git a/drivers/thermal/hisi_thermal.c b/drivers/thermal/hisi_thermal.c
20+
index f642966..06baf72 100644
21+
--- a/drivers/thermal/hisi_thermal.c
22+
+++ b/drivers/thermal/hisi_thermal.c
23+
@@ -260,7 +260,7 @@ static int hisi_thermal_register_sensor(struct platform_device *pdev,
24+
if (IS_ERR(sensor->tzd)) {
25+
ret = PTR_ERR(sensor->tzd);
26+
sensor->tzd = NULL;
27+
- dev_err(&pdev->dev, "failed to register sensor id %d: %d\n",
28+
+ dev_dbg(&pdev->dev, "failed to register sensor id %d: %d\n",
29+
sensor->id, ret);
30+
return ret;
31+
}
32+
@@ -351,10 +351,7 @@ static int hisi_thermal_probe(struct platform_device *pdev)
33+
for (i = 0; i < HISI_MAX_SENSORS; ++i) {
34+
ret = hisi_thermal_register_sensor(pdev, data,
35+
&data->sensors[i], i);
36+
- if (ret)
37+
- dev_err(&pdev->dev,
38+
- "failed to register thermal sensor: %d\n", ret);
39+
- else
40+
+ if (!ret)
41+
hisi_thermal_toggle_sensor(&data->sensors[i], true);
42+
}
43+
44+
--
45+
2.10.2
46+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
From 73a7e965c1c300afa8dd165b780440a418edfa9f Mon Sep 17 00:00:00 2001
2+
From: Zoltan Kuscsik <[email protected]>
3+
Date: Thu, 1 Dec 2016 12:56:56 +0100
4+
Subject: [PATCH 2/2] Mali: replace page_cache_release with put_page
5+
6+
page_cache_release was an alias for put_page which
7+
is now removed.
8+
---
9+
drivers/gpu/arm/utgard/linux/mali_memory_swap_alloc.c | 7 ++++++-
10+
1 file changed, 6 insertions(+), 1 deletion(-)
11+
12+
diff --git a/drivers/gpu/arm/utgard/linux/mali_memory_swap_alloc.c b/drivers/gpu/arm/utgard/linux/mali_memory_swap_alloc.c
13+
index a46eb19..44ba8f1 100755
14+
--- a/drivers/gpu/arm/utgard/linux/mali_memory_swap_alloc.c
15+
+++ b/drivers/gpu/arm/utgard/linux/mali_memory_swap_alloc.c
16+
@@ -52,7 +52,7 @@
17+
#define MALI_SWAP_LOW_MEM_DEFAULT_VALUE (60*1024*1024)
18+
#define MALI_SWAP_INVALIDATE_MALI_ADDRESS (0) /* Used to mark the given memory cookie is invalidate. */
19+
#define MALI_SWAP_GLOBAL_SWAP_FILE_SIZE (0xFFFFFFFF)
20+
-#define MALI_SWAP_GLOBAL_SWAP_FILE_INDEX ((MALI_SWAP_GLOBAL_SWAP_FILE_SIZE) >> PAGE_CACHE_SHIFT)
21+
+#define MALI_SWAP_GLOBAL_SWAP_FILE_INDEX ((MALI_SWAP_GLOBAL_SWAP_FILE_SIZE) >> PAGE_SHIFT)
22+
#define MALI_SWAP_GLOBAL_SWAP_FILE_INDEX_RESERVE (1 << 15) /* Reserved for CoW nonlinear swap backend memory, the space size is 128MB. */
23+
24+
unsigned int mali_mem_swap_out_threshold_value = MALI_SWAP_LOW_MEM_DEFAULT_VALUE;
25+
@@ -183,7 +183,12 @@ static void mali_mem_swap_out_page_node(mali_page_node *page_node)
26+
dma_unmap_page(&mali_platform_device->dev, page_node->swap_it->dma_addr,
27+
_MALI_OSK_MALI_PAGE_SIZE, DMA_TO_DEVICE);
28+
set_page_dirty(page_node->swap_it->page);
29+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
30+
+ put_page(page_node->swap_it->page);
31+
+#else
32+
page_cache_release(page_node->swap_it->page);
33+
+#endif
34+
+
35+
}
36+
37+
void mali_mem_swap_unlock_single_mem_backend(mali_mem_backend *mem_bkend)
38+
--
39+
1.9.1
40+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
From 3f6489554b75d55cd20443f3202bbda8096499b4 Mon Sep 17 00:00:00 2001
2+
From: Guillaume Tucker <[email protected]>
3+
Date: Mon, 23 Feb 2015 11:52:29 +0000
4+
Subject: [PATCH 02/10] drivers/gpu/arm/utgard: add option for custom device
5+
tree
6+
7+
Some Mali 450 Utgard GPU platform integration files like
8+
the HiKey need a custom Device Tree entry. This config
9+
option is to disable the standard driver code that expects
10+
things in the device tree which conflict with what the
11+
platform files need.
12+
13+
This is only an interim solution, tne platform files should
14+
really be tidied-up to enable the standard device tree
15+
instead (would require adding more IRQ and other resources).
16+
17+
Signed-off-by: Guillaume Tucker <[email protected]>
18+
---
19+
drivers/gpu/arm/utgard/Kconfig | 12 ++++++++++++
20+
drivers/gpu/arm/utgard/common/mali_kernel_core.c | 2 +-
21+
drivers/gpu/arm/utgard/common/mali_osk_mali.h | 2 +-
22+
drivers/gpu/arm/utgard/linux/mali_osk_mali.c | 4 ++--
23+
4 files changed, 16 insertions(+), 4 deletions(-)
24+
25+
--- a/drivers/gpu/arm/utgard/Kconfig
26+
+++ b/drivers/gpu/arm/utgard/Kconfig
27+
@@ -96,6 +96,18 @@ config MALI_DT
28+
device tree is enabled in kernel and corresponding hardware description is implemented
29+
properly in device DTS file.
30+
31+
+config MALI_PLAT_SPECIFIC_DT
32+
+ bool "Platform specific Device Tree is being used"
33+
+ depends on MALI_DT
34+
+ default n
35+
+ ---help---
36+
+ This is a pragmatic approach for some platforms which make
37+
+ use of a device tree entry that does not strictly comply to
38+
+ what the standard Utgard driver expects to find, but have
39+
+ their platform data implemented the old way. Such platforms
40+
+ should be converted to using the Device Tree so this
41+
+ configuration option can be removed.
42+
+
43+
config MALI_QUIET
44+
bool "Make Mali driver very quiet"
45+
depends on MALI400 && !MALI400_DEBUG
46+
--- a/drivers/gpu/arm/utgard/common/mali_kernel_core.c
47+
+++ b/drivers/gpu/arm/utgard/common/mali_kernel_core.c
48+
@@ -738,7 +738,7 @@ _mali_osk_errcode_t mali_initialize_subs
49+
{
50+
_mali_osk_errcode_t err;
51+
52+
-#ifdef CONFIG_MALI_DT
53+
+#if defined(CONFIG_MALI_DT) && !defined(CONFIG_MALI_PLAT_SPECIFIC_DT)
54+
err = _mali_osk_resource_initialize();
55+
if (_MALI_OSK_ERR_OK != err) {
56+
mali_terminate_subsystems();
57+
--- a/drivers/gpu/arm/utgard/common/mali_osk_mali.h
58+
+++ b/drivers/gpu/arm/utgard/common/mali_osk_mali.h
59+
@@ -30,7 +30,7 @@ extern "C" {
60+
*/
61+
typedef struct mali_gpu_device_data _mali_osk_device_data;
62+
63+
-#ifdef CONFIG_MALI_DT
64+
+#if defined(CONFIG_MALI_DT) && !defined(CONFIG_MALI_PLAT_SPECIFIC_DT)
65+
/** @brief Initialize those device resources when we use device tree
66+
*
67+
* @return _MALI_OSK_ERR_OK on success, otherwise failure.
68+
--- a/drivers/gpu/arm/utgard/linux/mali_osk_mali.c
69+
+++ b/drivers/gpu/arm/utgard/linux/mali_osk_mali.c
70+
@@ -25,7 +25,7 @@
71+
#include "mali_kernel_linux.h"
72+
73+
74+
-#ifdef CONFIG_MALI_DT
75+
+#if defined(CONFIG_MALI_DT) && !defined(CONFIG_MALI_PLAT_SPECIFIC_DT)
76+
77+
#define MALI_OSK_INVALID_RESOURCE_ADDRESS 0xFFFFFFFF
78+
79+
@@ -248,7 +248,7 @@ u32 _mali_osk_get_pmu_switch_delay(void)
80+
return 0;
81+
}
82+
83+
-#else /* CONFIG_MALI_DT */
84+
+#else /* CONFIG_MALI_DT && !CONFIG_MALI_PLAT_SPECIFIC_DT */
85+
86+
_mali_osk_errcode_t _mali_osk_resource_find(u32 addr, _mali_osk_resource_t *res)
87+
{

0 commit comments

Comments
 (0)