Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BCMSAI] Update BCM SAI debian package to 4.2.1.3 (6.5.19 hsdk) #5532

Merged
merged 5 commits into from
Oct 6, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions platform/broadcom/sai-modules.mk
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Broadcom SAI modules

BRCM_OPENNSL_KERNEL_VERSION = 3.7.3.3-1
BRCM_OPENNSL_KERNEL_VERSION = 4.2.1.3-1

BRCM_OPENNSL_KERNEL = opennsl-modules_$(BRCM_OPENNSL_KERNEL_VERSION)_amd64.deb
$(BRCM_OPENNSL_KERNEL)_SRC_PATH = $(PLATFORM_PATH)/saibcm-modules
$(BRCM_OPENNSL_KERNEL)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON)
SONIC_DPKG_DEBS += $(BRCM_OPENNSL_KERNEL)

8 changes: 4 additions & 4 deletions platform/broadcom/sai.mk
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
BRCM_SAI = libsaibcm_3.7.5.1-3_amd64.deb
$(BRCM_SAI)_URL = "https://sonicstorage.blob.core.windows.net/packages/bcmsai/3.7/master/libsaibcm_3.7.5.1-3_amd64.deb?sv=2015-04-05&sr=b&sig=hwGt%2Fw1fWhauEsCXBTBmC3vC8G90iJT4DEp%2Bznwh4WY%3D&se=2034-04-16T01%3A02%3A17Z&sp=r"
BRCM_SAI_DEV = libsaibcm-dev_3.7.5.1-3_amd64.deb
BRCM_SAI = libsaibcm_4.2.1.3_amd64.deb
$(BRCM_SAI)_URL = "https://sonicstorage.blob.core.windows.net/packages/bcmsai/4.2/master/libsaibcm_4.2.1.3_amd64.deb?sv=2015-04-05&sr=b&sig=aA0Ltk2jteFuJZdr1ldj%2F5e6o7R0U5S%2FqVWvutPC7k0%3D&se=2021-08-31T04%3A08%3A35Z&sp=r"
BRCM_SAI_DEV = libsaibcm-dev_4.2.1.3_amd64.deb
$(eval $(call add_derived_package,$(BRCM_SAI),$(BRCM_SAI_DEV)))
$(BRCM_SAI_DEV)_URL = "https://sonicstorage.blob.core.windows.net/packages/bcmsai/3.7/master/libsaibcm-dev_3.7.5.1-3_amd64.deb?sv=2015-04-05&sr=b&sig=nuyZOMB%2BnmDIROP60UAiDl9eG0YHAEj6u8ViTlEqjf0%3D&se=2034-04-16T01%3A01%3A51Z&sp=r"
$(BRCM_SAI_DEV)_URL = "https://sonicstorage.blob.core.windows.net/packages/bcmsai/4.2/master/libsaibcm-dev_4.2.1.3_amd64.deb?sv=2015-04-05&sr=b&sig=r%2FWgs1VEFo07sbfYK%2FDZmk83QKTzwSSe%2F3%2BN3k3uAcY%3D&se=2022-01-30T22%3A55%3A04Z&sp=r"

SONIC_ONLINE_DEBS += $(BRCM_SAI)
$(BRCM_SAI_DEV)_DEPENDS += $(BRCM_SAI)
Expand Down
12 changes: 9 additions & 3 deletions platform/broadcom/saibcm-modules/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
opennsl (4.2.1.3-1) unstable; urgency=medium

* Update to Broadcom SAI 4.2.1.3

-- Mahesh Maddikayala <[email protected]> Fri, 18 Sep 2029 10:57:47 +0000

opennsl (3.7.3.3-1) unstable; urgency=medium

* Port Broadcom SAI 3.7.3.3
* Cherry-pick change from master branch, 3.7.3.3-1

-- Judy Joseph <[email protected]> Fri, 2 Dec 2019 15:32:47 +0000

opennsl (3.7.3.2-1) unstable; urgency=medium

* Port Broadcom SAI 3.7.3.2
* Cherry-pick change from master branch, 3.7.3.2-1

-- Judy Joseph <[email protected]> Fri, 12 Nov 2019 15:22:47 +0000

