Skip to contentSkip to conversation

cmem.inc: add arm64 support for cmem injection

PATCH In review Denys Dmytriyenko 2 participants 2 messages Jan 9, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cmem.inc: add arm64 support for cmem injection

Since cmem 4.16 now supports arm64, update cmem injection code accordingly to work with arm64 DTS files.

Cc Sam Nelson <[email protected]>
Cc Jacob Stiffler <[email protected]>
Cc Suman Anna <[email protected]>
---
 recipes-kernel/linux/cmem.inc | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
recipes-kernel/linux/cmem.inc +5 -2
index 0327557f..5fd0b9d9 100644
@@ -70,11 +70,14 @@ python do_setup_cmem() {
 
             # Get destination directory and destination dtsi filename which adds
             #   the MACHINE prefix.
-            dst_dir  = os.path.join(localdata.getVar('S'), 'arch/arm/boot/dts')
+            dst_dir  = os.path.join(localdata.getVar('S'), localdata.expand('arch/${ARCH}/boot/dts'))
             dst_dtsi = localdata.expand('${MACHINE}-${CMEM_DTSI}')
 
             # Copy cmem.dtsi into source tree
-            shutil.copy(os.path.join(src_dir,src_dtsi), os.path.join(dst_dir,dst_dtsi))
+            if localdata.getVar('ARCH') is 'arm64':
+                shutil.copy(os.path.join(src_dir,src_dtsi), os.path.join(dst_dir,'ti',dst_dtsi))
+            else:
+                shutil.copy(os.path.join(src_dir,src_dtsi), os.path.join(dst_dir,dst_dtsi))
 
             # Inject dtsi into each dts in list
             for dtb in (localdata.getVar('CMEM_DEVICETREE') or '').split():
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Denys Dmytriyenko

Since cmem 4.16 now supports arm64, update cmem injection code accordingly to work with arm64 DTS files.

Cc Sam Nelson <[email protected]>
Cc Jacob Stiffler <[email protected]>
Cc Suman Anna <[email protected]>

Thanks for the patch Denys. This is definitely needed to scale for both v7 and v8 platforms.

Quoted 26 lines
---
 recipes-kernel/linux/cmem.inc | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
recipes-kernel/linux/cmem.inc +5 -2
index 0327557f..5fd0b9d9 100644
@@ -70,11 +70,14 @@ python do_setup_cmem() {
 
             # Get destination directory and destination dtsi filename which adds
             #   the MACHINE prefix.
-            dst_dir  = os.path.join(localdata.getVar('S'), 'arch/arm/boot/dts')
+            dst_dir  = os.path.join(localdata.getVar('S'), localdata.expand('arch/${ARCH}/boot/dts'))
             dst_dtsi = localdata.expand('${MACHINE}-${CMEM_DTSI}')
 
             # Copy cmem.dtsi into source tree
-            shutil.copy(os.path.join(src_dir,src_dtsi), os.path.join(dst_dir,dst_dtsi))
+            if localdata.getVar('ARCH') is 'arm64':
+                shutil.copy(os.path.join(src_dir,src_dtsi), os.path.join(dst_dir,'ti',dst_dtsi))
+            else:
+                shutil.copy(os.path.join(src_dir,src_dtsi), os.path.join(dst_dir,dst_dtsi))
 
             # Inject dtsi into each dts in list
             for dtb in (localdata.getVar('CMEM_DEVICETREE') or '').split():