Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
7 changes: 4 additions & 3 deletions .metadata/product.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
"/fs/fs",
"/networking/networking",
"/security/security",
"/usb/usb",
"/pru_io/pru_io",
"/memory_configurator/components"
"/xbar/xbar",
"/memory_configurator/components",
"/optiflash/optiflash",
"sdl/sdl"
],
"devices": [
"AM64x",
Expand Down
105 changes: 105 additions & 0 deletions .project/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,107 @@ function mergeCgtOptions(project, commonCgtOptions) {
return project;
}

function addOsDefine(project, os) {

let osDefine = "OS_" + os.toUpperCase().replace(/-/g, "_");;
if (project.hasOwnProperty("defines") &&
project["defines"].hasOwnProperty("common") &&
project["defines"]["common"].includes(osDefine) == false) {
project["defines"]["common"].push(osDefine);
}
return project;
}

function addOsIncludes(project, os, buildOption) {
let includes = [];
switch(os) {
case "freertos":
includes.push("${MCU_PLUS_SDK_PATH}/source/kernel/freertos/FreeRTOS-Kernel/include");
if (buildOption.cpu.match(/m4f*/)) {
includes.push("${MCU_PLUS_SDK_PATH}/source/kernel/freertos/portable/TI_ARM_CLANG/ARM_CM4F");
cpu = "m4f";
} else if (buildOption.cpu.match (/r5f*/)) {
includes.push("${MCU_PLUS_SDK_PATH}/source/kernel/freertos/portable/TI_ARM_CLANG/ARM_CR5F");
cpu = "r5f";
} else if (buildOption.cpu.match(/a53*/)) {
includes.push("${MCU_PLUS_SDK_PATH}/source/kernel/freertos/portable/GCC/ARM_CA53");
cpu = "a53";
}
includes.push("${MCU_PLUS_SDK_PATH}/source/kernel/freertos/config/" + buildOption.device + "/" + cpu);
break;
case "freertos-smp":
includes.push("${MCU_PLUS_SDK_PATH}/source/kernel/freertos/FreeRTOS-Kernel-smp/include");
if (buildOption.cpu.match(/a53*/)) {
includes.push("${MCU_PLUS_SDK_PATH}/source/kernel/freertos/portable_smp/GCC/ARM_CA53");
cpu = "a53";
}
includes.push("${MCU_PLUS_SDK_PATH}/source/kernel/freertos/config/" + buildOption.device + "/" + cpu + "-smp");
break;
case "safertos":
includes.push("${MCU_PLUS_SDK_PATH}/source/kernel/safertos/safeRTOS/kernel/include_api");
includes.push("${MCU_PLUS_SDK_PATH}/source/kernel/safertos/safeRTOS/config");
break;
case "nortos":
default:
break;
}
if (project.hasOwnProperty("includes") &&
project["includes"].hasOwnProperty("common")) {
for (let include of includes) {
if (project["includes"]["common"].includes(include) == false)
project["includes"]["common"].push(include);
};
}
return project;
}

function getLibsBuitwihOS() {
return [
"lwipif-cpsw-freertos",
"lwipif-cpsw-nortos",
"lwipif-icssg-freertos",
"lwipif-icssg-nortos",
"lwipif-ic-freertos",
"enet_cli_freertos",
"lwip-contrib-freertos-icss_emac",
"lwip-contrib-freertos",
"lwip-contrib-nortos",
"lwip-freertos-icss_emac",
"lwip-freertos",
"lwip-nortos",
"tsn_combase-freertos",
"tsn_gptp-freertos",
"tsn_icssg_combase-freertos",
"tsn_icssg_gptp-freertos",
"tsn_l2-freertos",
"tsn_lldp-freertos",
"tsn_netconf-freertos",
"tsn_unibase-freertos",
"tsn_uniconf-freertos"
];
}

function updateLibsWithOs(project, os) {
let osList = require(`./device/project_${device}`).getOsList(buildOption.cpu);
if (project.hasOwnProperty("libs") &&
project["libs"].hasOwnProperty("common")) {
let libs_list = [];

for (let lib of project["libs"]["common"]) {
let libWithOs = lib.replace(/\${ConfigName}/, buildOption.os + "." + "${ConfigName}");
if (osList.some(osItem => lib.match(new RegExp("^" + osItem + "\\."))) ||
getLibsBuitwihOS().some(libWithOs => lib.match(new RegExp("^" + libWithOs)))) {
libs_list.push(lib);
}
else
{
libs_list.push(libWithOs);
}
};
project["libs"]["common"] = libs_list;
}
return project;
}
function relative(pathStr1, pathStr2) {
let relpath = path.relative(pathStr1, pathStr2)

Expand Down Expand Up @@ -192,6 +293,10 @@ module.exports = {
setInstrumentationMode,
cleanBuildfiles,
mergeCgtOptions,
addOsDefine,
addOsIncludes,
updateLibsWithOs,
getLibsBuitwihOS,
convertTemplateToFile,
path: {
relative,
Expand Down
5 changes: 5 additions & 0 deletions .project/device/project_am243x.js
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,10 @@ function getEnableGccBuild() {
return IsGccBuildEnabled;
}

function getOsList(cpu) {
return ["nortos", "freertos"];
}

module.exports = {
getComponentList,
getExampleList,
Expand All @@ -517,4 +521,5 @@ module.exports = {
getProductNameProjectSpec,
getFlashAddr,
getEnableGccBuild,
getOsList,
};
4 changes: 4 additions & 0 deletions .project/device/project_am261x.js
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,9 @@ function getFlashAddr() {
return 0x60000000;
}

function getOsList(cpu) {
return ["nortos", "freertos"];
}
module.exports = {
getComponentList,
getExampleList,
Expand All @@ -603,4 +606,5 @@ module.exports = {
getLinuxFwName,
getProductNameProjectSpec,
getFlashAddr,
getOsList,
};
5 changes: 5 additions & 0 deletions .project/device/project_am263px.js
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,10 @@ function getFlashAddr() {
return 0x60000000;
}

function getOsList(cpu) {
return ["nortos", "freertos"];
}

module.exports = {
getComponentList,
getExampleList,
Expand All @@ -589,4 +593,5 @@ module.exports = {
getLinuxFwName,
getProductNameProjectSpec,
getFlashAddr,
getOsList,
};
5 changes: 5 additions & 0 deletions .project/device/project_am263x.js
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,10 @@ function getFlashAddr() {
return 0x60000000;
}

function getOsList(cpu) {
return ["nortos", "freertos"];
}

module.exports = {
getComponentList,
getExampleList,
Expand All @@ -552,4 +556,5 @@ module.exports = {
getLinuxFwName,
getProductNameProjectSpec,
getFlashAddr,
getOsList,
};
5 changes: 5 additions & 0 deletions .project/device/project_am273x.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,10 @@ function getFlashAddr() {
return 0xC6000000;
}

function getOsList(cpu) {
return ["nortos", "freertos"];
}

module.exports = {
getComponentList,
getExampleList,
Expand All @@ -349,4 +353,5 @@ module.exports = {
getLinuxFwName,
getProductNameProjectSpec,
getFlashAddr,
getOsList,
};
10 changes: 10 additions & 0 deletions .project/device/project_am64x.js
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,15 @@ function getEnableGccBuild() {
const IsGccBuildEnabled = 0;
return IsGccBuildEnabled;
}
function getOsList(cpu) {
switch(cpu) {
default:
return ["nortos", "freertos"];
case "a53":
case "a53-smp":
return ["nortos", "freertos", "freertos-smp"];
}
}

module.exports = {
getComponentList,
Expand All @@ -462,4 +471,5 @@ module.exports = {
getProductNameProjectSpec,
getFlashAddr,
getEnableGccBuild,
getOsList,
};
5 changes: 5 additions & 0 deletions .project/device/project_am65x.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ function getFlashAddr() {
return 0x58000000;
}

function getOsList(cpu) {
return ["nortos", "freertos"];
}

module.exports = {
getComponentList,
getExampleList,
Expand All @@ -156,4 +160,5 @@ module.exports = {
getLinuxFwName,
getProductNameProjectSpec,
getFlashAddr,
getOsList,
};
75 changes: 64 additions & 11 deletions .project/genMakefiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ function genMakefileDeviceTop(component_file_list, example_file_list, device, is
let buildTargetScrub_gcc = [];
let buildTargetClean = [];
let buildTargetScrub = [];
let osList = require(`./device/project_${device}`).getOsList(buildOption.cpu);

property = require(`../${component}`).getComponentProperty(device);

Expand All @@ -46,17 +47,38 @@ function genMakefileDeviceTop(component_file_list, example_file_list, device, is
component_make.isPrebuilt = true;
}
for(buildOption of property.buildOptionCombos) {
if(buildOption.cgt === "gcc-armv7" && (device === "am64x" || device === "am243x")){
buildTarget_gcc +=` ${property.name}_${buildOption.cpu}.${buildOption.cgt}`;
buildTargetClean_gcc +=` ${property.name}_${buildOption.cpu}.${buildOption.cgt}_clean`;
buildTargetScrub_gcc +=` ${property.name}_${buildOption.cpu}.${buildOption.cgt}_scrub`;
if (osList.includes(property.name) ||
common.getLibsBuitwihOS().some(libWithOs => libWithOs.match(new RegExp("^" + property.name))))
{
if(buildOption.cgt === "gcc-armv7" && (device === "am64x" || device === "am243x")){
buildTarget_gcc +=` ${property.name}_${buildOption.cpu}.${buildOption.cgt}`;
buildTargetClean_gcc +=` ${property.name}_${buildOption.cpu}.${buildOption.cgt}_clean`;
buildTargetScrub_gcc +=` ${property.name}_${buildOption.cpu}.${buildOption.cgt}_scrub`;
}
else{
buildTarget +=` ${property.name}_${buildOption.cpu}.${buildOption.cgt}`;
buildTargetClean +=` ${property.name}_${buildOption.cpu}.${buildOption.cgt}_clean`;
buildTargetScrub +=` ${property.name}_${buildOption.cpu}.${buildOption.cgt}_scrub`;
}
}
else{
buildTarget +=` ${property.name}_${buildOption.cpu}.${buildOption.cgt}`;
buildTargetClean +=` ${property.name}_${buildOption.cpu}.${buildOption.cgt}_clean`;
buildTargetScrub +=` ${property.name}_${buildOption.cpu}.${buildOption.cgt}_scrub`;
else
{
let osList = require(`./device/project_${device}`).getOsList(buildOption.cpu);
if(buildOption.cgt === "gcc-armv7" && (device === "am64x" || device === "am243x")){
osList.forEach(os => {
buildTarget_gcc +=` ${property.name}_${buildOption.cpu}.${buildOption.cgt}.${os}`;
buildTargetClean_gcc +=` ${property.name}_${buildOption.cpu}.${buildOption.cgt}.${os}_clean`;
buildTargetScrub_gcc +=` ${property.name}_${buildOption.cpu}.${buildOption.cgt}.${os}_scrub`;
});
}
else{
osList.forEach(os => {
buildTarget +=` ${property.name}_${buildOption.cpu}.${buildOption.cgt}.${os}`;
buildTargetClean +=` ${property.name}_${buildOption.cpu}.${buildOption.cgt}.${os}_clean`;
buildTargetScrub +=` ${property.name}_${buildOption.cpu}.${buildOption.cgt}.${os}_scrub`;
});
}
}

}
if((device === "am64x" || device === "am243x")){
component_make.buildTarget_gcc = buildTarget_gcc;
Expand Down Expand Up @@ -203,6 +225,7 @@ function genMakefileLibrary(component_file_list, device) {
for(buildOption of property.buildOptionCombos) {
let commonCgtOptions = require(`./cgt/cgt_${buildOption.cgt}`).getCgtOptions(buildOption.cpu, device);
let common_build_property = require(`./device/project_${device}`).getProperty();
let osList = require(`./device/project_${device}`).getOsList(buildOption.cpu);
build_property = require(`../${component}`).getComponentBuildProperty(buildOption);

let project = [];
Expand All @@ -225,10 +248,36 @@ function genMakefileLibrary(component_file_list, device) {
{
tag = `.${property.tag}`;
}
common.convertTemplateToFile(
if(osList.includes(property.name) ||
common.getLibsBuitwihOS().some(libWithOs => libWithOs.match(new RegExp("^" + property.name))))
{
/* Kernel libraries */
projectClone = _.cloneDeep(project)
projectClone = common.addOsDefine( projectClone, buildOption.os);
if (common.getLibsBuitwihOS().some(libWithOs => libWithOs.match(new RegExp("^" + property.name))))
{
projectClone = common.addOsIncludes(projectClone, buildOption.os, buildOption);
}
args.project = projectClone;
common.convertTemplateToFile(
`.project/templates/makefile_${project.type}.xdt`,
`${project.dirPath}/makefile${tag}.${project.device}.${project.cpu}.${project.cgt}`,
args);
}
else
{
osList.forEach(os => {
args.os = os;
projectClone = _.cloneDeep(project)

projectClone = common.addOsDefine(projectClone, os);
args.project = common.addOsIncludes(projectClone, os, buildOption);
common.convertTemplateToFile(
`.project/templates/makefile_${project.type}.xdt`,
`${project.dirPath}/makefile${tag}.${project.device}.${project.cpu}.${project.cgt}.${os}`,
args);
});
}
}
}
}
Expand All @@ -244,7 +293,7 @@ function cleanMakefileLibrary(component_file_list, device) {
project = _.merge({}, project, property);
project.relpath = common.path.relative(path.normalize(__dirname + "/.."), property.dirPath);

common.deleteFile(`${project.dirPath}/makefile.${buildOption.device}.${buildOption.cpu}.${buildOption.cgt}`);
common.deleteFile(`${project.dirPath}/makefile.${buildOption.device}.${buildOption.cpu}.${buildOption.cgt}.${project.os}`);
}
}
}
Expand All @@ -269,8 +318,11 @@ function genMakefileExample(example_file_list, device) {
project.relpath = common.path.relative(path.normalize(__dirname + "/.."), project.dirPath);
project = _.merge({}, project, buildOption);
project = _.merge({}, project, build_property);
project = common.updateLibsWithOs(project, buildOption.os);
project = common.mergeCgtOptions(project, commonCgtOptions);
project = common.mergeCgtOptions(project, common_build_property);
project = common.addOsDefine(project, buildOption.os);
project = common.addOsIncludes(project, buildOption.os, buildOption);
project.dirPath = makefileOutPath;

let isInstrumentationMode = false;
Expand Down Expand Up @@ -353,6 +405,7 @@ function genMakefileProjectSpec(example_file_list, device) {
project.relpath = common.path.relative(path.normalize(__dirname + "/.."), project.dirPath);
project = _.merge({}, project, buildOption);
project = common.mergeCgtOptions(project, common_build_property);
project = common.addOsDefine(project, buildOption.os);
project = _.merge({}, project, build_property);
project.dirPath = makefileOutPath;

Expand Down
3 changes: 3 additions & 0 deletions .project/genProjectSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,11 @@ function genProjectSpecExample(device) {
project.relpath = common.path.relative(path.normalize(__dirname + "/.."), project.dirPath);
project = _.merge({}, project, buildOption);
project = _.merge({}, project, build_property);
project = common.updateLibsWithOs(project, buildOption.os);
project = common.mergeCgtOptions(project, commonCgtOptions);
project = common.mergeCgtOptions(project, common_build_property);
project = common.addOsDefine(project, buildOption.os);
project = common.addOsIncludes(project, buildOption.os, buildOption);
project.dirPath = projectSpecOutPath;

let args = {
Expand Down
Loading
Loading