opennsl (3.7.3.1-1) unstable; urgency=medium

* Port Broadcom SAI 3.7.3.1
* Cherry-pick change from master branch, 3.7.3.1-1

Expand Down
31 changes: 22 additions & 9 deletions platform/broadcom/saibcm-modules/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ PACKAGE=opennsl-modules
# modifieable for experiments or debugging m-a
MA_DIR ?= /usr/share/modass
KVERSION ?= 4.19.0-9-2-amd64
KERNVERSION ?= 4.19.0-9-2

# load generic variable handling
-include $(MA_DIR)/include/generic.make
# load default rules, including kdist, kdist_image, ...
Expand Down Expand Up @@ -62,8 +64,8 @@ kdist_clean: clean
dh_testdir
dh_clean
SDK=$(realpath .) LINUX_UAPI_SPLIT=1 DEBIAN_LINUX_HEADER=1 BUILD_KNET_CB=1 BUILD_PSAMPLE=1 \
KERNDIR=/usr/src/linux-headers-$(KVERSION) \
KERNEL_SRC=/usr/src/linux-headers-$(KVERSION) \
KERNDIR=/usr/src/linux-headers-$(KERNVERSION)-common \
KERNEL_SRC=/usr/src/linux-headers-$(KERNVERSION)-amd64 \
$(MAKE) -C systems/linux/user/x86-smp_generic_64-2_6 clean
# rm -f driver/*.o driver/*.ko
#
Expand All @@ -78,21 +80,32 @@ configure-stamp:


build-arch: configure-stamp build-arch-stamp
build-arch-stamp:
build-arch-stamp:
dh_testdir

# create links
cd /; sudo mkdir -p /lib/modules/$(KERNVERSION)-amd64
cd /; sudo rm /lib/modules/$(KERNVERSION)-amd64/build
cd /; sudo rm /lib/modules/$(KERNVERSION)-amd64/source
cd /; sudo ln -s /usr/src/linux-headers-$(KERNVERSION)-common/ /lib/modules/$(KERNVERSION)-amd64/source
cd /; sudo ln -s /usr/src/linux-headers-$(KERNVERSION)-amd64/ /lib/modules/$(KERNVERSION)-amd64/build
cd /; sudo ln -s /usr/src/linux-headers-$(KERNVERSION)-amd64/include/generated/ /usr/src/linux-headers-$(KERNVERSION)-common/include/generated
cd /; sudo ln -s /usr/src/linux-headers-$(KERNVERSION)-amd64/arch/x86/include/generated/ /usr/src/linux-headers-$(KERNVERSION)-common/arch/x86/include/generated
cd /; sudo ln -s /usr/src/linux-headers-$(KERNVERSION)-amd64/include/config/ /usr/src/linux-headers-$(KERNVERSION)-common/include/config
cd /; sudo cp /usr/src/linux-headers-$(KERNVERSION)-amd64/Module.symvers /usr/src/linux-headers-$(KERNVERSION)-common/Module.symvers

# Add here command to compile/build the package.
SDK=$(realpath .) LINUX_UAPI_SPLIT=1 DEBIAN_LINUX_HEADER=1 BUILD_KNET_CB=1 BUILD_PSAMPLE=1 \
KERNDIR=/usr/src/linux-headers-$(KVERSION) \
KERNEL_SRC=/usr/src/linux-headers-$(KVERSION) \
KERNDIR=/usr/src/linux-headers-$(KERNVERSION)-common \
KERNEL_SRC=/usr/src/linux-headers-$(KERNVERSION)-amd64 \
$(MAKE) -C systems/linux/user/x86-smp_generic_64-2_6

touch $@

#k = $(shell echo $(KVERS) | grep -q ^2.6 && echo k)

build-indep: configure-stamp build-indep-stamp
build-indep-stamp:
build-indep-stamp:
dh_testdir

# Add here command to compile/build the arch indep package.
Expand All @@ -104,15 +117,15 @@ build-indep-stamp:

build: build-arch

clean:
clean:
dh_testdir
#dh_testroot
rm -f build-arch-stamp build-indep-stamp configure-stamp

