- Add support for single channel - Add support for multi channel using single PRU - Add support for multi channel using multiple PRUs with load share mode Fixes: PINDSW-5468, PINDSW-5479, PINDSW-5488, PINDSW-5494, PINDSW-5495 Signed-off-by: Dhaval Khandla <dhavaljk@ti.com>
83 lines
2.4 KiB
JavaScript
83 lines
2.4 KiB
JavaScript
|
|
let common = system.getScript("/common");
|
|
let pinmux = system.getScript("/drivers/pinmux/pinmux");
|
|
|
|
|
|
function getInterfaceName(inst)
|
|
{
|
|
return `PRU_${inst.instance}_PRU`;
|
|
}
|
|
|
|
function getInterfacePinList(inst)
|
|
{
|
|
let pinList = [];
|
|
|
|
/* BISSC_CHANNEL0_TX_ENABLE - is configured as soc gpio and kept low forever */
|
|
/*pinList.push({ pinName: "GPO2", displayName: "BISSC_CHANNEL0_TX_ENABLE", rx: false});*/
|
|
pinList.push({ pinName: "GPO1", displayName: "BISSC_CHANNEL0_TX", rx: false});
|
|
pinList.push({ pinName: "GPO0", displayName: "BISSC_CHANNEL0_CLK", rx: false});
|
|
pinList.push({ pinName: "GPI13", displayName: "BISSC_CHANNEL0_RX", rx: true});
|
|
|
|
/* BISSC_CHANNEL1_TX_ENABLE - is configured as soc gpio and kept low forever */
|
|
/*pinList.push({ pinName: "GPO5", displayName: "BISSC_CHANNEL1_TX_ENABLE", rx: false});*/
|
|
pinList.push({ pinName: "GPO4", displayName: "BISSC_CHANNEL1_TX", rx: false});
|
|
pinList.push({ pinName: "GPO3", displayName: "BISSC_CHANNEL1_CLK", rx: false});
|
|
pinList.push({ pinName: "GPI14", displayName: "BISSC_CHANNEL1_RX", rx: true});
|
|
|
|
/* BISSC_CHANNEL2_TX_ENABLE - is configured as soc gpio and kept low forever */
|
|
/*pinList.push({ pinName: "GPO8", displayName: "BISSC_CHANNEL2_TX_ENABLE", rx: false});*/
|
|
pinList.push({ pinName: "GPO12", displayName: "BISSC_CHANNEL2_TX", rx: false});
|
|
pinList.push({ pinName: "GPO6", displayName: "BISSC_CHANNEL2_CLK", rx: false});
|
|
pinList.push({ pinName: "GPI11", displayName: "BISSC_CHANNEL2_RX", rx: true});
|
|
|
|
return pinList;
|
|
}
|
|
|
|
function pinmuxRequirements(inst) {
|
|
|
|
let interfaceName = getInterfaceName(inst);
|
|
let pinList = getInterfacePinList(inst);
|
|
let resources = [];
|
|
|
|
for(let pin of pinList)
|
|
{
|
|
let pinResource = pinmux.getPinRequirements(interfaceName, pin.pinName, pin.displayName);
|
|
|
|
pinmux.setConfigurableDefault( pinResource, "rx", pin.rx );
|
|
|
|
resources.push( pinResource );
|
|
}
|
|
|
|
let peripheralRequirements = {
|
|
name: interfaceName,
|
|
displayName: interfaceName,
|
|
interfaceName: interfaceName,
|
|
resources: resources,
|
|
};
|
|
|
|
return [peripheralRequirements];
|
|
}
|
|
|
|
function getPeripheralPinNames(inst)
|
|
{
|
|
let pinList = [];
|
|
let pinNameList = [];
|
|
|
|
pinList = getInterfacePinList(inst);
|
|
|
|
for(let pin of pinList)
|
|
{
|
|
pinNameList.push( pin.pinName );
|
|
}
|
|
|
|
return pinNameList;
|
|
}
|
|
|
|
|
|
exports = {
|
|
|
|
pinmuxRequirements,
|
|
getInterfaceName,
|
|
getPeripheralPinNames,
|
|
};
|