The aim of this SoC porting guide is to guide SoC Vendors on how to port RDK to their platforms.
Step 1 : Get a board with Linux and drivers
RDK is based on Yocto Linux. Prior to porting RDK on an SoC, the precondition is to have the SoC platform running on Linux. The Linux version can be a SoC-specific one with kernel hardening and other OS optimizations specific to SoC, as RDK could easily run on top of vendor-specific Linux. SoC should also provide drivers for the other peripherals in the SoC platform, like WiFi, so that the unit can work independently and completely from an SoC point of view.
Step 2 : Move the build to Yocto, compare it to the supported Yocto version of RDK
Once the SoC vendor is ready with its own port of Linux + drivers for the SoC platform, it is time to migrate the platform to Yocto based builds. If the SoC is already having a Yocto based Linux, this step can be skipped. The current Yocto versions supported are Yocto 3.1- Dunfell ( preferred ) as well as Yocto 2.2- Morty ( soon to be deprecated )
Yocto 3.1 Upgradation support the following:
- Version upgrades for bitbake and other OE components
- Linux kernel 5.4 or above
- Extensible SDK
Each component in RDK is a standalone repository with its own individual build tools producing a library or set of binaries. When OE layers are upgraded to the newer versions, necessary changes need to be made in the RDK Yocto meta layers which use these components, to avoid build failures.
This is an important step while porting RDK to a new SoC platform. RDK Linux is built with considering particular build flags/features in the target platform( For example, RDK considers hardware floating point in the platform whereas some platforms are on software-based floating point ). SoC vendors need to analyze such flags in RDK and then make a comparison with the existing SoC platform Linux to ensure compatibility or to understand the required modifications in RDK code so as to house the compatibility changes
Specific DISTRO_FEATURES can be added to support the build-time flag for specific platforms. For example : DISTRO_FEATURES_append = " referencepltfm "
Depending on the Yocto version, the RDK build will be working with some particular version of Open source components. This might either be a dependency with the Yocto version compatibility as such or with RDK ( functionality or license issues ). If the SoC Linux has some version dependency on particular open source software and, if it conflicts with the version in RDK, the vendor needs to make required changes to make the open-source version match the RDK requirements as best as possible, by adding required patches in SoC platform
Check below layers for all open-sourced version packages recipes used in RDK. If multiple recipes with different versions are available, then check for the value of PREFFERED_VERSION_<recipe name> set.
Meta layers : - meta-openembedded, openembedded-core, meta-rdk-ext, meta-rdk, meta-cmf
For platform-specific recipes, keep them in the SoC meta-layer. While it is a good practice to start afresh with a new manifest for the target platform, a manifest file for a similar featured platform can be used as a starting point too. Check all device-specific repos in the reference manifest, and ensure corresponding device repos are created for this new device as needed, and update the manifest with these updated repos
- Create artifactory repo for the project with appropriate permissions for vendors. This is used for hosting any binaries required for the project
- Check-in SoC components - toolchain, SDK, kernel, drivers, etc.. to corresponding SoC Gerrit repos/ artifactory as applicable
- Populate meta SoC layer with the initial set of changes needed to build a kernel, SoC components, etc.
- If there is any SoC reference board exists, create a corresponding machine configuration in the SoC layer, and create an image target to be able to build a final image for the reference board. This layer should be separated out within the meta SoC layer from other common SoC, common chip sub-layers which will be usually used by the meta OEM layer as well.
- Populate meta OEM layer with machine configuration and other bare minimum changes required to generate a target image for OEM board.
- Machine configuration can be updated with the "NEEDED_BSPLAYERS" field to include required SoC, OEM layers in the build
- Any unwanted recipes during the early stage of bringing up can be masked using BBMASK if needed.
Step 6: Get a successful build
Add a platform-specific main recipe to create an image.
HAL implementation by SoC
Introduction
RDK-B components are designed to avoid platform or silicon dependencies. Hardware Abstraction Layer (HAL) defines a standard interface for hardware vendors to implement. The HAL layer abstracts the underlying hardware like MOCA, Wi-Fi, etc. through a standard set of APIs defined as part of RDK-B HAL for the respective components. This HAL layer is implemented per platform and the rest of the components can be compiled to run on the new platform without major modifications.
The HAL in RDK-B Architecture section gives an overview of CCSP framework's Hardware Abstraction Layer.
HAL can be common-HAL or component-specific-HAL. Components may define a component specific HAL to hardware drivers, that are only used by that component
Component Specific HAL
- HAL APIs will be available in the CMF repo path: "../rdkb/components/opensource/ccsp/hal/source/"
- PandM HAL Integration (back-end) Layer is also known as component specific HAL.
- This layer makes call to underlying Linux system calls/commands, third party modules, open source modules and other CCSP components to execute the requests.
- This layer will be more component specific and will be providing APIs to CCSP so as to manage a particular hardware module of the system.
- Following are some of the component specific HALs available in "../rdkb/components/opensource/ccsp/hal/source/" path.
- Wifi
- MoCA
- MTA Agent
- CM
- Ethernet Switch
- DHCPv4C
- Virtual LAN
- Firewall
- DPoE
- Bluetooth
- MSO_Management
- Voice
- WAN
- TR69_TLV
Wi-Fi HAL
All HAL functions prototypes and structure definitions are available in wifi_hal.h file.
MOCA HAL
All HAL functions prototypes and structure definitions are available in moca_hal.h file.
- MoCA HAL is used for the RDK-Broadband MoCA hardware abstraction layer.
- An abstraction layer, mainly for interacting with MoCA driver.
- The APIs are :
- moca_GetIfConfig
- moca_SetIfConfig
- moca_IfGetDynamicInfo
- moca_IfGetStaticInfo
- moca_IfGetStats
- moca_GetNumAssociatedDevices
- moca_IfGetExtCounter
- moca_IfGetExtAggrCounter
- moca_GetMocaCPEs
- moca_GetAssociatedDevices
- moca_FreqMaskToValue
- moca_HardwareEquipped
- moca_GetFullMeshRates
- moca_GetFlowStatistics
- moca_GetResetCount
- moca_setIfAcaConfig
- moca_getIfAcaConfig
- moca_cancelIfAca
- moca_getIfAcaStatus
- moca_getIfScmod
- To see the API specification of MoCA HAL please refer - MoCA HAL APIs
MTA HAL
All HAL functions prototypes and structure definitions are available in mta_hal.h file. An MTA can deliver Home Phone service in addition to High Speed Internet.
- MTA HAL used for the RDK-Broadband hardware abstraction layer for Cable Modem.
- An abstraction layer, implemented to interact with MTA device.
- mta_hal.c file provides the function call prototypes and structure definitions used for the MTA hardware abstraction layer.
- Some of the APIs are :
- mta_hal_InitDB
- mta_hal_GetDHCPInfo
- mta_hal_LineTableGetNumberOfEntries
- mta_hal_LineTableGetEntry
- mta_hal_TriggerDiagnostics
- mta_hal_GetServiceFlow
- mta_hal_DectGetEnable
- mta_hal_DectSetEnable.
- mta_hal_DectGetRegistrationMode
- mta_hal_DectSetRegistrationMode
- mta_hal_DectDeregisterDectHandset
- mta_hal_GetCalls
- mta_hal_GetDect
- mta_hal_GetDectPIN
- mta_hal_SetDectPIN
- mta_hal_GetHandsets
- mta_hal_GetCALLP
- mta_hal_GetDSXLogs
- mta_hal_GetDSXLogEnable
- mta_hal_SetDSXLogEnable
- To see the API specification of MTA HAL please refer - MTA HAL APIs
CM HAL
All HAL functions prototypes and structure definitions are available in cm_hal.h file.
- CM HAL is used for the RDK-Broadband hardware abstraction layer for Cable Modem.
- It provides interface that cable modem software developers can use to interface to RDK-B.
- Some of the APIs are :
- cm_hal_InitDB
- docsis_InitDS
- docsis_InitUS
- docsis_getCMStatus
- docsis_GetDSChannel
- docsis_GetUsStatus
- docsis_GetUSChannel
- docsis_GetDOCSISInfo
- docsis_GetNumOfActiveTxChannels
- docsis_GetNumOfActiveRxChannels
- docsis_GetErrorCodewords
- docsis_SetMddIpModeOverride
- docsis_GetMddIpModeOverride
- docsis_GetUSChannelId
- docsis_SetUSChannelId
- docsis_GetDownFreq
- docsis_SetStartFreq
- docsis_GetDocsisEventLogItems
- cm_hal_GetDHCPInfo
- cm_hal_GetCPEList
- To see the API specification of CM HAL please refer - CM HAL APIs
Ethernet Switch HAL
All HAL functions prototypes and structure definitions are available in ccsp_hal_ethsw.h file.
- It provides implementation for Ethernet Switch Control.
- Based on how vendor exposes their driver capabilities in user space, the HAL API’s can be implemented in hal-ethsw-generic/git/source/ethsw/ccsp_hal_ethsw.c
- The APIs are :
- CcspHalEthSwInit
- CcspHalEthSwGetPortStatus
- CcspHalEthSwGetPortCfg
- CcspHalEthSwSetPortCfg
- CcspHalEthSwGetPortAdminStatus
- CcspHalEthSwSetPortAdminStatus
- CcspHalEthSwSetAgingSpeed
- CcspHalEthSwLocatePortByMacAddress
- CcspHalExtSw_getAssociatedDevice
- CcspHalExtSw_ethAssociatedDevice_callback_register
- CcspHalExtSw_getEthWanEnable
- CcspHalExtSw_setEthWanEnable
- CcspHalExtSw_getEthWanPort
- CcspHalExtSw_setEthWanPort
- GWP_RegisterEthWan_Callback
- GWP_GetEthWanLinkStatus
- GWP_GetEthWanInterfaceName
DHCPv4C HAL
All HAL functions prototypes and structure definitions are available in dhcpv4c_api.h file.
- DHCPv4C HAL is used for the RDK-B DHCPv4 Client Status abstraction layer.
- DHCPv4C HAL API's functionality should be implemented by OEMs.
- dhcpv4c_api.c provides the function call prototypes and structure definitions used for the RDK-Broadband DHCPv4 Client Status abstraction layer.
- Some of the APIs are :
- dhcpv4c_get_ert_lease_time
- dhcpv4c_get_ert_remain_lease_time
- dhcpv4c_get_ert_remain_renew_time
- dhcpv4c_get_ert_remain_rebind_time
- dhcpv4c_get_ert_config_attempts
- dhcpv4c_get_ert_ifname
- dhcpv4c_get_ert_fsm_state
- dhcpv4c_get_ert_ip_addr
- dhcpv4c_get_ert_mask
- dhcpv4c_get_ert_gw
- dhcpv4c_get_ert_dns_svrs
- dhcpv4c_get_ert_dhcp_svr
- dhcpv4c_get_ecm_lease_time
- dhcpv4c_get_ecm_remain_lease_time
- dhcpv4c_get_ecm_remain_renew_time
- dhcpv4c_get_ecm_remain_rebind_time
- dhcpv4c_get_ecm_config_attempts
- dhcpv4c_get_ecm_ifname
- dhcpv4c_get_ecm_fsm_state
- dhcpv4c_get_ecm_ip_addr
- To see the API specification of DHCPv4C HAL please refer - DHCPv4C HAL APIs
VLAN HAL
All HAL functions prototypes and structure definitions are available in vlan_hal.h file.
- VLAN HAL is or the RDK-B Broadband VLAN abstraction layer.
- VLAN HAL layer is intended to support VLAN drivers through the System Calls.
- The APIs are :
- vlan_hal_addGroup
- vlan_hal_delGroup
- vlan_hal_addInterface
- vlan_hal_delInterface
- vlan_hal_printGroup
- vlan_hal_printAllGroup
- vlan_hal_delete_all_Interfaces
- _is_this_group_available_in_linux_bridge
- _is_this_interface_available_in_linux_bridge
- _is_this_interface_available_in_given_linux_bridge
- _get_shell_outputbuffer
- insert_VLAN_ConfigEntry
- delete_VLAN_ConfigEntry
- get_vlanId_for_GroupName
- print_all_vlanId_Configuration
- To see the API specification of VLAN HAL please refer - VLAN HAL APIs
Firewall HAL
All HAL functions prototypes and structure definitions are available in hal_firewall.h file.
- This module is responsible for setting firewall rules like port forwarding, port triggering Parental control etc.
- Some of the APIs are :
- firewall_service_init
- firewall_service_start
- firewall_service_restart
- firewall_service_stop
- firewall_service_close
- GetHttpPortValue
- Wan2lan_log_deletion_setup
- Wan2lan_log_insertion_setup
- GettingWanIP_remotemgmt_deletion_logsetup
- GettingWanIP_remotemgmt_insertion_logsetup
- DeleteRemoteManagementIptablesRules
- AddRemoteManagementIptablesRules
- DisablingHttps
- EnablingHttps
- DisablingHttp
- EnablingHttp
- SetHttpPort
- SetHttpsPort
- RemoteManagementiptableRulessetoperation
- BasicRouting_Wan2Lan_SetupConnection
DPOE HAL
All HAL functions prototypes and structure definitions are available in dpoe_hal.h file.
- DPOE HAL is used for the RDK-Broadband DPoE hardware abstraction layer as per the DPoE-SP-OAMv1.0-I08-140807 specification.
- Some of the APIs are :
- dpoe_getOnuId
- dpoe_getFirmwareInfo
- dpoe_getEponChipInfo
- dpoe_getManufacturerInfo
- dpoe_getNumberOfNetworkPorts
- dpoe_getNumberOfS1Interfaces
- dpoe_getOnuPacketBufferCapabilities
- dpoe_getOamFrameRate
- dpoe_getLlidForwardingState
- dpoe_getDeviceSysDescrInfo
- dpoe_getMaxLogicalLinks
- dpoe_setResetOnu
- dpoe_getStaticMacTable
- dpoe_getEponMode
- dpoe_getDynamicMacAddressAgeLimit
- dpoe_getDynamicMacLearningTableSize
- dpoe_getDynamicMacTable
- dpoe_getStaticMacTable
- dpoe_getMacLearningAggregateLimit
- dpoe_getOnuLinkStatistics
- To see the API specification of DPOE HAL please refer - DPOE HAL APIs
Bluetooth HAL
All HAL functions prototypes and structure definitions are available in bt_hal.h file.
- The APIs are :
- ble_Enable
- ble_GetStatus
- To see the API specification of Bluetooth HAL please refer - Bluetooth HAL APIs
MSO Management HAL
All HAL functions prototypes and structure definitions are available in mso_mgmt_hal.h file.
- MSO Management HAL is used for the RDK-Broadband hardware abstraction layer for MSO Management.
- The APIs are :
- mso_pwd_ret_status mso_validatepwd
- mso_set_pod_seed
- mso_get_pod_seed
- To see the API specification of MSO Management HAL please refer - MSO Management HAL APIs
Voice HAL
All HAL functions prototypes and structure definitions are available in voice_hal.h file.
- Voice HAL is used for the RDK-Broadband hardware abstraction layer for VoIP.
- Some of the APIs are :
- voice_hal_Init
- voice_hal_InitDB
- voice_hal_Deinit
- voice_hal_DeinitDB
- voice_hal_setVoiceProcessState
- voice_hal_getVoiceProcessState
- voice_hal_getVoiceProcessStatus
- voice_hal_getConfigSoftwareVersion
- voice_hal_getCountProfiles
- voice_hal_getServiceVersion
- voice_hal_getCountServices
- voice_hal_getCountLines
- voice_hal_getCountPhyInterfaces
- voice_hal_setIpAddressFamily
- voice_hal_getBoundIfName
- voice_hal_setBoundIfName
- voice_hal_setIpAddressFamily
- voice_hal_getIpAddressFamily
- voice_hal_setLinkState
- voice_hal_setIpWanAddress
- To see the API specification of Voice HAL please refer - Voice HAL APIs
WAN HAL
All HAL functions prototypes and structure definitions are available in wan_hal.h file.
- The APIs are :
- wan_hal_Init
- wan_hal_SetSelfHealConfig
- wan_hal_SetWanConnectionEnable
- wan_hal_SetSelfHealConfig
- wan_hal_GetWanOEUpstreamCurrRate
- wan_hal_GetWanOEDownstreamCurrRate
- wan_hal_SetQoSConfiguration
- wan_hal_RestartWanService
- To see the API specification of WAN HAL please refer - WAN HAL APIs
TR69_TLV HAL
All HAL functions prototypes and structure definitions are available in Tr69_Tlv.h file.
- Telemetry Key fields and data fields are stored in the database as TLV (Tag, Length, Value)
- Tag - uniquely identifies the field.
- Length - gives the size (in number of bytes) of the data associated with the field.
- Value - contains the actual data associated with the field stored in network byte ordering.
Common HAL
- A common HAL provides the necessary abstraction to all the CCSP components to interface with other common hardware components.
- Eg : Platform HAL
- Platform HAL is an abstraction layer, implemented to interact with cable modem device for getting the hardware specific details such as Firmware Name, Boot loader Version, etc.
- This HAL layer is intended to support platform drivers
- platform_hal.c file provides the function call prototypes and structure definitions used for the platform hardware abstraction layer
- Some of the APIs are :
- platform_hal_GetDeviceConfigStatus
- platform_hal_GetTelnetEnable
- platform_hal_GetSSHEnable
- platform_hal_SetSSHEnable
- platform_hal_GetSNMPEnable
- platform_hal_SetSNMPEnable
- platform_hal_GetSerialNumber
- platform_hal_GetWebUITimeout
- platform_hal_SetWebUITimeout
- platform_hal_GetWebAccessLevel
- platform_hal_SetWebAccessLevel
- platform_hal_PandMDBInit
- platform_hal_DocsisParamsDBInit
- platform_hal_GetModelName
- platform_hal_GetFirmwareName
- platform_hal_GetHardwareVersion
- platform_hal_GetSoftwareVersion
- platform_hal_GetBootloaderVersion
- platform_hal_GetBaseMacAddress
- platform_hal_GetHardware
To see the API specification of Platform HAL please refer - Platform HAL APIs
1 Comment
Akhil Sartho
Hi Ashraf,
I am having a Yocto Linux code base of specific board with kernel version 4.14. I am planning to integrate RDK-B Kirkstone release with the code base. Specifically bringing BSP layer of board in to RDK-B Kirkstone Raspberry Pi release. Will this older kernel version can cause integration issues ?