# Add here commands to clean up after the build process.
SDK=$(realpath .) LINUX_UAPI_SPLIT=1 DEBIAN_LINUX_HEADER=1 BUILD_KNET_CB=1 BUILD_PSAMPLE=1 \
KERNDIR=/usr/src/linux-headers-$(KVERSION) \
KERNEL_SRC=/usr/src/linux-headers-$(KVERSION) \
KERNDIR=/usr/src/linux-headers-$(KERNVERSION)-common \
KERNEL_SRC=/usr/src/linux-headers-$(KERNVERSION)-amd64 \
$(MAKE) -C systems/linux/user/x86-smp_generic_64-2_6 clean

dh_clean
Expand Down
6 changes: 6 additions & 0 deletions platform/broadcom/saibcm-modules/include/ibde.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ typedef struct ibde_dev_s {
sal_vaddr_t base_address;
sal_vaddr_t base_address1;
sal_vaddr_t base_address2;
/* a unique number representing the specific device.
* Must be different for different devices.
* May be used to identify specific devices in the system.
* May be implemented as a full PCIe address, a persistent configurable user value, ...
* Possible implementation value stores in QSPI flash memory of the device. */
uint32 dev_unique_id;
} ibde_dev_t;


Expand Down
53 changes: 42 additions & 11 deletions platform/broadcom/saibcm-modules/include/kcom.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@
#define KCOM_M_DBGPKT_SET 41 /* Enbale debug packet function */
#define KCOM_M_DBGPKT_GET 42 /* Get debug packet function info */
#define KCOM_M_WB_CLEANUP 51 /* Clean up for warmbooting */
#define KCOM_M_CLOCK_CMD 52 /* Clock Commands */

#define KCOM_VERSION 10 /* Protocol version */
#define KCOM_VERSION 12 /* Protocol version */

/*
* Message status codes
Expand Down Expand Up @@ -138,11 +139,10 @@ typedef struct kcom_netif_s {
uint16 vlan;
uint16 qnum;
uint8 macaddr[6];
uint8 ptch[2];
uint8 itmh[4];
uint8 system_headers[KCOM_NETIF_SYSTEM_HEADERS_SIZE_MAX];
uint8 system_headers_size;
char name[KCOM_NETIF_NAME_MAX];
uint8 phys_port;
} kcom_netif_t;

/*
Expand Down Expand Up @@ -225,13 +225,9 @@ typedef struct kcom_filter_s {
uint8 b[KCOM_FILTER_BYTES_MAX];
uint32 w[KCOM_FILTER_WORDS_MAX];
} mask;
/** Information to parse Dune system headers */
uint32 ftmh_lb_key_ext_size;
uint32 ftmh_stacking_ext_size;
uint32 pph_base_size;
uint32 pph_lif_ext_size[8];
uint8 udh_enable;
uint32 udh_length_type[4];
/** Mark to match source modid and modport */
uint8 is_src_modport;
uint8 spa_unit;
} kcom_filter_t;

/*
Expand Down Expand Up @@ -338,6 +334,19 @@ typedef struct kcom_msg_version_s {
uint32 filter_max;
} kcom_msg_version_t;

/*
* Request KCOM interface clock info.
*/
#define KSYNC_M_HW_INIT 0
#define KSYNC_M_HW_DEINIT 1
#define KSYNC_M_VERSION 2
#define KSYNC_M_HW_TS_DISABLE 3

typedef struct kcom_clock_info_s {
uint8 cmd;
int32 data[8];
} kcom_clock_info_t;

/*
* Send literal string to/from kernel module.
* Mainly for debugging purposes.
Expand Down Expand Up @@ -386,6 +395,19 @@ typedef struct kcom_msg_hw_init_s {
uint8 pkt_hdr_size;
uint32 dma_hi;
uint32 cdma_channels;
/*
* Information to parse Dune system headers
*/
uint32 ftmh_lb_key_ext_size;
uint32 ftmh_stacking_ext_size;
uint32 pph_base_size;
uint32 pph_lif_ext_size[8];
uint32 udh_length_type[4];
uint32 udh_size;
uint32 oamp_punted;
uint8 no_skip_udh_check;
uint8 system_headers_mode;
uint8 udh_enable;
} kcom_msg_hw_init_t;

/*
Expand Down Expand Up @@ -445,6 +467,14 @@ typedef struct kcom_msg_netif_destroy_s {
kcom_msg_hdr_t hdr;
} kcom_msg_netif_destroy_t;

/*
* Destroy system network interface.
*/
typedef struct kcom_msg_clock_s{
kcom_msg_hdr_t hdr;
kcom_clock_info_t clock_info;
} kcom_msg_clock_cmd_t;

/*
* Get list of currently defined system network interfaces.
*/
Expand Down Expand Up @@ -486,7 +516,7 @@ typedef struct kcom_msg_filter_destroy_s {
* Get list of currently defined packet filters.
*/
#ifndef KCOM_FILTER_MAX
#define KCOM_FILTER_MAX 128
#define KCOM_FILTER_MAX 128
#endif

typedef struct kcom_msg_filter_list_s {
Expand Down Expand Up @@ -535,6 +565,7 @@ typedef union kcom_msg_s {
kcom_msg_dbg_pkt_set_t dbg_pkt_set;
kcom_msg_dbg_pkt_get_t dbg_pkt_get;
kcom_msg_wb_cleanup_t wb_cleanup;
kcom_msg_clock_cmd_t clock_cmd;
} kcom_msg_t;

/*
Expand Down
25 changes: 17 additions & 8 deletions platform/broadcom/saibcm-modules/include/sal/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,25 @@ typedef signed int int32; /* 32-bit quantity */

#define COUNTOF(ary) ((int) (sizeof (ary) / sizeof ((ary)[0])))

typedef uint32 sal_paddr_t; /* Physical address (PCI address) */

#ifdef PTRS_ARE_64BITS
typedef uint64 sal_vaddr_t; /* Virtual address (Host address) */
#define PTR_TO_INT(x) ((uint32)(((sal_vaddr_t)(x))&0xFFFFFFFF))
typedef uint64 sal_vaddr_t; /* Virtual address (Host address) */
typedef uint64 sal_paddr_t; /* Physical address (PCI address) */
#define PTR_TO_INT(x) ((uint32)(((sal_vaddr_t)(x))&0xFFFFFFFF))
#define PTR_HI_TO_INT(x) ((uint32)((((sal_vaddr_t)(x))>>32)&0xFFFFFFFF))
#else
typedef uint32 sal_vaddr_t; /* Virtual address (Host address) */
/* Physical address (PCI address) */
#ifdef PHYS_ADDRS_ARE_64BITS
typedef uint64 sal_paddr_t;
#define PTR_HI_TO_INT(x) ((uint32)((((uint64)(x))>>32)&0xFFFFFFFF))
#else
typedef uint32 sal_vaddr_t; /* Virtual address (Host address) */
#define PTR_TO_INT(x) ((uint32)(x))
typedef uint32 sal_paddr_t;
#define PTR_HI_TO_INT(x) (0)
#endif
#define PTR_TO_INT(x) ((uint32)(x))
#endif

#define INT_TO_PTR(x) ((void *)((sal_vaddr_t)(x)))
#define INT_TO_PTR(x) ((void *)((sal_vaddr_t)(x)))

#define PTR_TO_UINTPTR(x) ((sal_vaddr_t)(x))
#define UINTPTR_TO_PTR(x) ((void *)(x))
Expand All @@ -128,6 +136,7 @@ typedef union
#define SAL_I2C_DEV_TYPE 0x00040 /* I2C device */
#define SAL_AXI_DEV_TYPE 0x00080 /* AXI device */
#define SAL_EMMI_DEV_TYPE 0x10000 /* EMMI device */
#define SAL_COMPOSITE_DEV_TYPE 0x20000 /* Composite device, composed of sub-devices with buses */
#define SAL_DEV_BUS_TYPE_MASK 0xf00ff /* Odd for historical reasons */

/* Device types */
Expand All @@ -152,4 +161,4 @@ typedef union
/* Special access addresses */
#define SAL_DEV_OP_EMMI_INIT 0x0fff1000

#endif /* !_SAL_TYPES_H */
#endif /* !_SAL_TYPES_H */
Loading