Merge pull request #2329 from yxieca/pub-3.3

[bcm SAI] enable Broadcom SAI 3.3 GA release
This commit is contained in:
lguohan 2018-12-01 23:58:16 -08:00 committed by GitHub
commit 5d78dd0db3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
83 changed files with 4054 additions and 1695 deletions

View File

@ -1,9 +1,9 @@
BRCM_SAI = libsaibcm_3.1.3.5-12_amd64.deb BRCM_SAI = libsaibcm_3.3.3.1-1_amd64.deb
$(BRCM_SAI)_URL = "https://sonicstorage.blob.core.windows.net/packages/bcmsai/libsaibcm_3.1.3.5-12_amd64.deb?sv=2015-04-05&sr=b&sig=6%2Fwcn0EN0krkXMCeOpAgo4N2d%2FgiZJAuU%2FwYhaXNpBE%3D&se=2032-08-07T16%3A57%3A37Z&sp=r" $(BRCM_SAI)_URL = "https://sonicstorage.blob.core.windows.net/packages/bcmsai/3.3/libsaibcm_3.3.3.1-1_amd64.deb?sv=2015-04-05&sr=b&sig=Kp6Pjrvt9DD8fThhSjzDJNuVRYuW6aLwi2bgegM0hd8%3D&se=2032-08-09T02%3A22%3A31Z&sp=r"
BRCM_SAI_DEV = libsaibcm-dev_3.1.3.5-12_amd64.deb BRCM_SAI_DEV = libsaibcm-dev_3.3.3.1-1_amd64.deb
$(eval $(call add_derived_package,$(BRCM_SAI),$(BRCM_SAI_DEV))) $(eval $(call add_derived_package,$(BRCM_SAI),$(BRCM_SAI_DEV)))
$(BRCM_SAI_DEV)_URL = "https://sonicstorage.blob.core.windows.net/packages/bcmsai/libsaibcm-dev_3.1.3.5-12_amd64.deb?sv=2015-04-05&sr=b&sig=9Tf4Rm0Hftx9IavbLmV6PzsxzejuUzwCRFKNmU2pAkU%3D&se=2032-08-07T16%3A57%3A08Z&sp=r" $(BRCM_SAI_DEV)_URL = "https://sonicstorage.blob.core.windows.net/packages/bcmsai/3.3/libsaibcm-dev_3.3.3.1-1_amd64.deb?sv=2015-04-05&sr=b&sig=fTWUp3gOcNQNT9sS66CSEyP0JkSlPHNRlsvG4L64I0g%3D&se=2032-08-09T02%3A22%3A08Z&sp=r"
SONIC_ONLINE_DEBS += $(BRCM_SAI) SONIC_ONLINE_DEBS += $(BRCM_SAI)
$(BRCM_SAI_DEV)_DEPENDS += $(BRCM_SAI) $(BRCM_SAI_DEV)_DEPENDS += $(BRCM_SAI)

View File

@ -12,35 +12,61 @@
# Short-Description: Load OpenNSL kernel modules # Short-Description: Load OpenNSL kernel modules
### END INIT INFO ### END INIT INFO
function create_devices()
{
rm -f /dev/linux-knet-cb
rm -f /dev/linux-bcm-knet
rm -f /dev/linux-bcm-bde
rm -f /dev/linux-kernel-bde
mknod /dev/linux-knet-cb c 121 0
mknod /dev/linux-bcm-knet c 122 0
mknod /dev/linux-bcm-bde c 126 0
mknod /dev/linux-kernel-bde c 127 0
}
function load_kernel_modules()
{
modprobe linux-kernel-bde dmasize=32M maxpayload=128
modprobe linux-user-bde
modprobe linux-bcm-knet use_rx_skb=1 rx_buffer_size=9238
modprobe linux-knet-cb
}
function remove_kernel_modules()
{
rmmod linux-knet-cb
rmmod linux-bcm-knet
rmmod linux-user-bde
rmmod linux-kernel-bde
}
case "$1" in case "$1" in
start) start)
echo -n "Load OpenNSL kernel modules... " echo -n "Load OpenNSL kernel modules... "
modprobe linux-kernel-bde dmasize=32M maxpayload=128 create_devices
modprobe linux-user-bde load_kernel_modules
modprobe linux-bcm-knet use_rx_skb=1 rx_buffer_size=9238
echo "done." echo "done."
;; ;;
stop) stop)
echo -n "Unload OpenNSL kernel modules... " echo -n "Unload OpenNSL kernel modules... "
rmmod linux-bcm-knet remove_kernel_modules
rmmod linux-user-bde
rmmod linux-kernel-bde
echo "done." echo "done."
;; ;;
force-reload|restart) force-reload|restart)
echo "Not supported" echo "Not supported"
;; ;;
*) *)
echo "Usage: /etc/init.d/opennsl-modules-4.9.0-7-amd64.init {start|stop}" echo "Usage: /etc/init.d/opennsl-modules-4.9.0-7-amd64.init {start|stop}"
exit 1 exit 1
;; ;;
esac esac
exit 0 exit 0

View File

@ -1,4 +1,5 @@
systems/linux/user/x86-smp_generic_64-2_6/linux-bcm-knet.ko lib/modules/4.9.0-7-amd64/extra systems/linux/user/x86-smp_generic_64-2_6/linux-bcm-knet.ko lib/modules/4.9.0-7-amd64/extra
systems/linux/user/x86-smp_generic_64-2_6/linux-kernel-bde.ko lib/modules/4.9.0-7-amd64/extra systems/linux/user/x86-smp_generic_64-2_6/linux-kernel-bde.ko lib/modules/4.9.0-7-amd64/extra
systems/linux/user/x86-smp_generic_64-2_6/linux-user-bde.ko lib/modules/4.9.0-7-amd64/extra systems/linux/user/x86-smp_generic_64-2_6/linux-user-bde.ko lib/modules/4.9.0-7-amd64/extra
systems/linux/user/x86-smp_generic_64-2_6/linux-knet-cb.ko lib/modules/4.9.0-7-amd64/extra
systemd/opennsl-modules-4.9.0-7-amd64.service lib/systemd/system systemd/opennsl-modules-4.9.0-7-amd64.service lib/systemd/system

View File

@ -60,7 +60,7 @@ kdist_config: prep-deb-files
kdist_clean: clean kdist_clean: clean
dh_testdir dh_testdir
dh_clean dh_clean
SDK=$(realpath .) LINUX_UAPI_SPLIT=1 DEBIAN_LINUX_HEADER=1 KERNDIR=/usr/src/linux-headers-4.9.0-7-amd64 KERNEL_SRC=/usr/src/linux-headers-4.9.0-7-amd64 $(MAKE) -C systems/linux/user/x86-smp_generic_64-2_6 clean SDK=$(realpath .) LINUX_UAPI_SPLIT=1 DEBIAN_LINUX_HEADER=1 BUILD_KNET_CB=1 KERNDIR=/usr/src/linux-headers-4.9.0-7-amd64 KERNEL_SRC=/usr/src/linux-headers-4.9.0-7-amd64 $(MAKE) -C systems/linux/user/x86-smp_generic_64-2_6 clean
# rm -f driver/*.o driver/*.ko # rm -f driver/*.o driver/*.ko
# #
### end KERNEL SETUP ### end KERNEL SETUP
@ -78,7 +78,7 @@ build-arch-stamp:
dh_testdir dh_testdir
# Add here command to compile/build the package. # Add here command to compile/build the package.
SDK=$(realpath .) LINUX_UAPI_SPLIT=1 DEBIAN_LINUX_HEADER=1 KERNDIR=/usr/src/linux-headers-4.9.0-7-amd64 KERNEL_SRC=/usr/src/linux-headers-4.9.0-7-amd64 $(MAKE) -C systems/linux/user/x86-smp_generic_64-2_6 SDK=$(realpath .) LINUX_UAPI_SPLIT=1 DEBIAN_LINUX_HEADER=1 BUILD_KNET_CB=1 KERNDIR=/usr/src/linux-headers-4.9.0-7-amd64 KERNEL_SRC=/usr/src/linux-headers-4.9.0-7-amd64 $(MAKE) -C systems/linux/user/x86-smp_generic_64-2_6
touch $@ touch $@
@ -103,7 +103,7 @@ clean:
rm -f build-arch-stamp build-indep-stamp configure-stamp rm -f build-arch-stamp build-indep-stamp configure-stamp
# Add here commands to clean up after the build process. # Add here commands to clean up after the build process.
SDK=$(realpath .) LINUX_UAPI_SPLIT=1 DEBIAN_LINUX_HEADER=1 KERNDIR=/usr/src/linux-headers-4.9.0-7-amd64 KERNEL_SRC=/usr/src/linux-headers-4.9.0-7-amd64 $(MAKE) -C systems/linux/user/x86-smp_generic_64-2_6 clean SDK=$(realpath .) LINUX_UAPI_SPLIT=1 DEBIAN_LINUX_HEADER=1 BUILD_KNET_CB=1 KERNDIR=/usr/src/linux-headers-4.9.0-7-amd64 KERNEL_SRC=/usr/src/linux-headers-4.9.0-7-amd64 $(MAKE) -C systems/linux/user/x86-smp_generic_64-2_6 clean
dh_clean dh_clean

View File

@ -1,18 +1,17 @@
/* /*
* Unless you and Broadcom execute a separate written software license * Copyright 2017 Broadcom
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
* *
* As a special exception, the copyright holders of this software give * This program is free software; you can redistribute it and/or modify
* you permission to link this software with independent modules, and to * it under the terms of the GNU General Public License, version 2, as
* copy and distribute the resulting executable under terms of your * published by the Free Software Foundation (the "GPL").
* choice, provided that you also meet, for each linked independent *
* module, the terms and conditions of the license of that module. An * This program is distributed in the hope that it will be useful, but
* independent module is a module which is not derived from this * WITHOUT ANY WARRANTY; without even the implied warranty of
* software. The special exception does not apply to any modifications * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* of the software. * General Public License version 2 (GPLv2) for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 (GPLv2) along with this source code.
*/ */
/* /*
* $Id: ibde.h,v 1.27 Broadcom SDK $ * $Id: ibde.h,v 1.27 Broadcom SDK $
@ -83,6 +82,7 @@ typedef struct ibde_s {
#define BDE_BYTE_SWAP 0x01000000 /* SW byte swap */ #define BDE_BYTE_SWAP 0x01000000 /* SW byte swap */
#define BDE_NO_IPROC 0x02000000 /* Device uses two BARs, but is not iProc */ #define BDE_NO_IPROC 0x02000000 /* Device uses two BARs, but is not iProc */
#define BDE_8MB_REG_SPACE 0x10000000 /* 8MB sized CMIC BAR */
#define BDE_256K_REG_SPACE 0x20000000 /* Map 256K (v 64K) */ #define BDE_256K_REG_SPACE 0x20000000 /* Map 256K (v 64K) */
#define BDE_128K_REG_SPACE 0x40000000 /* Map 128K (v 64K) */ #define BDE_128K_REG_SPACE 0x40000000 /* Map 128K (v 64K) */
#define BDE_320K_REG_SPACE 0x80000000 /* Map 256K+64K */ #define BDE_320K_REG_SPACE 0x80000000 /* Map 256K+64K */

View File

@ -1,26 +1,25 @@
/* /*
* Unless you and Broadcom execute a separate written software license * Copyright 2017 Broadcom
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
* *
* As a special exception, the copyright holders of this software give * This program is free software; you can redistribute it and/or modify
* you permission to link this software with independent modules, and to * it under the terms of the GNU General Public License, version 2, as
* copy and distribute the resulting executable under terms of your * published by the Free Software Foundation (the "GPL").
* choice, provided that you also meet, for each linked independent *
* module, the terms and conditions of the license of that module. An * This program is distributed in the hope that it will be useful, but
* independent module is a module which is not derived from this * WITHOUT ANY WARRANTY; without even the implied warranty of
* software. The special exception does not apply to any modifications * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* of the software. * General Public License version 2 (GPLv2) for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 (GPLv2) along with this source code.
*/ */
/* /*
* $Id: kcom.h,v 1.9 Broadcom SDK $ * $Id: kcom.h,v 1.9 Broadcom SDK $
* $Copyright: (c) 2005 Broadcom Corp. * $Copyright: (c) 2005 Broadcom Corp.
* All Rights Reserved.$ * All Rights Reserved.$
* *
* File: kcom.h * File: kcom.h
* Purpose: User/Kernel message definitions * Purpose: User/Kernel message definitions
*/ */
#ifndef _KCOM_H #ifndef _KCOM_H
@ -37,7 +36,6 @@
#define KCOM_MSG_TYPE_RSP 2 /* Command response */ #define KCOM_MSG_TYPE_RSP 2 /* Command response */
#define KCOM_MSG_TYPE_EVT 3 /* Unsolicited event */ #define KCOM_MSG_TYPE_EVT 3 /* Unsolicited event */
/* /*
* Message opcodes * Message opcodes
*/ */
@ -57,10 +55,11 @@
#define KCOM_M_FILTER_LIST 23 /* Get list of Rx filter IDs */ #define KCOM_M_FILTER_LIST 23 /* Get list of Rx filter IDs */
#define KCOM_M_FILTER_GET 24 /* Get Rx filter info */ #define KCOM_M_FILTER_GET 24 /* Get Rx filter info */
#define KCOM_M_DMA_INFO 31 /* Tx/Rx DMA info */ #define KCOM_M_DMA_INFO 31 /* Tx/Rx DMA info */
#define KCOM_M_DBGPKT_SET 41 /* Enbale debug packet function */ #define KCOM_M_DBGPKT_SET 41 /* Enbale debug packet function */
#define KCOM_M_DBGPKT_GET 42 /* Get debug packet function info */ #define KCOM_M_DBGPKT_GET 42 /* Get debug packet function info */
#define KCOM_M_WB_CLEANUP 51 /* Clean up for warmbooting */
#define KCOM_VERSION 8 /* Protocol version */ #define KCOM_VERSION 9 /* Protocol version */
/* /*
* Message status codes * Message status codes
@ -80,7 +79,6 @@ typedef struct kcom_msg_hdr_s {
uint16 id; uint16 id;
} kcom_msg_hdr_t; } kcom_msg_hdr_t;
/* /*
* Object types * Object types
*/ */
@ -267,44 +265,40 @@ typedef struct kcom_dma_info_s {
uint16 chan; uint16 chan;
uint16 flags; uint16 flags;
union { union {
void *p; uint64 dcb_start;
uint8 b[8];
} cookie;
union {
uint32 dcb_start;
struct { struct {
uint32 tx; uint32 tx;
uint32 rx; uint32 rx;
} seqno; } seqno;
} data; } data;
union {
void *p;
uint8 b[8];
} cookie;
} kcom_dma_info_t; } kcom_dma_info_t;
/* Default channel configuration */ /* Default channel configuration */
#define KCOM_DMA_TX_CHAN 0 #define KCOM_DMA_TX_CHAN 0
#define KCOM_DMA_RX_CHAN 1 #define KCOM_DMA_RX_CHAN 1
#define KCOM_ETH_HW_T_RESET 1 #define KCOM_ETH_HW_T_RESET 1
#define KCOM_ETH_HW_T_INIT 2 #define KCOM_ETH_HW_T_INIT 2
#define KCOM_ETH_HW_T_OTHER 3 #define KCOM_ETH_HW_T_OTHER 3
#define KCOM_ETH_HW_C_ALL 0xff #define KCOM_ETH_HW_C_ALL 0xff
#define KCOM_ETH_HW_RESET_F_TX (1U << 0)
#define KCOM_ETH_HW_RESET_F_RX (1U << 1)
#define KCOM_ETH_HW_RESET_F_TX_RECLAIM (1U << 2)
#define KCOM_ETH_HW_RESET_F_RX_RECLAIM (1U << 3)
#define KCOM_ETH_HW_INIT_F_TX (1U << 0)
#define KCOM_ETH_HW_INIT_F_RX (1U << 1)
#define KCOM_ETH_HW_INIT_F_RX_FILL (1U << 2)
#define KCOM_ETH_HW_OTHER_F_FIFO_LOOPBACK (1U << 0)
#define KCOM_ETH_HW_OTHER_F_INTERRUPT (1U << 1)
#define KCOM_ETH_HW_RESET_F_TX (1U << 0)
#define KCOM_ETH_HW_RESET_F_RX (1U << 1)
#define KCOM_ETH_HW_RESET_F_TX_RECLAIM (1U << 2)
#define KCOM_ETH_HW_RESET_F_RX_RECLAIM (1U << 3)
#define KCOM_ETH_HW_INIT_F_TX (1U << 0)
#define KCOM_ETH_HW_INIT_F_RX (1U << 1)
#define KCOM_ETH_HW_INIT_F_RX_FILL (1U << 2)
#define KCOM_ETH_HW_OTHER_F_FIFO_LOOPBACK (1U << 0)
#define KCOM_ETH_HW_OTHER_F_INTERRUPT (1U << 1)
typedef struct kcom_eth_hw_config_s { typedef struct kcom_eth_hw_config_s {
uint8 type; uint8 type;
@ -339,7 +333,6 @@ typedef struct kcom_msg_string_s {
char val[KCOM_MSG_STRING_MAX]; char val[KCOM_MSG_STRING_MAX];
} kcom_msg_string_t; } kcom_msg_string_t;
/* /*
* Indicate that eth hardware is about to be reset. Active * Indicate that eth hardware is about to be reset. Active
* DMA operations should be aborted and DMA and interrupts * DMA operations should be aborted and DMA and interrupts
@ -354,7 +347,6 @@ typedef struct kcom_msg_eth_hw_config_s {
kcom_eth_hw_config_t config; kcom_eth_hw_config_t config;
} kcom_msg_eth_hw_config_t; } kcom_msg_eth_hw_config_t;
/* /*
* Indicate that switch hardware is about to be reset. Active * Indicate that switch hardware is about to be reset. Active
* DMA operations should be aborted and DMA and interrupts * DMA operations should be aborted and DMA and interrupts
@ -371,8 +363,11 @@ typedef struct kcom_msg_hw_reset_s {
*/ */
typedef struct kcom_msg_hw_init_s { typedef struct kcom_msg_hw_init_s {
kcom_msg_hdr_t hdr; kcom_msg_hdr_t hdr;
uint16 dcb_size; uint8 cmic_type;
uint16 dcb_type; uint8 dcb_type;
uint8 dcb_size;
uint8 pkt_hdr_size;
uint32 dma_hi;
uint32 cdma_channels; uint32 cdma_channels;
} kcom_msg_hw_init_t; } kcom_msg_hw_init_t;
@ -400,6 +395,14 @@ typedef struct kcom_msg_dbg_pkt_get_s {
int value; int value;
} kcom_msg_dbg_pkt_get_t; } kcom_msg_dbg_pkt_get_t;
/*
* Clean up warmboot-related resources.
*/
typedef struct kcom_msg_wb_cleanup_s {
kcom_msg_hdr_t hdr;
uint32 flags;
} kcom_msg_wb_cleanup_t;
/* /*
* Create new system network interface. The network interface will * Create new system network interface. The network interface will
* be associated with the specified switch unit number. * be associated with the specified switch unit number.
@ -458,8 +461,8 @@ typedef struct kcom_msg_filter_destroy_s {
* Get list of currently defined packet filters. * Get list of currently defined packet filters.
*/ */
#ifndef KCOM_FILTER_MAX #ifndef KCOM_FILTER_MAX
/* OPENNSL_FIXUP - Increased the filters to 1024 from 128 */ /* SAI_FIXUP - Increased the filters to 1024 from 128 */
#define KCOM_FILTER_MAX 1024 #define KCOM_FILTER_MAX 1024
#endif #endif
typedef struct kcom_msg_filter_list_s { typedef struct kcom_msg_filter_list_s {
@ -484,11 +487,9 @@ typedef struct kcom_msg_dma_info_s {
kcom_dma_info_t dma_info; kcom_dma_info_t dma_info;
} kcom_msg_dma_info_t; } kcom_msg_dma_info_t;
/* /*
* All messages (e.g. for generic receive) * All messages (e.g. for generic receive)
*/ */
typedef union kcom_msg_s { typedef union kcom_msg_s {
kcom_msg_hdr_t hdr; kcom_msg_hdr_t hdr;
kcom_msg_version_t version; kcom_msg_version_t version;
@ -508,9 +509,9 @@ typedef union kcom_msg_s {
kcom_msg_dma_info_t dma_info; kcom_msg_dma_info_t dma_info;
kcom_msg_dbg_pkt_set_t dbg_pkt_set; kcom_msg_dbg_pkt_set_t dbg_pkt_set;
kcom_msg_dbg_pkt_get_t dbg_pkt_get; kcom_msg_dbg_pkt_get_t dbg_pkt_get;
kcom_msg_wb_cleanup_t wb_cleanup;
} kcom_msg_t; } kcom_msg_t;
/* /*
* KCOM communication channel vectors * KCOM communication channel vectors
* *
@ -538,4 +539,4 @@ typedef struct kcom_chan_s {
int (*recv)(void *handle, void *msg, unsigned int bufsz); int (*recv)(void *handle, void *msg, unsigned int bufsz);
} kcom_chan_t; } kcom_chan_t;
#endif /* _KCOM_H */ #endif /* _KCOM_H */

View File

@ -1,18 +1,17 @@
/* /*
* Unless you and Broadcom execute a separate written software license * Copyright 2017 Broadcom
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
* *
* As a special exception, the copyright holders of this software give * This program is free software; you can redistribute it and/or modify
* you permission to link this software with independent modules, and to * it under the terms of the GNU General Public License, version 2, as
* copy and distribute the resulting executable under terms of your * published by the Free Software Foundation (the "GPL").
* choice, provided that you also meet, for each linked independent *
* module, the terms and conditions of the license of that module. An * This program is distributed in the hope that it will be useful, but
* independent module is a module which is not derived from this * WITHOUT ANY WARRANTY; without even the implied warranty of
* software. The special exception does not apply to any modifications * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* of the software. * General Public License version 2 (GPLv2) for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 (GPLv2) along with this source code.
*/ */
/* /*
* $Id: sync.h,v 1.1 Broadcom SDK $ * $Id: sync.h,v 1.1 Broadcom SDK $

View File

@ -1,18 +1,17 @@
/* /*
* Unless you and Broadcom execute a separate written software license * Copyright 2017 Broadcom
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
* *
* As a special exception, the copyright holders of this software give * This program is free software; you can redistribute it and/or modify
* you permission to link this software with independent modules, and to * it under the terms of the GNU General Public License, version 2, as
* copy and distribute the resulting executable under terms of your * published by the Free Software Foundation (the "GPL").
* choice, provided that you also meet, for each linked independent *
* module, the terms and conditions of the license of that module. An * This program is distributed in the hope that it will be useful, but
* independent module is a module which is not derived from this * WITHOUT ANY WARRANTY; without even the implied warranty of
* software. The special exception does not apply to any modifications * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* of the software. * General Public License version 2 (GPLv2) for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 (GPLv2) along with this source code.
*/ */
/* /*
* $Id: thread.h,v 1.1 Broadcom SDK $ * $Id: thread.h,v 1.1 Broadcom SDK $

View File

@ -1,18 +1,17 @@
/* /*
* Unless you and Broadcom execute a separate written software license * Copyright 2017 Broadcom
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
* *
* As a special exception, the copyright holders of this software give * This program is free software; you can redistribute it and/or modify
* you permission to link this software with independent modules, and to * it under the terms of the GNU General Public License, version 2, as
* copy and distribute the resulting executable under terms of your * published by the Free Software Foundation (the "GPL").
* choice, provided that you also meet, for each linked independent *
* module, the terms and conditions of the license of that module. An * This program is distributed in the hope that it will be useful, but
* independent module is a module which is not derived from this * WITHOUT ANY WARRANTY; without even the implied warranty of
* software. The special exception does not apply to any modifications * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* of the software. * General Public License version 2 (GPLv2) for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 (GPLv2) along with this source code.
*/ */
/* /*
* $Id: types.h,v 1.3 Broadcom SDK $ * $Id: types.h,v 1.3 Broadcom SDK $

View File

@ -1,18 +1,17 @@
/* /*
* Unless you and Broadcom execute a separate written software license * Copyright 2017 Broadcom
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
* *
* As a special exception, the copyright holders of this software give * This program is free software; you can redistribute it and/or modify
* you permission to link this software with independent modules, and to * it under the terms of the GNU General Public License, version 2, as
* copy and distribute the resulting executable under terms of your * published by the Free Software Foundation (the "GPL").
* choice, provided that you also meet, for each linked independent *
* module, the terms and conditions of the license of that module. An * This program is distributed in the hope that it will be useful, but
* independent module is a module which is not derived from this * WITHOUT ANY WARRANTY; without even the implied warranty of
* software. The special exception does not apply to any modifications * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* of the software. * General Public License version 2 (GPLv2) for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 (GPLv2) along with this source code.
*/ */
/* /*
* $Id: sdk_config.h,v 1.5 Broadcom SDK $ * $Id: sdk_config.h,v 1.5 Broadcom SDK $

View File

@ -1,18 +1,17 @@
/* /*
* Unless you and Broadcom execute a separate written software license * Copyright 2017 Broadcom
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
* *
* As a special exception, the copyright holders of this software give * This program is free software; you can redistribute it and/or modify
* you permission to link this software with independent modules, and to * it under the terms of the GNU General Public License, version 2, as
* copy and distribute the resulting executable under terms of your * published by the Free Software Foundation (the "GPL").
* choice, provided that you also meet, for each linked independent *
* module, the terms and conditions of the license of that module. An * This program is distributed in the hope that it will be useful, but
* independent module is a module which is not derived from this * WITHOUT ANY WARRANTY; without even the implied warranty of
* software. The special exception does not apply to any modifications * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* of the software. * General Public License version 2 (GPLv2) for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 (GPLv2) along with this source code.
*/ */
/* /*
* $Id: cmic.h,v 1.1 Broadcom SDK $ * $Id: cmic.h,v 1.1 Broadcom SDK $

View File

@ -1,21 +1,20 @@
/* /*
* Unless you and Broadcom execute a separate written software license * Copyright 2017 Broadcom
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
* *
* As a special exception, the copyright holders of this software give * This program is free software; you can redistribute it and/or modify
* you permission to link this software with independent modules, and to * it under the terms of the GNU General Public License, version 2, as
* copy and distribute the resulting executable under terms of your * published by the Free Software Foundation (the "GPL").
* choice, provided that you also meet, for each linked independent *
* module, the terms and conditions of the license of that module. An * This program is distributed in the hope that it will be useful, but
* independent module is a module which is not derived from this * WITHOUT ANY WARRANTY; without even the implied warranty of
* software. The special exception does not apply to any modifications * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* of the software. * General Public License version 2 (GPLv2) for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 (GPLv2) along with this source code.
*/ */
/* /*
* Copyright: (c) 2017 Broadcom Corp. * Copyright: (c) 2018 Broadcom.
* All Rights Reserved. * All Rights Reserved.
*/ */
@ -1237,6 +1236,9 @@
#define BCM56169_B0_REV_ID 0x11 #define BCM56169_B0_REV_ID 0x11
#define BCM56169_B1_REV_ID 0x12 #define BCM56169_B1_REV_ID 0x12
#define BCM56980_DEVICE_ID 0xb980
#define BCM56980_A0_REV_ID 1
#define BCM56968_DEVICE_ID 0xb968 #define BCM56968_DEVICE_ID 0xb968
#define BCM56968_A0_REV_ID 1 #define BCM56968_A0_REV_ID 1
#define BCM56968_B0_REV_ID 0x11 #define BCM56968_B0_REV_ID 0x11
@ -1276,90 +1278,95 @@
#define BCM56560_DEVICE_ID 0xb560 #define BCM56560_DEVICE_ID 0xb560
#define BCM56560_A0_REV_ID 1 #define BCM56560_A0_REV_ID 1
#define BCM56560_B0_REV_ID 0x11 #define BCM56560_B0_REV_ID 0x11
#define BCM56560_B1_REV_ID 0x12
#define BCM56561_DEVICE_ID 0xb561 #define BCM56561_DEVICE_ID 0xb561
#define BCM56561_A0_REV_ID 1 #define BCM56561_A0_REV_ID 1
#define BCM56561_B0_REV_ID 0x11 #define BCM56561_B0_REV_ID 0x11
#define BCM56561_B1_REV_ID 0x12
#define BCM56562_DEVICE_ID 0xb562 #define BCM56562_DEVICE_ID 0xb562
#define BCM56562_A0_REV_ID 1 #define BCM56562_A0_REV_ID 1
#define BCM56562_B0_REV_ID 0x11 #define BCM56562_B0_REV_ID 0x11
#define BCM56562_B1_REV_ID 0x12
#define BCM56670_DEVICE_ID 0xb670
#define BCM56670_A0_REV_ID 1
#define BCM56671_DEVICE_ID 0xb671
#define BCM56671_A0_REV_ID 1
#define BCM56672_DEVICE_ID 0xb672
#define BCM56672_A0_REV_ID 1
#define BCM56675_DEVICE_ID 0xb675
#define BCM56675_A0_REV_ID 1
#define BCM56565_DEVICE_ID 0xb565 #define BCM56565_DEVICE_ID 0xb565
#define BCM56565_A0_REV_ID 1 #define BCM56565_A0_REV_ID 1
#define BCM56565_B0_REV_ID 0x11 #define BCM56565_B0_REV_ID 0x11
#define BCM56565_B1_REV_ID 0x12
#define BCM56566_DEVICE_ID 0xb566 #define BCM56566_DEVICE_ID 0xb566
#define BCM56566_A0_REV_ID 1 #define BCM56566_A0_REV_ID 1
#define BCM56566_B0_REV_ID 0x11 #define BCM56566_B0_REV_ID 0x11
#define BCM56566_B1_REV_ID 0x12
#define BCM56567_DEVICE_ID 0xb567 #define BCM56567_DEVICE_ID 0xb567
#define BCM56567_A0_REV_ID 1 #define BCM56567_A0_REV_ID 1
#define BCM56567_B0_REV_ID 0x11 #define BCM56567_B0_REV_ID 0x11
#define BCM56567_B1_REV_ID 0x12
#define BCM56568_DEVICE_ID 0xb568 #define BCM56568_DEVICE_ID 0xb568
#define BCM56568_A0_REV_ID 1 #define BCM56568_A0_REV_ID 1
#define BCM56568_B0_REV_ID 0x11 #define BCM56568_B0_REV_ID 0x11
#define BCM56568_B1_REV_ID 0x12
#define BCM56760_DEVICE_ID 0xb760 #define BCM56760_DEVICE_ID 0xb760
#define BCM56760_A0_REV_ID 1 #define BCM56760_A0_REV_ID 1
#define BCM56760_A1_REV_ID 2
#define BCM56760_B0_REV_ID 0x11 #define BCM56760_B0_REV_ID 0x11
#define BCM56760_B1_REV_ID 0x12
#define BCM56761_DEVICE_ID 0xb761
#define BCM56761_A0_REV_ID 1
#define BCM56761_B0_REV_ID 0x11
#define BCM56762_DEVICE_ID 0xb762 #define BCM56762_DEVICE_ID 0xb762
#define BCM56762_A0_REV_ID 1 #define BCM56762_A0_REV_ID 1
#define BCM56762_B0_REV_ID 0x11 #define BCM56762_B0_REV_ID 0x11
#define BCM56762_B1_REV_ID 0x12
#define BCM56764_DEVICE_ID 0xb764 #define BCM56764_DEVICE_ID 0xb764
#define BCM56764_A0_REV_ID 1 #define BCM56764_A0_REV_ID 1
#define BCM56764_B0_REV_ID 0x11 #define BCM56764_B0_REV_ID 0x11
#define BCM56764_B1_REV_ID 0x12
#define BCM56765_DEVICE_ID 0xb765 #define BCM56765_DEVICE_ID 0xb765
#define BCM56765_A0_REV_ID 1 #define BCM56765_A0_REV_ID 1
#define BCM56765_B0_REV_ID 0x11 #define BCM56765_B0_REV_ID 0x11
#define BCM56765_B1_REV_ID 0x12
#define BCM56766_DEVICE_ID 0xb766 #define BCM56766_DEVICE_ID 0xb766
#define BCM56766_A0_REV_ID 1 #define BCM56766_A0_REV_ID 1
#define BCM56766_B0_REV_ID 0x11 #define BCM56766_B0_REV_ID 0x11
#define BCM56766_B1_REV_ID 0x12
#define BCM56768_DEVICE_ID 0xb768 #define BCM56768_DEVICE_ID 0xb768
#define BCM56768_A0_REV_ID 1 #define BCM56768_A0_REV_ID 1
#define BCM56768_B0_REV_ID 0x11 #define BCM56768_B0_REV_ID 0x11
#define BCM56768_B1_REV_ID 0x12
#define BCM56068_DEVICE_ID 0xb068 #define BCM56068_DEVICE_ID 0xb068
#define BCM56068_A0_REV_ID 1 #define BCM56068_A0_REV_ID 1
#define BCM56068_B0_REV_ID 0x11 #define BCM56068_B0_REV_ID 0x11
#define BCM56068_B1_REV_ID 0x12
#define BCM56069_DEVICE_ID 0xb069 #define BCM56069_DEVICE_ID 0xb069
#define BCM56069_A0_REV_ID 1 #define BCM56069_A0_REV_ID 1
#define BCM56069_B0_REV_ID 0x11 #define BCM56069_B0_REV_ID 0x11
#define BCM56069_B1_REV_ID 0x12
#define BCM56170_DEVICE_ID 0xb170 #define BCM56170_DEVICE_ID 0xb170
#define BCM56170_A0_REV_ID 1 #define BCM56170_A0_REV_ID 1
#define BCM56170_B0_REV_ID 0x11
#define BCM56172_DEVICE_ID 0xb172 #define BCM56172_DEVICE_ID 0xb172
#define BCM56172_A0_REV_ID 1 #define BCM56172_A0_REV_ID 1
#define BCM56172_B0_REV_ID 0x11
#define BCM56174_DEVICE_ID 0xb174 #define BCM56174_DEVICE_ID 0xb174
#define BCM56174_A0_REV_ID 1 #define BCM56174_A0_REV_ID 1
#define BCM56174_B0_REV_ID 0x11
#define BCM53570_DEVICE_ID 0x8570 #define BCM53570_DEVICE_ID 0x8570
#define BCM53570_A0_REV_ID 1 #define BCM53570_A0_REV_ID 1
#define BCM53570_B0_REV_ID 0x11
#define BCM53575_DEVICE_ID 0x8575 #define BCM53575_DEVICE_ID 0x8575
#define BCM53575_A0_REV_ID 1 #define BCM53575_A0_REV_ID 1
#define BCM53575_B0_REV_ID 0x11
#define BCM56965_DEVICE_ID 0xb965 #define BCM56965_DEVICE_ID 0xb965
@ -1384,13 +1391,24 @@
#define BCM56974_DEVICE_ID 0xb974 #define BCM56974_DEVICE_ID 0xb974
#define BCM56974_A0_REV_ID 1 #define BCM56974_A0_REV_ID 1
#define BCM56974_B0_REV_ID 0x11 #define BCM56974_B0_REV_ID 0x11
#define BCM56975_DEVICE_ID 0xb975
#define BCM56975_A0_REV_ID 1
#define BCM56975_B0_REV_ID 0x11
#define BCM56870_DEVICE_ID 0xb870 #define BCM56870_DEVICE_ID 0xb870
#define BCM56870_A0_REV_ID 1 #define BCM56870_A0_REV_ID 1
#define BCM56873_DEVICE_ID 0xb873 #define BCM56873_DEVICE_ID 0xb873
#define BCM56873_A0_REV_ID 1 #define BCM56873_A0_REV_ID 1
#define BCM53540_DEVICE_ID 0x8540
#define BCM53540_A0_REV_ID 1
#define BCM53547_DEVICE_ID 0x8547
#define BCM53547_A0_REV_ID 1
#define BCM53548_DEVICE_ID 0x8548
#define BCM53548_A0_REV_ID 1
#define BCM53549_DEVICE_ID 0x8549
#define BCM53549_A0_REV_ID 1
#define BCM5665_DEVICE_ID 0x5665 #define BCM5665_DEVICE_ID 0x5665
#define BCM5665_A0_REV_ID 1 #define BCM5665_A0_REV_ID 1
#define BCM5665_B0_REV_ID 0x11 #define BCM5665_B0_REV_ID 0x11
@ -1695,8 +1713,27 @@
#define BCM88955_A1_REV_ID 0x0002 #define BCM88955_A1_REV_ID 0x0002
#define BCM88956_DEVICE_ID 0x8956 #define BCM88956_DEVICE_ID 0x8956
#define BCM88956_A1_REV_ID 0x0002 #define BCM88956_A1_REV_ID 0x0002
#define DNXC_A0_REV_ID 0x0001
#define DNXC_A1_REV_ID 0x0002
#define DNXC_B0_REV_ID 0x0011
#define BCM88790_DEVICE_ID 0x8790 #define BCM88790_DEVICE_ID 0x8790
#define BCM88790_A0_REV_ID 0x0001 #define BCM88790_A0_REV_ID DNXC_A0_REV_ID
#define BCM88791_DEVICE_ID 0x8791
#define BCM88792_DEVICE_ID 0x8792
#define BCM88793_DEVICE_ID 0x8793
#define BCM88794_DEVICE_ID 0x8794
#define BCM88795_DEVICE_ID 0x8795
#define BCM88796_DEVICE_ID 0x8796
#define BCM88797_DEVICE_ID 0x8797
#define BCM88798_DEVICE_ID 0x8798
#define BCM88799_DEVICE_ID 0x8799
#define BCM8879A_DEVICE_ID 0x879A
#define BCM8879B_DEVICE_ID 0x879B
#define BCM8879C_DEVICE_ID 0x879C
#define BCM8879D_DEVICE_ID 0x879D
#define BCM8879E_DEVICE_ID 0x879E
#define BCM8879F_DEVICE_ID 0x879F
#define BCM_DNXF_DEVID_MASK 0xFFF0
#define ARADPLUS_DEVICE_ID 0x8660 #define ARADPLUS_DEVICE_ID 0x8660
#define ARADPLUS_A0_REV_ID 0x0001 #define ARADPLUS_A0_REV_ID 0x0001
#define BCM88660_DEVICE_ID ARADPLUS_DEVICE_ID #define BCM88660_DEVICE_ID ARADPLUS_DEVICE_ID
@ -1865,6 +1902,7 @@
#define BCM88272_DEVICE_ID 0x8272 #define BCM88272_DEVICE_ID 0x8272
#define BCM88273_DEVICE_ID 0x8273 #define BCM88273_DEVICE_ID 0x8273
#define BCM88278_DEVICE_ID 0x8278 #define BCM88278_DEVICE_ID 0x8278
#define BCM88279_DEVICE_ID 0x8279
#define FLAIR_DEVICE_ID 0xF000 #define FLAIR_DEVICE_ID 0xF000
#define FLAIR_A0_REV_ID 0x0001 #define FLAIR_A0_REV_ID 0x0001
@ -1922,11 +1960,11 @@
#define BCM88654_DEVICE_ID 0x8654 #define BCM88654_DEVICE_ID 0x8654
#define BCM88654_B1_REV_ID ARAD_B1_REV_ID #define BCM88654_B1_REV_ID ARAD_B1_REV_ID
#define BCM88772_DEVICE_ID 0x8772 #define BCM88772_DEVICE_ID 0x8772
#define BCM88952_DEVICE_ID 0x8952 #define BCM88952_DEVICE_ID 0x8952
#define BCM88772_A1_REV_ID 0x0002 #define BCM88772_A1_REV_ID 0x0002
#define BCM88952_A0_REV_ID 0x0001 #define BCM88952_A0_REV_ID 0x0001
#define BCM88952_A1_REV_ID 0x0002 #define BCM88952_A1_REV_ID 0x0002
#define BCM88752_DEVICE_ID 0x8752 #define BCM88752_DEVICE_ID 0x8752
#define BCM88752_A0_REV_ID 0x0000 #define BCM88752_A0_REV_ID 0x0000

View File

@ -1,18 +1,17 @@
# #
# Unless you and Broadcom execute a separate written software license # Copyright 2017 Broadcom
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
# #
# As a special exception, the copyright holders of this software give # This program is free software; you can redistribute it and/or modify
# you permission to link this software with independent modules, and to # it under the terms of the GNU General Public License, version 2, as
# copy and distribute the resulting executable under terms of your # published by the Free Software Foundation (the "GPL").
# choice, provided that you also meet, for each linked independent #
# module, the terms and conditions of the license of that module. An # This program is distributed in the hope that it will be useful, but
# independent module is a module which is not derived from this # WITHOUT ANY WARRANTY; without even the implied warranty of
# software. The special exception does not apply to any modifications # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# of the software. # General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
# #
# $Id: Make.config,v 1.3 Broadcom SDK $ # $Id: Make.config,v 1.3 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp. # $Copyright: (c) 2005 Broadcom Corp.
@ -167,6 +166,8 @@ CFLAGS += ${INCFLAGS}
CXXFLAGS += ${INCFLAGS} CXXFLAGS += ${INCFLAGS}
CPPFLAGS += ${INCFLAGS} CPPFLAGS += ${INCFLAGS}
CFLAGS += -DSAI_FIXUP -DBCM_PORT_DEFAULT_DISABLE -DBCM_VLAN_NO_DEFAULT_ETHER -DBCM_VLAN_NO_DEFAULT_CPU -DBCM_WARM_BOOT_SUPPORT -DSAL_CONFIG_FILE_DISABLE -DSAL_THREAD_NAME_PRINT_DISABLE -UKCOM_FILTER_MAX -DKCOM_FILTER_MAX=256 -DALPM_ENABLE -DOPENNSL_PHY_ROUTINES -DTH2_CPU_POOL_SETUP -DINCLUDE_L3 -DSAI_ONLY -DPRINT_TO_SYSLOG -D_SHR_PBMP_WIDTH=256 -DINCLUDE_DIAG_SHELL -DSTATIC=static -DLOG_TEST -DLOG_SAI -D_GNU_SOURCE
# #
# Debug #ifdef control # Debug #ifdef control
# #

View File

@ -1,18 +1,17 @@
# #
# Unless you and Broadcom execute a separate written software license # Copyright 2017 Broadcom
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
# #
# As a special exception, the copyright holders of this software give # This program is free software; you can redistribute it and/or modify
# you permission to link this software with independent modules, and to # it under the terms of the GNU General Public License, version 2, as
# copy and distribute the resulting executable under terms of your # published by the Free Software Foundation (the "GPL").
# choice, provided that you also meet, for each linked independent #
# module, the terms and conditions of the license of that module. An # This program is distributed in the hope that it will be useful, but
# independent module is a module which is not derived from this # WITHOUT ANY WARRANTY; without even the implied warranty of
# software. The special exception does not apply to any modifications # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# of the software. # General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
# #
# $Id: Make.depend,v 1.14 Broadcom SDK $ # $Id: Make.depend,v 1.14 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp. # $Copyright: (c) 2005 Broadcom Corp.

View File

@ -1,18 +1,17 @@
# #
# Unless you and Broadcom execute a separate written software license # Copyright 2017 Broadcom
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
# #
# As a special exception, the copyright holders of this software give # This program is free software; you can redistribute it and/or modify
# you permission to link this software with independent modules, and to # it under the terms of the GNU General Public License, version 2, as
# copy and distribute the resulting executable under terms of your # published by the Free Software Foundation (the "GPL").
# choice, provided that you also meet, for each linked independent #
# module, the terms and conditions of the license of that module. An # This program is distributed in the hope that it will be useful, but
# independent module is a module which is not derived from this # WITHOUT ANY WARRANTY; without even the implied warranty of
# software. The special exception does not apply to any modifications # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# of the software. # General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
# #
# $Id: Make.kernlib,v 1.7 Broadcom SDK $ # $Id: Make.kernlib,v 1.7 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp. # $Copyright: (c) 2005 Broadcom Corp.

View File

@ -1,18 +1,17 @@
# #
# Unless you and Broadcom execute a separate written software license # Copyright 2017 Broadcom
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
# #
# As a special exception, the copyright holders of this software give # This program is free software; you can redistribute it and/or modify
# you permission to link this software with independent modules, and to # it under the terms of the GNU General Public License, version 2, as
# copy and distribute the resulting executable under terms of your # published by the Free Software Foundation (the "GPL").
# choice, provided that you also meet, for each linked independent #
# module, the terms and conditions of the license of that module. An # This program is distributed in the hope that it will be useful, but
# independent module is a module which is not derived from this # WITHOUT ANY WARRANTY; without even the implied warranty of
# software. The special exception does not apply to any modifications # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# of the software. # General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
# #
# $Id: Make.lib,v 1.14 Broadcom SDK $ # $Id: Make.lib,v 1.14 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp. # $Copyright: (c) 2005 Broadcom Corp.

View File

@ -1,18 +1,17 @@
# #
# Unless you and Broadcom execute a separate written software license # Copyright 2017 Broadcom
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
# #
# As a special exception, the copyright holders of this software give # This program is free software; you can redistribute it and/or modify
# you permission to link this software with independent modules, and to # it under the terms of the GNU General Public License, version 2, as
# copy and distribute the resulting executable under terms of your # published by the Free Software Foundation (the "GPL").
# choice, provided that you also meet, for each linked independent #
# module, the terms and conditions of the license of that module. An # This program is distributed in the hope that it will be useful, but
# independent module is a module which is not derived from this # WITHOUT ANY WARRANTY; without even the implied warranty of
# software. The special exception does not apply to any modifications # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# of the software. # General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
# #
# #
# $Id: Make.linux,v 1.18 Broadcom SDK $ # $Id: Make.linux,v 1.18 Broadcom SDK $

View File

@ -1,2 +0,0 @@
#Changing value of this Knet filter
CFGFLAGS += -UKCOM_FILTER_MAX -DKCOM_FILTER_MAX=256

View File

@ -1,18 +1,17 @@
# #
# Unless you and Broadcom execute a separate written software license # Copyright 2017 Broadcom
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
# #
# As a special exception, the copyright holders of this software give # This program is free software; you can redistribute it and/or modify
# you permission to link this software with independent modules, and to # it under the terms of the GNU General Public License, version 2, as
# copy and distribute the resulting executable under terms of your # published by the Free Software Foundation (the "GPL").
# choice, provided that you also meet, for each linked independent #
# module, the terms and conditions of the license of that module. An # This program is distributed in the hope that it will be useful, but
# independent module is a module which is not derived from this # WITHOUT ANY WARRANTY; without even the implied warranty of
# software. The special exception does not apply to any modifications # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# of the software. # General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
# #
# $Id: Make.subdirs,v 1.8 Broadcom SDK $ # $Id: Make.subdirs,v 1.8 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp. # $Copyright: (c) 2005 Broadcom Corp.

View File

@ -1,18 +1,17 @@
# #
# Unless you and Broadcom execute a separate written software license # Copyright 2017 Broadcom
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
# #
# As a special exception, the copyright holders of this software give # This program is free software; you can redistribute it and/or modify
# you permission to link this software with independent modules, and to # it under the terms of the GNU General Public License, version 2, as
# copy and distribute the resulting executable under terms of your # published by the Free Software Foundation (the "GPL").
# choice, provided that you also meet, for each linked independent #
# module, the terms and conditions of the license of that module. An # This program is distributed in the hope that it will be useful, but
# independent module is a module which is not derived from this # WITHOUT ANY WARRANTY; without even the implied warranty of
# software. The special exception does not apply to any modifications # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# of the software. # General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
# #
# $Id: Make.tools,v 1.2 Broadcom SDK $ # $Id: Make.tools,v 1.2 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp. # $Copyright: (c) 2005 Broadcom Corp.

View File

@ -0,0 +1,122 @@
#
# Copyright 2017 Broadcom
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2, as
# published by the Free Software Foundation (the "GPL").
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
#
# $Id: Makefile.linux-bmw-2_6,v 1.20 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp.
# All Rights Reserved.$
# Look for custom tools
ifneq (,$(PPC_TOOLS_DIR))
ifneq (,$(PPC_CROSS_COMPILE))
override PATH := $(PPC_TOOLS_DIR):$(PATH)
override CROSS_COMPILE := $(PPC_CROSS_COMPILE)
endif
endif
# Default tools
ifeq (,$(WRS_LINUX_VERSION))
WRS_LINUX_VERSION=2.0
endif
# Default Linux Kernel directory
ifeq (,$(KERNDIR))
ifeq (1.4,$(WRS_LINUX_VERSION))
KERNDIR := /projects/ntsw-tools/linux/wrslinux_1.4/bcm98245cpci/build/linux-2.6.14-cgl
ifeq (,$(CROSS_COMPILE))
CROSS_COMPILE = powerpc-wrs-linux-gnu-603e-glibc_std-
endif
WRLINUX_BASE=/tools/windriver/linux_ed/1.4/Linux
export WIND_LIC_PROXY = $(WRLINUX_BASE)/setup/x86-linux2/bin
override PATH := $(WRLINUX_BASE)/gnu/3.4.4-wrlinux-1.4/x86-linux2/bin:$(PATH)
WRS_SYSROOT_PATH := $(WRLINUX_GNU_PATH)/../lib/gcc/powerpc-wrs-linux-gnu/3.4.4/include
else
ifeq (2.0,$(WRS_LINUX_VERSION))
ifeq (,$(CROSS_COMPILE))
CROSS_COMPILE = powerpc-wrs-linux-gnu-ppc_603e-glibc_std-
endif
KERNDIR:= /projects/ntsw-tools/linux/wrslinux_2.0/bmw/glibc_std/build/linux-2.6.21-standard
WRLINUX_BASE=/tools/windriver/linux_ed/2.0_GA/Linux
TOOLCHAIN_EXEC_PREFIX=$(WRLINUX_BASE)/gnu/4.1-wrlinux-2.0/x86-linux2
TOOLCHAIN_BIN_DIR=$(TOOLCHAIN_EXEC_PREFIX)
WIND_LIC_PROXY=$(WRLINUX_BASE)/setup/x86-linux2/bin
WRLINUX_GNU_PATH = $(WRLINUX_BASE)/gnu/4.1-wrlinux-2.0/x86-linux2/bin
override PATH := $(TOOLCHAIN_EXEC_PREFIX):$(KERNDIR)/../../host-cross/bin:$(KERNDIR)/../../host-cross/powerpc-wrs-linux-gnu/bin:$(WRLINUX_GNU_PATH):$(PATH)
export TOOLCHAIN_EXEC_PREFIX TOOLCHAIN_BIN_DIR WIND_LIC_PROXY
WRS_SYSROOT_PATH := $(WRLINUX_GNU_PATH)/../lib/gcc/powerpc-wrs-linux-gnu/4.1.2/include
comma = ,
basetarget = $(basename $(notdir $@))
modname = $(basetarget)
# Extra variables.
EXTRA_CFLAGS = -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags)
name-fix = $(subst $(comma),_,$(subst -,_,$1))
basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))"
modname_flags = $(if $(filter 1,$(words $(modname))),\
-D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))")
endif
endif
endif
# Default Linux include directory
ifeq (,$(LINUX_INCLUDE))
LINUX_INCLUDE := $(KERNDIR)/include
endif
CFGFLAGS += -DSYS_BE_PIO=1 -DSYS_BE_PACKET=0 -DSYS_BE_OTHER=1
ENDIAN = BE_HOST=1
CFGFLAGS += -D$(ENDIAN)
CFGFLAGS += -DBCM_PLATFORM_STRING=\"BMW_MPC8245/PPC603e\"
ARCH = ppc
KBUILD_VERBOSE = 1
export ARCH KBUILD_VERBOSE
ifeq (1.4,$(WRS_LINUX_VERSION))
# From linux/arch/ppc/Makefile
ifeq (,$(KFLAGS))
KFLAGS := -D__KERNEL__ -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -fsigned-char -msoft-float -pipe -ffixed-r2 -Wno-uninitialized -mmultiple -mstring
endif
else
ifeq (2.0,$(WRS_LINUX_VERSION))
ifeq (,$(KFLAGS))
KFLAGS := -D__KERNEL__ -m32 -nostdinc -isystem $(WRS_SYSROOT_PATH) -I$(LINUX_INCLUDE) -include $(LINUX_INCLUDE)/linux/autoconf.h -I$(KERNDIR)/arch/ppc -I$(KERNDIR)/arch/ppc/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -msoft-float -pipe -ffixed-r2 -mmultiple -mno-altivec -mstring -fomit-frame-pointer -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign
endif
endif
endif
ifneq ($(targetplat),user)
include ${SDK}/make/Makefile.linux-kernel-2_6
endif

View File

@ -1,18 +1,17 @@
# #
# Unless you and Broadcom execute a separate written software license # Copyright 2017 Broadcom
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
# #
# As a special exception, the copyright holders of this software give # This program is free software; you can redistribute it and/or modify
# you permission to link this software with independent modules, and to # it under the terms of the GNU General Public License, version 2, as
# copy and distribute the resulting executable under terms of your # published by the Free Software Foundation (the "GPL").
# choice, provided that you also meet, for each linked independent #
# module, the terms and conditions of the license of that module. An # This program is distributed in the hope that it will be useful, but
# independent module is a module which is not derived from this # WITHOUT ANY WARRANTY; without even the implied warranty of
# software. The special exception does not apply to any modifications # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# of the software. # General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
# #
# $Id: Makefile.linux-gto-4_4,v 1.42 Broadcom SDK $ # $Id: Makefile.linux-gto-4_4,v 1.42 Broadcom SDK $
# $Copyright: (c) 2015 Broadcom Corp. # $Copyright: (c) 2015 Broadcom Corp.

View File

@ -1,18 +1,17 @@
# #
# Unless you and Broadcom execute a separate written software license # Copyright 2017 Broadcom
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
# #
# As a special exception, the copyright holders of this software give # This program is free software; you can redistribute it and/or modify
# you permission to link this software with independent modules, and to # it under the terms of the GNU General Public License, version 2, as
# copy and distribute the resulting executable under terms of your # published by the Free Software Foundation (the "GPL").
# choice, provided that you also meet, for each linked independent #
# module, the terms and conditions of the license of that module. An # This program is distributed in the hope that it will be useful, but
# independent module is a module which is not derived from this # WITHOUT ANY WARRANTY; without even the implied warranty of
# software. The special exception does not apply to any modifications # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# of the software. # General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
# #
# $Id: Makefile.linux-gto-2_6,v 1.42 Broadcom SDK $ # $Id: Makefile.linux-gto-2_6,v 1.42 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp. # $Copyright: (c) 2005 Broadcom Corp.
@ -255,7 +254,13 @@ CFLAGS += -DBCM_PLX9656_LOCAL_BUS -DBDE_LINUX_NON_INTERRUPTIBLE -DSHADOW_SVK
endif endif
ifeq (,$(KFLAGS)) ifeq (,$(KFLAGS))
KFLAGS := -D__KERNEL__ -m32 -nostdinc -isystem $(KFLAG_INCLD) -I$(LINUX_INCLUDE) -include $(LINUX_INCLUDE)/linux/version.h -include $(LINUX_INCLUDE)/generated/autoconf.h -I$(KERNDIR)/arch/powerpc -I$(KERNDIR)/arch/powerpc -I$(KERNDIR)/arch/powerpc/include -I$(KERNDIR)/include/asm-powerpc -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -msoft-float -pipe -ffixed-r2 -mmultiple -mno-altivec -funit-at-a-time -Wa,-me500 -fomit-frame-pointer -Wdeclaration-after-statement -Wno-pointer-sign #autoconf.h was moved in later kernels
LINUX_AUTOCONF = $(LINUX_INCLUDE)/generated/autoconf.h
ifeq (,$(shell ls $(LINUX_AUTOCONF) 2>/dev/null))
LINUX_AUTOCONF = $(LINUX_INCLUDE)/linux/autoconf.h
endif
KFLAGS := -D__KERNEL__ -m32 -nostdinc -isystem $(KFLAG_INCLD) -I$(LINUX_INCLUDE) -include $(LINUX_INCLUDE)/linux/version.h -include $(LINUX_AUTOCONF) -I$(KERNDIR)/arch/powerpc -I$(KERNDIR)/arch/powerpc -I$(KERNDIR)/arch/powerpc/include -I$(KERNDIR)/include/asm-powerpc -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -msoft-float -pipe -ffixed-r2 -mmultiple -mno-altivec -funit-at-a-time -Wa,-me500 -fomit-frame-pointer -Wdeclaration-after-statement -Wno-pointer-sign
endif endif
#Wind river Linux 3.0 needs addtional flags #Wind river Linux 3.0 needs addtional flags

View File

@ -1,18 +1,17 @@
# #
# Unless you and Broadcom execute a separate written software license # Copyright 2017 Broadcom
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
# #
# As a special exception, the copyright holders of this software give # This program is free software; you can redistribute it and/or modify
# you permission to link this software with independent modules, and to # it under the terms of the GNU General Public License, version 2, as
# copy and distribute the resulting executable under terms of your # published by the Free Software Foundation (the "GPL").
# choice, provided that you also meet, for each linked independent #
# module, the terms and conditions of the license of that module. An # This program is distributed in the hope that it will be useful, but
# independent module is a module which is not derived from this # WITHOUT ANY WARRANTY; without even the implied warranty of
# software. The special exception does not apply to any modifications # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# of the software. # General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
# #
# $Id: Makefile.linux-iproc Exp $ # $Id: Makefile.linux-iproc Exp $
# $Copyright: (c) 2007 Broadcom Corp. # $Copyright: (c) 2007 Broadcom Corp.

View File

@ -1,18 +1,17 @@
# #
# Unless you and Broadcom execute a separate written software license # Copyright 2017 Broadcom
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
# #
# As a special exception, the copyright holders of this software give # This program is free software; you can redistribute it and/or modify
# you permission to link this software with independent modules, and to # it under the terms of the GNU General Public License, version 2, as
# copy and distribute the resulting executable under terms of your # published by the Free Software Foundation (the "GPL").
# choice, provided that you also meet, for each linked independent #
# module, the terms and conditions of the license of that module. An # This program is distributed in the hope that it will be useful, but
# independent module is a module which is not derived from this # WITHOUT ANY WARRANTY; without even the implied warranty of
# software. The special exception does not apply to any modifications # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# of the software. # General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
# #
# $Id: Makefile.linux-iproc-3_6,v 1.1 Broadcom SDK $ # $Id: Makefile.linux-iproc-3_6,v 1.1 Broadcom SDK $
# $Copyright: (c) 2007 Broadcom Corp. # $Copyright: (c) 2007 Broadcom Corp.

View File

@ -0,0 +1,166 @@
#
# Copyright 2017 Broadcom
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2, as
# published by the Free Software Foundation (the "GPL").
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
#
# $Id: Makefile.linux-jag-2_6,v 1.20 Broadcom SDK $
# $Copyright: (c) 2007 Broadcom Corp.
# All Rights Reserved.$
# User must select one platform from below.By default WR_LINUX is selected. .
ifeq (,$(BUILD_PLATFORM))
#BUILD_PLATFORM=ELDK
BUILD_PLATFORM=WR_LINUX
endif
# Specify the KERNEL VERSION you want to use for building SDK.
ifeq (ELDK,$(BUILD_PLATFORM))
ifeq (,$(KERN_VER))
KERN_VER=2.6.21.7
endif
endif
# Specify the Windriver Linux version here.For example '2.0' as shown below.
ifeq (WR_LINUX,$(BUILD_PLATFORM))
ifeq (,$(WRS_LINUX_VERSION))
WRS_LINUX_VERSION=2.0
endif
endif
ifeq (WR_LINUX,$(BUILD_PLATFORM))
ifeq (1.4,$(WRS_LINUX_VERSION))
KERNDIR := /projects/ntsw-tools/linux/wrslinux_1.4/broadcom_bcm95836cpci_be/build/linux-2.6.14-small
ifeq (,$(CROSS_COMPILE))
CROSS_COMPILE := mips-wrs-linux-gnu-
endif
export WIND_LIC_PROXY = /projects/ntsw-tools/wrs/wrs_linux/GPP_LE_1.4_PPR/setup/x86-linux2/bin
override PATH := /projects/ntsw-tools/wrs/wrs_linux/GPP_LE_1.4_PPR/gnu/3.4.4-wrlinux-1.4/x86-linux2/bin:$(PATH)
endif
ifeq (2.0,$(WRS_LINUX_VERSION))
#CROSS_COMPILE = mips-wrs-linux-gnu-
ifeq (,$(CROSS_COMPILE))
CROSS_COMPILE := mips-wrs-linux-gnu-mips_softfp-glibc_std-
endif
KERNDIR:= /projects/ntsw-tools/linux/wrslinux_2.0/jag/glibc_std/build/linux-2.6.21-standard
endif
WRLINUX_BASE=/tools/windriver/linux_ed/2.0_GA/Linux
TOOLCHAIN_BIN_DIR=$(KERNDIR)/../../host-cross/mips-wrs-linux-gnu/bin
WIND_LIC_PROXY=$(WRLINUX_BASE)/setup/x86-linux2/bin
WRLINUX_GNU_PATH=$(WRLINUX_BASE)/gnu/4.1-wrlinux-2.0/x86-linux2/bin
override PATH:=$(KERNDIR)/../../host-cross/bin:$(KERNDIR)/../../host-cross/mips-wrs-linux-gnu/bin:$(WRLINUX_GNU_PATH):$(PATH)
WRS_SYSROOT_PATH := $(WRLINUX_GNU_PATH)/../lib/gcc/mips-wrs-linux-gnu/4.1.2/include
export TOOLCHAIN_BIN_DIR WIND_LIC_PROXY
endif
ifeq (ELDK,$(BUILD_PLATFORM))
ifeq (2.6.21.7, $(KERN_VER))
ifeq (,$(CROSS_COMPILE))
CROSS_COMPILE := mips_4KC-
endif
override PATH := /tools/eldk/4.1/usr/bin:$(PATH)
KERNDIR ?= /projects/ntsw-tools/linux/eldk/jag-ntswics-eldk/linux-2.6.21.7
endif
endif
comma = ,
basetarget = $(basename $(notdir $@))
modname = $(basetarget)
# Extra variables.
EXTRA_CFLAGS = -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags)
name-fix = $(subst $(comma),_,$(subst -,_,$1))
basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))"
modname_flags = $(if $(filter 1,$(words $(modname))),\
-D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))")
# Default Linux include directory
ifeq (,$(LINUX_INCLUDE))
LINUX_INCLUDE := $(KERNDIR)/include
endif
CFGFLAGS += -DSYS_BE_PIO=0 -DSYS_BE_PACKET=1 -DSYS_BE_OTHER=0
ENDIAN = BE_HOST=1
CFGFLAGS += -D$(ENDIAN)
CFGFLAGS += -DBCM_PLATFORM_STRING=\"JAG_BCM4704\"
ARCH = mips
KBUILD_VERBOSE = 1
export ARCH KBUILD_VERBOSE
ifeq (ELDK,$(BUILD_PLATFORM))
KFLAG_INCLD = /tools/eldk/4.1/usr/lib/gcc/mips-linux/4.0.0/include/
endif
ifeq (1.4,$(WRS_LINUX_VERSION))
# From linux/arch/mips/Makefile
ifeq (,$(KFLAGS))
KFLAGS := -D__KERNEL__ -Wall -Wno-trigraphs -fno-strict-aliasing -fno-common -ffreestanding -O2 -fomit-frame-pointer -g -G 0 -mno-abicalls -fno-pic -pipe -march=mips32 -Wa,-mips32 -Wa,--trap -funit-at-a-time -mlong-calls -Wundef -finline-limit=100000 -mabi=32
endif
#-Wdeclaration-after-statement -Wstrict-prototypes
else
ifeq (2.0,$(WRS_LINUX_VERSION))
ifeq (,$(KFLAGS))
KFLAGS := -D__KERNEL__ -nostdinc -isystem $(WRS_SYSROOT_PATH) -I$(LINUX_INCLUDE) -include $(LINUX_INCLUDE)/linux/autoconf.h -I$(KERNDIR)/arch/mips -I$(KERNDIR)/arch/mips -I$(KERNDIR)/arch/mips/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -mabi=32 -G 0 -mno-abicalls -fno-pic -pipe -msoft-float -ffreestanding -march=mips32 -Wa,-mips32 -Wa,--trap -Iinclude/asm-mips/mach-bcm947xx -Iinclude/asm-mips/mach-generic -fomit-frame-pointer -g -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -mlong-calls
endif
endif
endif
ifeq (ELDK,$(BUILD_PLATFORM))
ifeq (,$(KFLAGS))
KFLAGS := -D__KERNEL__ -nostdinc -isystem $(KFLAG_INCLD) -I$(LINUX_INCLUDE) -include $(LINUX_INCLUDE)/linux/autoconf.h -I$(KERNDIR)/arch/mips -I$(KERNDIR)/arch/mips -I$(KERNDIR)/arch/mips/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -mabi=32 -G 0 -mno-abicalls -fno-pic -pipe -msoft-float -ffreestanding -march=mips32 -Wa,-mips32 -Wa,--trap -Iinclude/asm-mips/mach-bcm947xx -Iinclude/asm-mips/mach-generic -fomit-frame-pointer -g -Wdeclaration-after-statement -mlong-calls
endif
endif
ifneq ($(targetplat),user)
include ${SDK}/make/Makefile.linux-kernel-2_6
endif
ifneq (,$(findstring TCL,$(FEATURE_LIST)))
LINK_STATIC=0
export LINK_STATIC
endif

View File

@ -1,18 +1,17 @@
# #
# Unless you and Broadcom execute a separate written software license # Copyright 2017 Broadcom
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
# #
# As a special exception, the copyright holders of this software give # This program is free software; you can redistribute it and/or modify
# you permission to link this software with independent modules, and to # it under the terms of the GNU General Public License, version 2, as
# copy and distribute the resulting executable under terms of your # published by the Free Software Foundation (the "GPL").
# choice, provided that you also meet, for each linked independent #
# module, the terms and conditions of the license of that module. An # This program is distributed in the hope that it will be useful, but
# independent module is a module which is not derived from this # WITHOUT ANY WARRANTY; without even the implied warranty of
# software. The special exception does not apply to any modifications # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# of the software. # General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
# #
# $Id: Makefile.linux-kernel,v 1.27 Broadcom SDK $ # $Id: Makefile.linux-kernel,v 1.27 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp. # $Copyright: (c) 2005 Broadcom Corp.

View File

@ -1,18 +1,17 @@
# #
# Unless you and Broadcom execute a separate written software license # Copyright 2017 Broadcom
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
# #
# As a special exception, the copyright holders of this software give # This program is free software; you can redistribute it and/or modify
# you permission to link this software with independent modules, and to # it under the terms of the GNU General Public License, version 2, as
# copy and distribute the resulting executable under terms of your # published by the Free Software Foundation (the "GPL").
# choice, provided that you also meet, for each linked independent #
# module, the terms and conditions of the license of that module. An # This program is distributed in the hope that it will be useful, but
# independent module is a module which is not derived from this # WITHOUT ANY WARRANTY; without even the implied warranty of
# software. The special exception does not apply to any modifications # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# of the software. # General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
# #
# $Id: Makefile.linux-kernel-2_6,v 1.40 Broadcom SDK $ # $Id: Makefile.linux-kernel-2_6,v 1.40 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp. # $Copyright: (c) 2005 Broadcom Corp.

View File

@ -1,18 +1,17 @@
# #
# Unless you and Broadcom execute a separate written software license # Copyright 2017 Broadcom
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
# #
# As a special exception, the copyright holders of this software give # This program is free software; you can redistribute it and/or modify
# you permission to link this software with independent modules, and to # it under the terms of the GNU General Public License, version 2, as
# copy and distribute the resulting executable under terms of your # published by the Free Software Foundation (the "GPL").
# choice, provided that you also meet, for each linked independent #
# module, the terms and conditions of the license of that module. An # This program is distributed in the hope that it will be useful, but
# independent module is a module which is not derived from this # WITHOUT ANY WARRANTY; without even the implied warranty of
# software. The special exception does not apply to any modifications # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# of the software. # General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
# #
# $Id: Makefile.linux-kernel-3_6,v 1.2 Broadcom SDK $ # $Id: Makefile.linux-kernel-3_6,v 1.2 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp. # $Copyright: (c) 2005 Broadcom Corp.

View File

@ -1,18 +1,17 @@
# #
# Unless you and Broadcom execute a separate written software license # Copyright 2017 Broadcom
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
# #
# As a special exception, the copyright holders of this software give # This program is free software; you can redistribute it and/or modify
# you permission to link this software with independent modules, and to # it under the terms of the GNU General Public License, version 2, as
# copy and distribute the resulting executable under terms of your # published by the Free Software Foundation (the "GPL").
# choice, provided that you also meet, for each linked independent #
# module, the terms and conditions of the license of that module. An # This program is distributed in the hope that it will be useful, but
# independent module is a module which is not derived from this # WITHOUT ANY WARRANTY; without even the implied warranty of
# software. The special exception does not apply to any modifications # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# of the software. # General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
# #
# $Id: Makefile.linux-kernel-2_6,v 1.40 Broadcom SDK $ # $Id: Makefile.linux-kernel-2_6,v 1.40 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp. # $Copyright: (c) 2005 Broadcom Corp.

View File

@ -1,18 +1,17 @@
# #
# Unless you and Broadcom execute a separate written software license # Copyright 2017 Broadcom
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
# #
# As a special exception, the copyright holders of this software give # This program is free software; you can redistribute it and/or modify
# you permission to link this software with independent modules, and to # it under the terms of the GNU General Public License, version 2, as
# copy and distribute the resulting executable under terms of your # published by the Free Software Foundation (the "GPL").
# choice, provided that you also meet, for each linked independent #
# module, the terms and conditions of the license of that module. An # This program is distributed in the hope that it will be useful, but
# independent module is a module which is not derived from this # WITHOUT ANY WARRANTY; without even the implied warranty of
# software. The special exception does not apply to any modifications # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# of the software. # General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
# #
# $Id: Makefile.linux-kmodule-3_6,v 1.2 Broadcom SDK $ # $Id: Makefile.linux-kmodule-3_6,v 1.2 Broadcom SDK $
# $Copyright: (c) 2006 Broadcom Corp. # $Copyright: (c) 2006 Broadcom Corp.

View File

@ -0,0 +1,56 @@
#
# Copyright 2017 Broadcom
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2, as
# published by the Free Software Foundation (the "GPL").
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
#
# $Id: Makefile.linux-nsx-2_6,v 1.9 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp.
# All Rights Reserved.$
# Look for custom tools
ifneq (,$(MIPS_TOOLS_DIR))
override PATH := $(MIPS_TOOLS_DIR):$(PATH)
endif
ifneq (,$(MIPS_CROSS_COMPILE))
override CROSS_COMPILE := $(MIPS_CROSS_COMPILE)
endif
# Default tools
ifeq (,$(CROSS_COMPILE))
CROSS_COMPILE := mips2_fp_be-
override PATH := $(PATH):/projects/ntsw-tools/linux/mvista/mvista-4.0/pro/devkit/mips/mips2_fp_be/bin
endif
# Default Linux Kernel directory
ifeq (,$(KERNDIR))
KERNDIR := /projects/ntsw-tools/linux/mvista/mvista-4.0-nsx/linux-2.6.10_dev
endif
# Default Linux include directory
ifeq (,$(LINUX_INCLUDE))
LINUX_INCLUDE := $(KERNDIR)/include
endif
CFGFLAGS += -DSYS_BE_PIO=1 -DSYS_BE_PACKET=0 -DSYS_BE_OTHER=1
ENDIAN = BE_HOST=1
CFGFLAGS += -D$(ENDIAN)
CFGFLAGS += -DBCM_PLATFORM_STRING=\"NSX_BCM1125\"
# From linux/arch/mips/Makefile
ifeq (,$(KFLAGS))
KFLAGS := -D__KERNEL__ -O2 -fomit-frame-pointer -fno-strict-aliasing -G 0 -mno-abicalls -fno-pic -mips64 -mtune=sb1 -Wa,--trap -pipe -mlong-calls
endif
ifneq ($(targetplat),user)
include ${SDK}/make/Makefile.linux-kernel-2_6
endif

View File

@ -0,0 +1,54 @@
#
# Copyright 2017 Broadcom
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2, as
# published by the Free Software Foundation (the "GPL").
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
#
# $Id: Makefile.linux-nsx64,v 1.9 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp.
# All Rights Reserved.$
# Look for custom tools
ifneq (,$(MIPS_TOOLS_DIR))
override PATH := $(MIPS_TOOLS_DIR):$(PATH)
endif
ifneq (,$(MIPS_CROSS_COMPILE))
override CROSS_COMPILE := $(MIPS_CROSS_COMPILE)
endif
# Default tools
ifeq (,$(CROSS_COMPILE))
CROSS_COMPILE := mips64_fp_be-
override PATH := $(PATH):/projects/ntsw-tools/linux/mvista/mips64_be_tools-3.1/bin
endif
# Default Linux include directory
ifeq (,$(LINUX_INCLUDE))
LINUX_INCLUDE = /projects/ntsw-tools/linux/headers/mvl-3.1-nsx64/include
endif
CFGFLAGS += -DSYS_BE_PIO=1 -DSYS_BE_PACKET=0 -DSYS_BE_OTHER=1
ENDIAN = BE_HOST=1
CFGFLAGS += -D$(ENDIAN) -Wa,-xgot -mips64 -mabi=64 -fno-strict-aliasing -DPTRS_ARE_64BITS -DLONGS_ARE_64BITS
CFGFLAGS += -DBCM_PLATFORM_STRING=\"NSX_BCM1125\"
# From linux/arch/mips/Makefile
ifeq (,$(KFLAGS))
KFLAGS := -D__KERNEL__ -O2 -fomit-frame-pointer -fno-strict-aliasing -G 0 -mno-abicalls -fno-pic -mips64 -mabi=64 -mtune=sb1 -Wa,--trap -pipe -mlong-calls
endif
ifneq ($(targetplat),user)
include ${SDK}/make/Makefile.linux-kernel
endif
MODULE_LDFLAGS += -m elf64btsmip

View File

@ -0,0 +1,127 @@
#
# Copyright 2017 Broadcom
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2, as
# published by the Free Software Foundation (the "GPL").
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
#
# $Id: Makefile.linux-nsx_wrl-2_6,v 1.15 Broadcom SDK $
# $Copyright: (c) 2007 Broadcom Corp.
# All Rights Reserved.$
ifeq (,$(WRS_LINUX_VERSION))
WRS_LINUX_VERSION=2.0
endif
# Look for custom tools
ifneq (,$(MIPS_TOOLS_DIR))
ifneq (,$(MIPS_CROSS_COMPILE))
override PATH := $(MIPS_TOOLS_DIR):$(PATH)
override CROSS_COMPILE := $(MIPS_CROSS_COMPILE)
endif
endif
# Default Linux Kernel directory
ifeq (,$(KERNDIR))
ifeq (1.4,$(WRS_LINUX_VERSION))
ifeq (,$(CROSS_COMPILE))
CROSS_COMPILE := mips-wrs-linux-gnu-
endif
KERNDIR := /projects/ntsw-tools/linux/wrslinux_1.4/broadcom_bcm91125cpci_32_be_glibc_std/build/linux-2.6.14-cgl
export WIND_LIC_PROXY = /projects/ntsw-tools/wrs/wrs_linux/GPP_LE_1.4_PPR/setup/x86-linux2/bin
override PATH := /projects/ntsw-tools/wrs/wrs_linux/GPP_LE_1.4_PPR/gnu/3.4.4-wrlinux-1.4/x86-linux2/bin:$(PATH)
else
ifeq (2.0,$(WRS_LINUX_VERSION))
ifeq (,$(CROSS_COMPILE))
CROSS_COMPILE := mips-wrs-linux-gnu-mips-glibc_std-
endif
KERNDIR:= /projects/ntsw-tools/linux/wrslinux_2.0/nsx/glibc_std/build/linux-2.6.21-standard
WRLINUX_BASE=/tools/windriver/linux_ed/2.0_GA/Linux
TOOLCHAIN_BIN_DIR=$(KERNDIR)/../../host-cross/mips-wrs-linux-gnu/bin
WIND_LIC_PROXY=$(WRLINUX_BASE)/setup/x86-linux2/bin
WRLINUX_GNU_PATH=$(WRLINUX_BASE)/gnu/4.1-wrlinux-2.0/x86-linux2/bin
override PATH:=$(KERNDIR)/../../host-cross/bin:$(KERNDIR)/../../host-cross/mips-wrs-linux-gnu/bin:$(WRLINUX_GNU_PATH):$(PATH)
WRS_SYSROOT_PATH := $(WRLINUX_GNU_PATH)/../lib/gcc/mips-wrs-linux-gnu/4.1.2/include
export TOOLCHAIN_BIN_DIR WIND_LIC_PROXY
comma = ,
basetarget = $(basename $(notdir $@))
modname = $(basetarget)
# Extra variables.
EXTRA_CFLAGS = -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags)
name-fix = $(subst $(comma),_,$(subst -,_,$1))
basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))"
modname_flags = $(if $(filter 1,$(words $(modname))),\
-D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))")
endif
endif
endif
# Default Linux include directory
ifeq (,$(LINUX_INCLUDE))
LINUX_INCLUDE := $(KERNDIR)/include
endif
CFGFLAGS += -DSYS_BE_PIO=1 -DSYS_BE_PACKET=0 -DSYS_BE_OTHER=1
ENDIAN = BE_HOST=1
CFGFLAGS += -D$(ENDIAN)
CFGFLAGS += -DBCM_PLATFORM_STRING=\"NSX_BCM1125\"
ARCH = mips
KBUILD_VERBOSE = 1
export ARCH KBUILD_VERBOSE
ifeq (1.4,$(WRS_LINUX_VERSION))
# From Linux Kbuild output
ifeq (,$(KFLAGS))
KFLAGS := -D__KERNEL__ -Iinclude -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -ffreestanding -O2 -fomit-frame-pointer -g -G 0 -mno-abicalls -fno-pic -pipe -finline-limit=100000 -mabi=32 -march=sb1 -Wa,-32 -Wa,-march=sb1 -Wa,-mips64 -Wa,--trap -DSIBYTE_HDR_FEATURES=SIBYTE_HDR_FMASK_1250_112x_ALL -mlong-calls
#-Wdeclaration-after-statement
endif
else
ifeq (2.0,$(WRS_LINUX_VERSION))
ifeq (,$(KFLAGS))
KFLAGS := -D__KERNEL__ -nostdinc -isystem $(WRS_SYSROOT_PATH) -I$(LINUX_INCLUDE) -include $(LINUX_INCLUDE)/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -mabi=32 -G 0 -mno-abicalls -fno-pic -pipe -msoft-float -ffreestanding -march=sb1 -Wa,--trap -Iinclude/asm-mips/mach-sibyte -Iinclude/asm-mips/mach-generic -DSIBYTE_HDR_FEATURES=SIBYTE_HDR_FMASK_1250_112x_ALL -fomit-frame-pointer -g -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -mlong-calls
endif
endif
endif
ifneq ($(targetplat),user)
include ${SDK}/make/Makefile.linux-kernel-2_6
endif
ifneq (,$(findstring TCL,$(FEATURE_LIST)))
LINK_STATIC=0
export LINK_STATIC
endif

View File

@ -0,0 +1,53 @@
#
# Copyright 2017 Broadcom
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2, as
# published by the Free Software Foundation (the "GPL").
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
#
# $Id: Makefile.linux-raptor,v 1.6 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp.
# All Rights Reserved.$
# Look for custom tools
ifneq (,$(MIPS_TOOLS_DIR))
override PATH := $(MIPS_TOOLS_DIR):$(PATH)
endif
ifneq (,$(MIPS_CROSS_COMPILE))
override CROSS_COMPILE := $(MIPS_CROSS_COMPILE)
endif
# Default tools
ifeq (,$(CROSS_COMPILE))
CROSS_COMPILE := mips_fp_be-
override PATH := $(PATH):/projects/ntsw-tools/linux/mvista/mvista-3.1/pro/devkit/mips/fp_be/bin
endif
# Default Linux include directory
ifeq (,$(LINUX_INCLUDE))
LINUX_INCLUDE = /projects/ntsw-tools/linux/headers/mvl-3.1-raptor/include
endif
CFGFLAGS += -DSYS_BE_PIO=0 -DSYS_BE_PACKET=1 -DSYS_BE_OTHER=0 -DBCM_ICS
ENDIAN = BE_HOST=1
CFGFLAGS += -D$(ENDIAN)
CFGFLAGS += -DBCM_PLATFORM_STRING=\"Raptor_BCM56218\"
ifneq ($(targetplat),user)
include ${SDK}/make/Makefile.linux-kernel
endif
# From linux/arch/mips/Makefile
ifeq (,$(KFLAGS))
KFLAGS := -D__KERNEL__ -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -G 0 -mno-abicalls -fno-pic -pipe -m$(gcc-tune-flag)=r4600 -mips2 -Wa,--trap -mlong-calls
endif

View File

@ -0,0 +1,172 @@
#
# Copyright 2017 Broadcom
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2, as
# published by the Free Software Foundation (the "GPL").
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
#
# $Id: Makefile.linux-raptor-2_6,v 1.21 Broadcom SDK $
# $Copyright: (c) 2007 Broadcom Corp.
# All Rights Reserved.$
# User must select one platform from below.By default WR_LINUX is selected. .
ifeq (,$(BUILD_PLATFORM))
#BUILD_PLATFORM=ELDK
BUILD_PLATFORM=WR_LINUX
endif
# Specify the KERNEL VERSION you want to use for building SDK.
ifeq (ELDK,$(BUILD_PLATFORM))
ifeq (,$(KERN_VER))
KERN_VER=2.6.21.7
endif
endif
# Specify the Windriver Linux version here.For example '2.0' as shown below.
ifeq (WR_LINUX,$(BUILD_PLATFORM))
ifeq (,$(WRS_LINUX_VERSION))
WRS_LINUX_VERSION=2.0
endif
endif
# Default Linux Kernel directory
ifeq (WR_LINUX,$(BUILD_PLATFORM))
ifeq (1.4,$(WRS_LINUX_VERSION))
KERNDIR ?= /projects/ntsw-tools/linux/wrslinux_1.4/broadcom_bcm95621x_be/build/linux-2.6.14-small
ifeq (,$(CROSS_COMPILE))
CROSS_COMPILE := mips-wrs-linux-gnu-
endif
export WIND_LIC_PROXY = /projects/ntsw-tools/wrs/wrs_linux/GPP_LE_1.4_PPR/setup/x86-linux2/bin
override PATH := /projects/ntsw-tools/wrs/wrs_linux/GPP_LE_1.4_PPR/gnu/3.4.4-wrlinux-1.4/x86-linux2/bin:$(PATH)
endif
ifeq (2.0,$(WRS_LINUX_VERSION))
ifeq (,$(CROSS_COMPILE))
CROSS_COMPILE := mips-wrs-linux-gnu-mips_softfp-glibc_std-
endif
KERNDIR ?= /projects/ntsw-tools/linux/wrslinux_2.0/ntswics/glibc_std/build/linux-2.6.21-standard
override PATH:=$(KERNDIR)/../../host-cross/bin:$(KERNDIR)/../../host-cross/mips-wrs-linux-gnu/bin:$(WRLINUX_GNU_PATH):$(PATH)
endif
WRLINUX_BASE=/tools/windriver/linux_ed/2.0_GA/Linux
TOOLCHAIN_BIN_DIR=$(KERNDIR)/../../host-cross/mips-wrs-linux-gnu/bin
WIND_LIC_PROXY=$(WRLINUX_BASE)/setup/x86-linux2/bin
WRLINUX_GNU_PATH=$(WRLINUX_BASE)/gnu/4.1-wrlinux-2.0/x86-linux2/bin
override PATH:=$(KERNDIR)/../../host-cross/bin:$(KERNDIR)/../../host-cross/mips-wrs-linux-gnu/bin:$(WRLINUX_GNU_PATH):$(PATH)
WRS_SYSROOT_PATH := $(WRLINUX_GNU_PATH)/../lib/gcc/mips-wrs-linux-gnu/4.1.2/include
export TOOLCHAIN_BIN_DIR WIND_LIC_PROXY
endif
ifeq (ELDK,$(BUILD_PLATFORM))
ifeq (2.6.21.7, $(KERN_VER))
ifeq (,$(CROSS_COMPILE))
CROSS_COMPILE := mips_4KC-
endif
override PATH := /tools/eldk/4.1/usr/bin:$(PATH)
KERNDIR ?= /projects/ntsw-tools/linux/eldk/raptor_eldk/linux-2.6.21.7
endif
endif
comma = ,
basetarget = $(basename $(notdir $@))
modname = $(basetarget)
# Extra variables.
EXTRA_CFLAGS = -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags)
name-fix = $(subst $(comma),_,$(subst -,_,$1))
basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))"
modname_flags = $(if $(filter 1,$(words $(modname))),\
-D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))")
# Default Linux include directory
ifeq (,$(LINUX_INCLUDE))
LINUX_INCLUDE := $(KERNDIR)/include
endif
CFGFLAGS += -DSYS_BE_PIO=0 -DSYS_BE_PACKET=1 -DSYS_BE_OTHER=0 -DBCM_ICS
ENDIAN = BE_HOST=1
CFGFLAGS += -D$(ENDIAN) -DRAPTOR
CFGFLAGS += -DBCM_PLATFORM_STRING=\"Raptor_BCM56218\"
ARCH = mips
KBUILD_VERBOSE = 1
export ARCH KBUILD_VERBOSE
ifeq (ELDK,$(BUILD_PLATFORM))
KFLAG_INCLD = /tools/eldk/4.1/usr/lib/gcc/mips-linux/4.0.0/include
endif
# From linux/arch/mips/Makefile
ifeq (WR_LINUX,$(BUILD_PLATFORM))
ifeq (1.4,$(WRS_LINUX_VERSION))
ifeq (,$(KFLAGS))
KFLAGS := -D__KERNEL__ -Wall -Wno-trigraphs -fno-strict-aliasing -fno-common -ffreestanding -O2 -fomit-frame-pointer -g -G 0 -mno-abicalls -fno-pic -pipe -march=mips32 -Wa,-mips32 -Wa,--trap -funit-at-a-time -mlong-calls -Wundef -finline-limit=100000 -mabi=32
endif
endif
ifeq (2.0,$(WRS_LINUX_VERSION))
ifeq (,$(KFLAGS))
KFLAGS := -D__KERNEL__ -nostdinc -isystem $(WRS_SYSROOT_PATH) -I$(LINUX_INCLUDE) -include $(LINUX_INCLUDE)/linux/autoconf.h -I$(KERNDIR)/arch/mips/mach-bcm56218 -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -mabi=32 -G 0 -mno-abicalls -fno-pic -pipe -msoft-float -ffreestanding -march=mips32 -Wa,-mips32 -Wa,--trap -Iinclude/asm-mips/mach-bcm56218 -Iinclude/asm-mips/mach-generic -fomit-frame-pointer -g -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -mlong-calls
endif
endif
endif
ifeq (ELDK,$(BUILD_PLATFORM))
ifeq (,$(KFLAGS))
KFLAGS := -D__KERNEL__ -nostdinc -isystem $(KFLAG_INCLD) -I$(LINUX_INCLUDE) -include $(LINUX_INCLUDE)/linux/autoconf.h -I$(KERNDIR)/arch/mips/mach-bcm56218 -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -mabi=32 -G 0 -mno-abicalls -fno-pic -pipe -msoft-float -ffreestanding -march=mips32 -Wa,-mips32 -Wa,--trap -Iinclude/asm-mips/mach-bcm56218 -Iinclude/asm-mips/mach-generic -fomit-frame-pointer -g -Wdeclaration-after-statement -mlong-calls
endif
endif
ifneq ($(targetplat),user)
include ${SDK}/make/Makefile.linux-kernel-2_6
endif
ifneq (,$(findstring TCL,$(FEATURE_LIST)))
LINK_STATIC=0
export LINK_STATIC
endif

View File

@ -1,18 +1,17 @@
# #
# Unless you and Broadcom execute a separate written software license # Copyright 2017 Broadcom
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
# #
# As a special exception, the copyright holders of this software give # This program is free software; you can redistribute it and/or modify
# you permission to link this software with independent modules, and to # it under the terms of the GNU General Public License, version 2, as
# copy and distribute the resulting executable under terms of your # published by the Free Software Foundation (the "GPL").
# choice, provided that you also meet, for each linked independent #
# module, the terms and conditions of the license of that module. An # This program is distributed in the hope that it will be useful, but
# independent module is a module which is not derived from this # WITHOUT ANY WARRANTY; without even the implied warranty of
# software. The special exception does not apply to any modifications # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# of the software. # General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
# #
# $Id: Makefile.linux-x86-common-2_6,v 1.13 Broadcom SDK $ # $Id: Makefile.linux-x86-common-2_6,v 1.13 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp. # $Copyright: (c) 2005 Broadcom Corp.
@ -23,7 +22,7 @@ ENDIAN = LE_HOST=1
CFGFLAGS += -D$(ENDIAN) CFGFLAGS += -D$(ENDIAN)
CFGFLAGS += -DBCM_PLATFORM_STRING=\"X86\" CFGFLAGS += -DBCM_PLATFORM_STRING=\"X86\"
ifeq (,$(findstring -DSAL_BDE_DMA_MEM_DEFAULT,$(CFGFLAGS))) ifeq (,$(findstring -DSAL_BDE_DMA_MEM_DEFAULT,$(CFGFLAGS)))
CFGFLAGS += -DSAL_BDE_DMA_MEM_DEFAULT=16 CFGFLAGS += -DSAL_BDE_DMA_MEM_DEFAULT=32
endif endif
# Extra variables. # Extra variables.

View File

@ -1,18 +1,17 @@
# #
# Unless you and Broadcom execute a separate written software license # Copyright 2017 Broadcom
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
# #
# As a special exception, the copyright holders of this software give # This program is free software; you can redistribute it and/or modify
# you permission to link this software with independent modules, and to # it under the terms of the GNU General Public License, version 2, as
# copy and distribute the resulting executable under terms of your # published by the Free Software Foundation (the "GPL").
# choice, provided that you also meet, for each linked independent #
# module, the terms and conditions of the license of that module. An # This program is distributed in the hope that it will be useful, but
# independent module is a module which is not derived from this # WITHOUT ANY WARRANTY; without even the implied warranty of
# software. The special exception does not apply to any modifications # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# of the software. # General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
# #
# $Id: Makefile.linux-x86-generic-common-2_6,v 1.2 Broadcom SDK $ # $Id: Makefile.linux-x86-generic-common-2_6,v 1.2 Broadcom SDK $
# $Copyright: (c) 2008 Broadcom Corp. # $Copyright: (c) 2008 Broadcom Corp.

View File

@ -1,18 +1,17 @@
# #
# Unless you and Broadcom execute a separate written software license # Copyright 2017 Broadcom
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
# #
# As a special exception, the copyright holders of this software give # This program is free software; you can redistribute it and/or modify
# you permission to link this software with independent modules, and to # it under the terms of the GNU General Public License, version 2, as
# copy and distribute the resulting executable under terms of your # published by the Free Software Foundation (the "GPL").
# choice, provided that you also meet, for each linked independent #
# module, the terms and conditions of the license of that module. An # This program is distributed in the hope that it will be useful, but
# independent module is a module which is not derived from this # WITHOUT ANY WARRANTY; without even the implied warranty of
# software. The special exception does not apply to any modifications # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# of the software. # General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
# #
# $Id: Makefile.linux-x86-smp_generic_64-2_6,v 1.5 Broadcom SDK $ # $Id: Makefile.linux-x86-smp_generic_64-2_6,v 1.5 Broadcom SDK $
# $Copyright: (c) 2008 Broadcom Corp. # $Copyright: (c) 2008 Broadcom Corp.
@ -29,17 +28,19 @@ ifeq (,$(KFLAGS))
KFLAGS := -nostdinc -isystem $(SYSINC) -I$(KERNDIR)/include -I$(KERNDIR)/arch/x86/include -include $(AUTOCONF) -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -Os -m64 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-stack-protector -fomit-frame-pointer -g -Wdeclaration-after-statement -Wno-pointer-sign KFLAGS := -nostdinc -isystem $(SYSINC) -I$(KERNDIR)/include -I$(KERNDIR)/arch/x86/include -include $(AUTOCONF) -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -Os -m64 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-stack-protector -fomit-frame-pointer -g -Wdeclaration-after-statement -Wno-pointer-sign
endif endif
KFLAGS += -I$(LINUX_INCLUDE)/uapi -I$(LINUX_INCLUDE)/generated/uapi -I$(KERNDIR)/arch/x86/include/generated -I$(KERNDIR)/arch/x86/include/uapi -I$(KERNDIR)/arch/x86/include/generated/uapi ifeq ($(LINUX_MAKE_SHARED_LIB), 1)
ifeq ($(LINUX_MAKE_SHARED_LIB),1)
KFLAGS += -fPIC -mcmodel=small KFLAGS += -fPIC -mcmodel=small
else else
KFLAGS += -mcmodel=kernel -fno-pie KFLAGS += -fno-pie -mcmodel=kernel
endif endif
LINUX_UAPI = $(LINUX_INCLUDE)/uapi
KFLAGS += -I$(LINUX_INCLUDE)/uapi -I$(LINUX_INCLUDE)/generated/uapi -I$(KERNDIR)/arch/x86/include/generated -I$(KERNDIR)/arch/x86/include/uapi -I$(KERNDIR)/arch/x86/include/generated/uapi
ifeq (1,$(DEBIAN_LINUX_HEADER)) ifeq (1,$(DEBIAN_LINUX_HEADER))
KERNDIR_COMMON := $(subst amd64,common,$(KERNDIR)) KERNDIR_COMMON := $(subst amd64,common,$(KERNDIR))
KFLAGS += -I$(KERNDIR_COMMON)/include -I$(KERNDIR_COMMON)/include/uapi -I$(KERNDIR_COMMON)/arch/x86/include -I$(KERNDIR_COMMON)/arch/x86/include/uapi KFLAGS += -I$(KERNDIR_COMMON)/include -I$(KERNDIR_COMMON)/include/uapi -I$(KERNDIR_COMMON)/arch/x86/include -I$(KERNDIR_COMMON)/arch/x86/include/uapi
endif endif
include ${SDK}/make/Makefile.linux-x86-common-2_6 include ${SDK}/make/Makefile.linux-x86-common-2_6

View File

@ -1,18 +1,17 @@
/* /*
* Unless you and Broadcom execute a separate written software license * Copyright 2017 Broadcom
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
* *
* As a special exception, the copyright holders of this software give * This program is free software; you can redistribute it and/or modify
* you permission to link this software with independent modules, and to * it under the terms of the GNU General Public License, version 2, as
* copy and distribute the resulting executable under terms of your * published by the Free Software Foundation (the "GPL").
* choice, provided that you also meet, for each linked independent *
* module, the terms and conditions of the license of that module. An * This program is distributed in the hope that it will be useful, but
* independent module is a module which is not derived from this * WITHOUT ANY WARRANTY; without even the implied warranty of
* software. The special exception does not apply to any modifications * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* of the software. * General Public License version 2 (GPLv2) for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 (GPLv2) along with this source code.
*/ */
/*********************************************************************** /***********************************************************************
* *
@ -198,6 +197,11 @@ extern void *lkbde_get_dma_dev(int d);
*/ */
extern void *lkbde_get_hw_dev(int d); extern void *lkbde_get_hw_dev(int d);
/*
* Backdoor to retrieve number of switch devices probed.
*/
extern int lkbde_get_num_devices(int type);
/* /*
* Retrive the device state from Kernel BDE. * Retrive the device state from Kernel BDE.
* Used for KNET and User BDE for pci hot swap case. * Used for KNET and User BDE for pci hot swap case.
@ -230,6 +234,12 @@ extern int lkbde_cpu_pci_register(int d);
* a secondary device driver. * a secondary device driver.
*/ */
#define LKBDE_ISR2_DEV 0x8000 #define LKBDE_ISR2_DEV 0x8000
/*
* This flag should be OR'ed onto the device number when calling
* irq_mask_set functions from a secondary device driver if the
* mask register is iProc register.
*/
#define LKBDE_IPROC_REG 0x4000
#if defined(BCM_PETRA_SUPPORT) || defined(BCM_DFE_SUPPORT) #if defined(BCM_PETRA_SUPPORT) || defined(BCM_DFE_SUPPORT)
#include <linux/version.h> #include <linux/version.h>

View File

@ -1,18 +1,17 @@
/* /*
* Unless you and Broadcom execute a separate written software license * Copyright 2017 Broadcom
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
* *
* As a special exception, the copyright holders of this software give * This program is free software; you can redistribute it and/or modify
* you permission to link this software with independent modules, and to * it under the terms of the GNU General Public License, version 2, as
* copy and distribute the resulting executable under terms of your * published by the Free Software Foundation (the "GPL").
* choice, provided that you also meet, for each linked independent *
* module, the terms and conditions of the license of that module. An * This program is distributed in the hope that it will be useful, but
* independent module is a module which is not derived from this * WITHOUT ANY WARRANTY; without even the implied warranty of
* software. The special exception does not apply to any modifications * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* of the software. * General Public License version 2 (GPLv2) for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 (GPLv2) along with this source code.
*/ */
/*********************************************************************** /***********************************************************************
* *
@ -59,7 +58,7 @@
#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
#endif #endif
extern void _dma_init(int robo_switch); extern void _dma_init(int robo_switch, int dev_index);
extern int _dma_cleanup(void); extern int _dma_cleanup(void);
extern void _dma_pprint(void); extern void _dma_pprint(void);
extern uint32_t *_salloc(int d, int size, const char *name); extern uint32_t *_salloc(int d, int size, const char *name);

View File

@ -1,18 +1,17 @@
/* /*
* Unless you and Broadcom execute a separate written software license * Copyright 2017 Broadcom
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
* *
* As a special exception, the copyright holders of this software give * This program is free software; you can redistribute it and/or modify
* you permission to link this software with independent modules, and to * it under the terms of the GNU General Public License, version 2, as
* copy and distribute the resulting executable under terms of your * published by the Free Software Foundation (the "GPL").
* choice, provided that you also meet, for each linked independent *
* module, the terms and conditions of the license of that module. An * This program is distributed in the hope that it will be useful, but
* independent module is a module which is not derived from this * WITHOUT ANY WARRANTY; without even the implied warranty of
* software. The special exception does not apply to any modifications * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* of the software. * General Public License version 2 (GPLv2) for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 (GPLv2) along with this source code.
*/ */
/* /*
* $Id: mpool.h,v 1.2 Broadcom SDK $ * $Id: mpool.h,v 1.2 Broadcom SDK $

View File

@ -1,18 +1,17 @@
# #
# Unless you and Broadcom execute a separate written software license # Copyright 2017 Broadcom
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
# #
# As a special exception, the copyright holders of this software give # This program is free software; you can redistribute it and/or modify
# you permission to link this software with independent modules, and to # it under the terms of the GNU General Public License, version 2, as
# copy and distribute the resulting executable under terms of your # published by the Free Software Foundation (the "GPL").
# choice, provided that you also meet, for each linked independent #
# module, the terms and conditions of the license of that module. An # This program is distributed in the hope that it will be useful, but
# independent module is a module which is not derived from this # WITHOUT ANY WARRANTY; without even the implied warranty of
# software. The special exception does not apply to any modifications # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# of the software. # General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
# #
# -*- Makefile -*- # -*- Makefile -*-
# $Id: Makefile,v 1.18 Broadcom SDK $ # $Id: Makefile,v 1.18 Broadcom SDK $

View File

@ -1,18 +1,17 @@
/* /*
* Unless you and Broadcom execute a separate written software license * Copyright 2017 Broadcom
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
* *
* As a special exception, the copyright holders of this software give * This program is free software; you can redistribute it and/or modify
* you permission to link this software with independent modules, and to * it under the terms of the GNU General Public License, version 2, as
* copy and distribute the resulting executable under terms of your * published by the Free Software Foundation (the "GPL").
* choice, provided that you also meet, for each linked independent *
* module, the terms and conditions of the license of that module. An * This program is distributed in the hope that it will be useful, but
* independent module is a module which is not derived from this * WITHOUT ANY WARRANTY; without even the implied warranty of
* software. The special exception does not apply to any modifications * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* of the software. * General Public License version 2 (GPLv2) for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 (GPLv2) along with this source code.
*/ */
/* /*
* $Id: linux-kernel-bde.c,v 1.414 Broadcom SDK $ * $Id: linux-kernel-bde.c,v 1.414 Broadcom SDK $
@ -482,7 +481,7 @@ robo_spi_write(void *cookie, uint16_t reg, uint8_t *buf, int len);
/* PLX PCI-E Switch */ /* PLX PCI-E Switch */
#define PLX_PEX8608_DEV_ID 0x8608 #define PLX_PEX8608_DEV_ID 0x8608
#define PLX_PEX8617_DEV_ID 0x8617 #define PLX_PEX8617_DEV_ID 0x8617
#define PLX_PEX86XX_DEV_CTRL_REG 0x70 #define PLX_PEX86XX_DEV_CTRL_REG 0x70
/* Broadcom BCM58525 */ /* Broadcom BCM58525 */
#define BCM58525_PCI_VENDOR_ID 0x14E4 #define BCM58525_PCI_VENDOR_ID 0x14E4
@ -541,6 +540,40 @@ _parse_eb_args(char *str, char * format, ...)
return 0; return 0;
} }
static void
_bde_add_device(void)
{
/*
* In order to be backward compatible with the user mode BDE
* (specifically the interrupt IOCTLs) and the CM, switch devices
* *must* come first. If this is not the case (due to the probing
* order), we let the non-switch device(s) drop down to the end of
* the device array.
*/
if (_switch_ndevices > 0) {
bde_ctrl_t tmp_dev;
int i, s = 0;
while (s < _switch_ndevices) {
if (_devices[s].dev_type & BDE_SWITCH_DEV_TYPE) {
s++;
continue;
}
tmp_dev = _devices[s];
for (i = s; i < _ndevices - 1; i++) {
_devices[i] = _devices[i+1];
}
_devices[i] = tmp_dev;
}
}
/* Initialize device locks and dma */
if (_ndevices > 0) {
spin_lock_init(&_devices[_ndevices-1].lock);
_dma_init(robo_switch, _ndevices-1);
}
}
static int static int
_eb_device_create(resource_size_t paddr, int irq, int rd_hw, int wr_hw) _eb_device_create(resource_size_t paddr, int irq, int rd_hw, int wr_hw)
{ {
@ -576,6 +609,8 @@ _eb_device_create(resource_size_t paddr, int irq, int rd_hw, int wr_hw)
ctrl->isr = NULL; ctrl->isr = NULL;
ctrl->isr_data = NULL; ctrl->isr_data = NULL;
_bde_add_device();
gprintk("Created EB device at BA=%x IRQ=%d RD16=%d WR16=%d device=0x%x\n", gprintk("Created EB device at BA=%x IRQ=%d RD16=%d WR16=%d device=0x%x\n",
(unsigned int)paddr, irq, rd_hw, wr_hw, ctrl->bde_dev.device); (unsigned int)paddr, irq, rd_hw, wr_hw, ctrl->bde_dev.device);
@ -628,6 +663,10 @@ sand_device_create(void)
ctrl->dev_type |= BDE_PCI_DEV_TYPE | BDE_SWITCH_DEV_TYPE; ctrl->dev_type |= BDE_PCI_DEV_TYPE | BDE_SWITCH_DEV_TYPE;
} }
#ifndef __DUNE_LINUX_BCM_CPU_PCIE__
_bde_add_device();
#endif
return 0; return 0;
} }
#endif #endif
@ -721,7 +760,7 @@ iproc_cmicd_probe(struct platform_device *pldev)
#endif #endif
{ {
/* Assign locally if not available from device node */ /* Assign locally if not available from device node */
iproc_cmicd_get_irqres(ctrl->bde_dev, &pldev->resource[0]); iproc_cmicd_get_irqres(ctrl->bde_dev, &pldev->resource[0]);
} }
irqres = iproc_platform_get_resource(pldev, IORESOURCE_IRQ, 0); irqres = iproc_platform_get_resource(pldev, IORESOURCE_IRQ, 0);
@ -735,6 +774,7 @@ iproc_cmicd_probe(struct platform_device *pldev)
#endif #endif
/* Let's boogie */ /* Let's boogie */
_bde_add_device();
return 0; return 0;
} }
@ -992,6 +1032,7 @@ _ics_bde_create(void)
ctrl->isr = NULL; ctrl->isr = NULL;
ctrl->isr_data = NULL; ctrl->isr_data = NULL;
_bde_add_device();
printk("Created ICS device ..%x\n", ctrl->bde_dev.base_address); printk("Created ICS device ..%x\n", ctrl->bde_dev.base_address);
} }
@ -1007,7 +1048,7 @@ extern struct pci_bus *pci_find_bus(int domain, int busnr);
* Populated from the include/soc/devids.h file. * Populated from the include/soc/devids.h file.
*/ */
static struct pci_device_id _id_table[] = { static const struct pci_device_id _id_table[] = {
{ BROADCOM_VENDOR_ID, BCM5675_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM5675_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM5676_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM5676_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM56218X_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56218X_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
@ -1327,6 +1368,7 @@ static struct pci_device_id _id_table[] = {
{ BROADCOM_VENDOR_ID, BCM56971_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56971_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM56972_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56972_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM56974_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56974_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM56975_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM56168_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56168_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM56169_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56169_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM56560_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56560_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
@ -1335,8 +1377,13 @@ static struct pci_device_id _id_table[] = {
{ BROADCOM_VENDOR_ID, BCM56565_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56565_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM56566_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56566_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM56567_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56567_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM56670_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM56671_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM56672_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM56675_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM56568_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56568_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM56760_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56760_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM56761_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM56762_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56762_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM56764_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56764_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM56765_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56765_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
@ -1419,6 +1466,7 @@ static struct pci_device_id _id_table[] = {
{ BROADCOM_VENDOR_ID, BCM88272_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88272_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM88273_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88273_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM88278_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88278_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM88279_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM8206_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM8206_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
@ -1471,6 +1519,20 @@ static struct pci_device_id _id_table[] = {
#endif #endif
#ifdef BCM_DNXF_SUPPORT #ifdef BCM_DNXF_SUPPORT
{ BROADCOM_VENDOR_ID, BCM88790_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88790_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM88791_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM88792_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM88793_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM88794_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM88795_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM88796_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM88797_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM88798_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM88799_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM8879A_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM8879B_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM8879C_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM8879D_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM8879F_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
#endif #endif
{ BROADCOM_VENDOR_ID, BCM56860_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56860_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM56861_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56861_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
@ -1484,10 +1546,17 @@ static struct pci_device_id _id_table[] = {
{ BROADCOM_VENDOR_ID, BCM56832_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56832_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM56836_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56836_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM56870_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56870_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM56980_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM56873_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56873_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM53540_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM53547_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM53548_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ BROADCOM_VENDOR_ID, BCM53549_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID },
{ 0, 0, 0, 0 } { 0, 0, 0, 0 }
};; };;
MODULE_DEVICE_TABLE(pci, _id_table);
#define pci_bus_b(n) list_entry(n, struct pci_bus, node) #define pci_bus_b(n) list_entry(n, struct pci_bus, node)
#define pci_dev_b(n) list_entry(n, struct pci_dev, bus_list) #define pci_dev_b(n) list_entry(n, struct pci_dev, bus_list)
#define MAX_RC_NUM 4 #define MAX_RC_NUM 4
@ -2403,18 +2472,15 @@ _pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
#endif /* BCM_DFE_SUPPORT */ #endif /* BCM_DFE_SUPPORT */
#if defined(BCM_DNXF_SUPPORT) #if defined(BCM_DNXF_SUPPORT)
switch (dev->device) { /*All Ramon devices from 0x8790 to 0x879F*/
case BCM88790_DEVICE_ID: if ((dev->device & BCM_DNXF_DEVID_MASK) == BCM88790_DEVICE_ID) {
/* /*
* For DMA transactions - set Max_Payload_Size and * For DMA transactions - set Max_Payload_Size and
* Max_Read_Request_Size to 128 bytes. * Max_Read_Request_Size to 128 bytes.
*/ */
pci_write_config_byte(dev, 0xb5, 0x0c); pci_write_config_byte(dev, 0xb5, 0x0c);
pci_write_config_byte(dev, 0xb4, 0x0); pci_write_config_byte(dev, 0xb4, 0x0);
break;
default:
break;
} }
#endif #endif
@ -2539,24 +2605,6 @@ _pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
/* Save shared BDE HAL in device structure */ /* Save shared BDE HAL in device structure */
memcpy(&ctrl->shbde, shbde, sizeof(ctrl->shbde)); memcpy(&ctrl->shbde, shbde, sizeof(ctrl->shbde));
#if defined(VENDOR_BROADCOM)
#if defined(BCM_PLX9656_LOCAL_BUS) && defined(SHADOW_SVK)
if (num_plx) {
sal_vaddr_t base_address;
uint32 intr_enable;
paddr = pci_resource_start(dev, 0);
bar_len = pci_resource_len(dev, 0);
base_address = (sal_vaddr_t)IOREMAP(paddr, bar_len);
intr_enable = readl((uint32 *)(base_address + 0x68));
gprintk("PLX Interrupt ENABLE: %x\n", intr_enable);
intr_enable |= 0x00080000;
writel(intr_enable, (uint32 *)(base_address + 0x68));
gprintk("PLX Interrupt ENABLE: %x\n", intr_enable);
}
#endif
#endif
/* /*
* Since the GMAC driver of Robo chips needs access to the * Since the GMAC driver of Robo chips needs access to the
@ -2604,9 +2652,12 @@ _pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
/* Check if we need 256 KB memory window (default is 64 KB) */ /* Check if we need 256 KB memory window (default is 64 KB) */
bar_len = pci_resource_len(dev, baroff); bar_len = pci_resource_len(dev, baroff);
if ((bar_len == 0x40000) || (bar_len == 0x800000)) { if (bar_len == 0x40000) {
ctrl->dev_type |= BDE_256K_REG_SPACE; ctrl->dev_type |= BDE_256K_REG_SPACE;
if (debug >= 1) gprintk("PCI resource len 256K\n"); if (debug >= 1) gprintk("PCI resource len 256K\n");
} else if (bar_len == 0x800000) {
ctrl->dev_type |= BDE_256K_REG_SPACE | BDE_8MB_REG_SPACE;
if (debug >= 1) gprintk("PCI resource len 8MB\n");
} }
#if defined (BCM_ROBO_SUPPORT) && !defined(ALTA_ROBO_SPI) #if defined (BCM_ROBO_SUPPORT) && !defined(ALTA_ROBO_SPI)
@ -2620,6 +2671,10 @@ _pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
ctrl->dma_dev = &dev->dev; ctrl->dma_dev = &dev->dev;
#endif #endif
if (!rescan) {
_bde_add_device();
}
if (debug >= 2) { if (debug >= 2) {
gprintk("_pci_probe: configured dev:0x%x rev:0x%x with base_addresses: 0x%lx 0x%lx\n", gprintk("_pci_probe: configured dev:0x%x rev:0x%x with base_addresses: 0x%lx 0x%lx\n",
(unsigned)ctrl->bde_dev.device, (unsigned)ctrl->bde_dev.rev, (unsigned)ctrl->bde_dev.device, (unsigned)ctrl->bde_dev.rev,
@ -2684,17 +2739,17 @@ _pci_remove(struct pci_dev* dev)
else else
#endif #endif
{ {
free_irq(ctrl->iLine, ctrl); free_irq(ctrl->iLine, ctrl);
} }
} }
#ifdef CONFIG_PCI_MSI #ifdef CONFIG_PCI_MSI
_msi_disconnect(ctrl); _msi_disconnect(ctrl);
#endif #endif
ctrl->isr = NULL; ctrl->isr = NULL;
ctrl->isr_data = NULL; ctrl->isr_data = NULL;
ctrl->isr2 = NULL; ctrl->isr2 = NULL;
ctrl->isr2_data = NULL; ctrl->isr2_data = NULL;
} }
static struct pci_driver _device_driver = { static struct pci_driver _device_driver = {
probe: _pci_probe, probe: _pci_probe,
@ -2959,6 +3014,7 @@ probe_robo_switch_iproc_spi(void)
ctrl->isr = NULL; ctrl->isr = NULL;
ctrl->isr_data = NULL; ctrl->isr_data = NULL;
robo_switch++; robo_switch++;
_bde_add_device();
} }
@ -3172,6 +3228,7 @@ probe_robo_switch(void)
#if defined(KEYSTONE) #if defined(KEYSTONE)
spi_freq = _spi_id_table[match_idx].spifreq; spi_freq = _spi_id_table[match_idx].spifreq;
#endif #endif
_bde_add_device();
} }
#if defined(KEYSTONE) #if defined(KEYSTONE)
@ -3217,6 +3274,8 @@ map_local_bus(uint64_t addr, uint32_t size)
ctrl->bde_dev.base_address = (sal_vaddr_t)IOREMAP(addr, size); ctrl->bde_dev.base_address = (sal_vaddr_t)IOREMAP(addr, size);
ctrl->phys_address = addr; ctrl->phys_address = addr;
_bde_add_device();
return(ctrl); return(ctrl);
} }
@ -3368,6 +3427,8 @@ map_local_bus2(bde_ctrl_t *plx_ctrl, uint32_t dev_base, uint32_t size)
ctrl->bde_dev.device = dev_rev_id >> 16; ctrl->bde_dev.device = dev_rev_id >> 16;
ctrl->bde_dev.rev = (dev_rev_id & 0xFF); ctrl->bde_dev.rev = (dev_rev_id & 0xFF);
_bde_add_device();
switch (ctrl->bde_dev.device) { switch (ctrl->bde_dev.device) {
case BCM88130_DEVICE_ID: case BCM88130_DEVICE_ID:
case BME3200_DEVICE_ID: case BME3200_DEVICE_ID:
@ -3590,8 +3651,8 @@ _init(void)
#endif #endif
{ {
/* Register platform device if no device node in dtb */ /* Register platform device if no device node in dtb */
iproc_platform_device_register(&iproc_cmicd_pdev); iproc_platform_device_register(&iproc_cmicd_pdev);
} }
} }
#endif /* IPROC_CMICD */ #endif /* IPROC_CMICD */
@ -3629,14 +3690,14 @@ _init(void)
} }
#else #else
if (use_msi > PCI_USE_INT_INTX) { if (use_msi > PCI_USE_INT_INTX) {
/* Warn if invalid configuration */ /* Warn if invalid configuration */
gprintk("MSI interrupts not supported by kernel\n"); gprintk("MSI interrupts not supported by kernel\n");
} }
use_msi = PCI_USE_INT_INTX; use_msi = PCI_USE_INT_INTX;
#endif /* CONFIG_PCI_MSI */ #endif /* CONFIG_PCI_MSI */
if (unlikely(debug >= 1)) if (unlikely(debug >= 1))
gprintk("%s(%d):use_mse = %d\n", __func__, __LINE__, use_msi); gprintk("%s(%d):use_msi = %d\n", __func__, __LINE__, use_msi);
if (spi_devid) { if (spi_devid) {
_spi_device_setup(); _spi_device_setup();
} else { } else {
@ -3689,41 +3750,6 @@ _init(void)
} }
} }
_dma_init(robo_switch);
/*
* In order to be backward compatible with the user mode BDE
* (specifically the interrupt IOCTLs) and the CM, switch devices
* *must* come first. If this is not the case (due to the probing
* order), we let the non-switch device(s) drop down to the end of
* the device array.
*/
if (_switch_ndevices > 0) {
bde_ctrl_t tmp_dev;
int i, s = 0;
while (s < _switch_ndevices) {
if (_devices[s].dev_type & BDE_SWITCH_DEV_TYPE) {
s++;
continue;
}
tmp_dev = _devices[s];
for (i = s; i < _ndevices - 1; i++) {
_devices[i] = _devices[i+1];
}
_devices[i] = tmp_dev;
}
}
/* Initialize device locks */
if (_ndevices > 0) {
int i;
for (i = 0; i < _ndevices; i++) {
spin_lock_init(&_devices[i].lock);
}
}
return 0; return 0;
} }
@ -4246,8 +4272,7 @@ _interrupt_connect(int d,
goto err_disable_msi; goto err_disable_msi;
if (unlikely(debug >= 1)) if (unlikely(debug >= 1))
gprintk("%s(%d):device# = %d, \ gprintk("%s(%d):device# = %d, irq_flags = %lu, irq = %d\n",
irq_flags = %lu, irq = %d\n",
__func__, __LINE__, d, __func__, __LINE__, d,
irq_flags, ctrl->pci_device ? ctrl->pci_device->irq : ctrl->iLine); irq_flags, ctrl->pci_device ? ctrl->pci_device->irq : ctrl->iLine);
} }
@ -4261,13 +4286,13 @@ err_disable_msi:
msi_exit: msi_exit:
#endif #endif
gprintk("could not request IRQ\n"); gprintk("could not request IRQ\n");
ctrl->isr = NULL; ctrl->isr = NULL;
ctrl->isr_data = NULL; ctrl->isr_data = NULL;
ctrl->isr2 = NULL; ctrl->isr2 = NULL;
ctrl->isr2_data = NULL; ctrl->isr2_data = NULL;
return -1; return -1;
} }
static int static int
_interrupt_disconnect(int d) _interrupt_disconnect(int d)
@ -4334,7 +4359,7 @@ _interrupt_disconnect(int d)
else else
#endif #endif
{ {
free_irq(ctrl->iLine, ctrl); free_irq(ctrl->iLine, ctrl);
} }
#ifdef CONFIG_PCI_MSI #ifdef CONFIG_PCI_MSI
if (ctrl->use_msi >= PCI_USE_INT_MSI) { if (ctrl->use_msi >= PCI_USE_INT_MSI) {
@ -5082,11 +5107,12 @@ int
lkbde_irq_mask_set(int d, uint32_t addr, uint32_t mask, uint32_t fmask) lkbde_irq_mask_set(int d, uint32_t addr, uint32_t mask, uint32_t fmask)
{ {
bde_ctrl_t *ctrl; bde_ctrl_t *ctrl;
int isr2_dev; int isr2_dev, iproc_reg;
unsigned long flags; unsigned long flags;
isr2_dev = d & LKBDE_ISR2_DEV; isr2_dev = d & LKBDE_ISR2_DEV;
d &= ~LKBDE_ISR2_DEV; iproc_reg = d & LKBDE_IPROC_REG;
d &= ~(LKBDE_ISR2_DEV | LKBDE_IPROC_REG);
if (!VALID_DEVICE(d)) { if (!VALID_DEVICE(d)) {
return -1; return -1;
@ -5105,7 +5131,12 @@ lkbde_irq_mask_set(int d, uint32_t addr, uint32_t mask, uint32_t fmask)
/* This is the primary interrupt handler */ /* This is the primary interrupt handler */
ctrl->imask = mask & ~ctrl->fmask; ctrl->imask = mask & ~ctrl->fmask;
} }
_write(d, addr, ctrl->imask | ctrl->imask2);
if (iproc_reg) {
_iproc_write(d, addr, ctrl->imask | ctrl->imask2);
} else {
_write(d, addr, ctrl->imask | ctrl->imask2);
}
spin_unlock_irqrestore(&ctrl->lock, flags); spin_unlock_irqrestore(&ctrl->lock, flags);
@ -5130,13 +5161,13 @@ lkbde_irq_mask_get(int d, uint32_t *mask, uint32_t *fmask)
{ {
bde_ctrl_t *ctrl; bde_ctrl_t *ctrl;
d &= ~LKBDE_ISR2_DEV; d &= ~(LKBDE_ISR2_DEV | LKBDE_IPROC_REG);
if (!VALID_DEVICE(d)) { if (!VALID_DEVICE(d)) {
return -1; return -1;
} }
if (mask == NULL) { if (mask == NULL || fmask == NULL) {
return -1; return -1;
} }
@ -5144,10 +5175,15 @@ lkbde_irq_mask_get(int d, uint32_t *mask, uint32_t *fmask)
*fmask = ctrl->fmask; *fmask = ctrl->fmask;
*mask = ctrl->imask | ctrl->imask2; *mask = ctrl->imask | ctrl->imask2;
return 0; return 0;
} }
int
lkbde_get_num_devices(int type)
{
return _num_devices(type);
}
/* /*
* Export functions * Export functions

View File

@ -1,18 +1,17 @@
/* /*
* Unless you and Broadcom execute a separate written software license * Copyright 2017 Broadcom
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
* *
* As a special exception, the copyright holders of this software give * This program is free software; you can redistribute it and/or modify
* you permission to link this software with independent modules, and to * it under the terms of the GNU General Public License, version 2, as
* copy and distribute the resulting executable under terms of your * published by the Free Software Foundation (the "GPL").
* choice, provided that you also meet, for each linked independent *
* module, the terms and conditions of the license of that module. An * This program is distributed in the hope that it will be useful, but
* independent module is a module which is not derived from this * WITHOUT ANY WARRANTY; without even the implied warranty of
* software. The special exception does not apply to any modifications * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* of the software. * General Public License version 2 (GPLv2) for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 (GPLv2) along with this source code.
*/ */
/* /*
* $Id: linux_dma.c,v 1.414 Broadcom SDK $ * $Id: linux_dma.c,v 1.414 Broadcom SDK $
@ -102,6 +101,10 @@
#define VIRT_TO_PAGE(p) virt_to_page((p)) #define VIRT_TO_PAGE(p) virt_to_page((p))
#endif #endif
#ifndef KMALLOC_MAX_SIZE
#define KMALLOC_MAX_SIZE (1UL << (MAX_ORDER - 1 + PAGE_SHIFT))
#endif
/* Compatibility */ /* Compatibility */
#ifdef LKM_2_4 #ifdef LKM_2_4
#define MEM_MAP_RESERVE mem_map_reserve #define MEM_MAP_RESERVE mem_map_reserve
@ -149,10 +152,17 @@ LKM_MOD_PARAM(himem, "s", charp, 0);
MODULE_PARM_DESC(himem, MODULE_PARM_DESC(himem,
"Use high memory for DMA (default no)"); "Use high memory for DMA (default no)");
/* Physical high memory address to use for DMA */
static char *himemaddr = 0;
LKM_MOD_PARAM(himemaddr, "s", charp, 0);
MODULE_PARM_DESC(himemaddr,
"Physical address to use for high memory DMA");
/* DMA memory allocation */ /* DMA memory allocation */
#define ONE_KB 1024 #define ONE_KB 1024
#define ONE_MB (1024*1024) #define ONE_MB (1024*1024)
#define ONE_GB (1024*1024*1024)
/* Default DMA memory size */ /* Default DMA memory size */
#ifdef SAL_BDE_DMA_MEM_DEFAULT #ifdef SAL_BDE_DMA_MEM_DEFAULT
@ -189,10 +199,12 @@ static phys_addr_t _cpu_pbase = 0;
*/ */
static phys_addr_t _dma_pbase = 0; static phys_addr_t _dma_pbase = 0;
static int _use_himem = 0; static int _use_himem = 0;
static unsigned long _himemaddr = 0;
static int _use_dma_mapping = 0; static int _use_dma_mapping = 0;
static LIST_HEAD(_dma_seg); static LIST_HEAD(_dma_seg);
#define DMA_DEV(n) lkbde_get_dma_dev(n) #define DMA_DEV(n) lkbde_get_dma_dev(n)
#define BDE_NUM_DEVICES(t) lkbde_get_num_devices(t)
/* /*
* Function: _find_largest_segment * Function: _find_largest_segment
@ -304,8 +316,7 @@ _alloc_dma_blocks(dma_segment_t *dseg, int blks)
return -1; return -1;
} }
start = dseg->blk_cnt; start = dseg->blk_cnt;
dseg->blk_cnt += blks; for (i = 0; i < blks; i++) {
for (i = start; i < dseg->blk_cnt; i++) {
/* /*
* Note that we cannot use pci_alloc_consistent when we * Note that we cannot use pci_alloc_consistent when we
* want to be able to map DMA memory to user space. * want to be able to map DMA memory to user space.
@ -317,9 +328,11 @@ _alloc_dma_blocks(dma_segment_t *dseg, int blks)
*/ */
addr = __get_free_pages(mem_flags, dseg->blk_order); addr = __get_free_pages(mem_flags, dseg->blk_order);
if (addr) { if (addr) {
dseg->blk_ptr[i] = addr; dseg->blk_ptr[start + i] = addr;
++dseg->blk_cnt;
} else { } else {
gprintk("DMA allocation failed\n"); gprintk("DMA allocation failed: allocated %d of %d "
"requested blocks\n", i, blks);
return -1; return -1;
} }
} }
@ -375,6 +388,10 @@ _dma_segment_alloc(size_t size, size_t blk_size)
si_meminfo(&si); si_meminfo(&si);
dseg->blk_cnt_max = (si.totalram << PAGE_SHIFT) / dseg->blk_size; dseg->blk_cnt_max = (si.totalram << PAGE_SHIFT) / dseg->blk_size;
blk_ptr_size = dseg->blk_cnt_max * sizeof(unsigned long); blk_ptr_size = dseg->blk_cnt_max * sizeof(unsigned long);
if (blk_ptr_size > KMALLOC_MAX_SIZE) {
blk_ptr_size = KMALLOC_MAX_SIZE;
dseg->blk_cnt_max = KMALLOC_MAX_SIZE / sizeof(unsigned long);
}
/* Allocate an initialize DMA block pool */ /* Allocate an initialize DMA block pool */
dseg->blk_ptr = KMALLOC(blk_ptr_size, GFP_KERNEL); dseg->blk_ptr = KMALLOC(blk_ptr_size, GFP_KERNEL);
if (dseg->blk_ptr == NULL) { if (dseg->blk_ptr == NULL) {
@ -383,7 +400,15 @@ _dma_segment_alloc(size_t size, size_t blk_size)
} }
memset(dseg->blk_ptr, 0, blk_ptr_size); memset(dseg->blk_ptr, 0, blk_ptr_size);
/* Allocate minimum number of blocks */ /* Allocate minimum number of blocks */
_alloc_dma_blocks(dseg, dseg->req_size / dseg->blk_size); if (_alloc_dma_blocks(dseg, dseg->req_size / dseg->blk_size) != 0) {
gprintk("Failed to allocate minimum number of DMA blocks\n");
/*
* _alloc_dma_blocks() returns -1 if it fails to allocate the requested
* number of blocks, but it may still have allocated something. Fall
* through and return dseg filled in with as much memory as we could
* allocate.
*/
}
/* Allocate more blocks until we have a complete segment */ /* Allocate more blocks until we have a complete segment */
do { do {
_find_largest_segment(dseg); _find_largest_segment(dseg);
@ -467,6 +492,9 @@ _pgalloc(size_t size)
} }
if (dseg->seg_size < size) { if (dseg->seg_size < size) {
/* If we didn't get the full size then forget it */ /* If we didn't get the full size then forget it */
gprintk("_pgalloc() failed to get requested size %zu: "
"only got %lu contiguous across %d blocks\n",
size, dseg->seg_size, dseg->blk_cnt);
_dma_segment_free(dseg); _dma_segment_free(dseg);
return NULL; return NULL;
} }
@ -524,8 +552,12 @@ _pgcleanup(void)
case ALLOC_TYPE_CHUNK: { case ALLOC_TYPE_CHUNK: {
struct list_head *pos, *tmp; struct list_head *pos, *tmp;
int i, ndevices;
if (_use_dma_mapping) { if (_use_dma_mapping) {
dma_unmap_single(DMA_DEV(0), (dma_addr_t)_dma_pbase, _dma_mem_size, DMA_BIDIRECTIONAL); ndevices = BDE_NUM_DEVICES(BDE_ALL_DEVICES);
for (i = 0; i < ndevices && DMA_DEV(i); i ++) {
dma_unmap_single(DMA_DEV(i), (dma_addr_t)_dma_pbase, _dma_mem_size, DMA_BIDIRECTIONAL);
}
_use_dma_mapping = 0; _use_dma_mapping = 0;
} }
list_for_each_safe(pos, tmp, &_dma_seg) { list_for_each_safe(pos, tmp, &_dma_seg) {
@ -558,7 +590,7 @@ _pgcleanup(void)
static void static void
_alloc_mpool(size_t size) _alloc_mpool(size_t size)
{ {
unsigned long pbase = 0; unsigned long pbase = 0;
#if defined(__arm__) && !defined(CONFIG_HIGHMEM) #if defined(__arm__) && !defined(CONFIG_HIGHMEM)
if (_use_himem) { if (_use_himem) {
@ -569,7 +601,11 @@ _alloc_mpool(size_t size)
if (_use_himem) { if (_use_himem) {
/* Use high memory for DMA */ /* Use high memory for DMA */
pbase = virt_to_bus(high_memory); if (_himemaddr) {
pbase = _himemaddr;
} else {
pbase = virt_to_bus(high_memory);
}
if (((pbase + (size - 1)) >> 16) > DMA_BIT_MASK(16)) { if (((pbase + (size - 1)) >> 16) > DMA_BIT_MASK(16)) {
gprintk("DMA in high memory at 0x%lx size 0x%lx is beyond the 4GB limit and not supported.\n", pbase, (unsigned long)size); gprintk("DMA in high memory at 0x%lx size 0x%lx is beyond the 4GB limit and not supported.\n", pbase, (unsigned long)size);
return; return;
@ -589,14 +625,14 @@ _alloc_mpool(size_t size)
{ {
dma_addr_t dma_handle; dma_addr_t dma_handle;
if (!(_dma_vbase = dma_alloc_coherent(DMA_DEV(0), alloc_size, &dma_handle, GFP_KERNEL)) || !dma_handle) { if (!(_dma_vbase = dma_alloc_coherent(DMA_DEV(0), alloc_size, &dma_handle, GFP_KERNEL)) || !dma_handle) {
gprintk("_alloc_mpool: Kernel failed to allocate the memory pool of size 0x%lx\n", (unsigned long)alloc_size); gprintk("failed to allocate the memory pool of size 0x%lx\n", (unsigned long)alloc_size);
return; return;
} }
pbase = dma_handle; _cpu_pbase = pbase = dma_handle;
} }
if (alloc_size != size) { if (alloc_size != size) {
gprintk("_alloc_mpool: allocated 0x%lx bytes instead of 0x%lx bytes.\n", gprintk("allocated 0x%lx bytes instead of 0x%lx bytes.\n",
(unsigned long)alloc_size, (unsigned long)size); (unsigned long)alloc_size, (unsigned long)size);
} }
size = _dma_mem_size = alloc_size; size = _dma_mem_size = alloc_size;
@ -606,27 +642,31 @@ _alloc_mpool(size_t size)
case ALLOC_TYPE_CHUNK: case ALLOC_TYPE_CHUNK:
_dma_vbase = _pgalloc(size); _dma_vbase = _pgalloc(size);
if (!_dma_vbase) {
gprintk("failed to allocate the memory pool of size 0x%lx\n", (unsigned long)size);
return;
}
_cpu_pbase = virt_to_bus(_dma_vbase);
/* Use dma_map_single to obtain DMA bus address or IOVA if iommu is present. */
if (DMA_DEV(0)) { if (DMA_DEV(0)) {
/*
* Use dma_map_single to obtain dma bus address or IOVA if iommu is present.
*/
pbase = dma_map_single(DMA_DEV(0), _dma_vbase, size, DMA_BIDIRECTIONAL); pbase = dma_map_single(DMA_DEV(0), _dma_vbase, size, DMA_BIDIRECTIONAL);
if (dma_mapping_error(DMA_DEV(0), pbase)) {
gprintk("Failed to map memory at %p\n", _dma_vbase);
_pgcleanup();
_dma_vbase = NULL;
_cpu_pbase = 0;
return;
}
_use_dma_mapping = 1; _use_dma_mapping = 1;
} else { } else {
pbase = virt_to_bus(_dma_vbase); /* Device has not been probed. */
pbase = _cpu_pbase;
} }
break; break;
default: default:
_dma_vbase = NULL; _dma_vbase = NULL;
pbase = 0;
gprintk("DMA memory allocation method dmaalloc=%d is not supported\n", dmaalloc); gprintk("DMA memory allocation method dmaalloc=%d is not supported\n", dmaalloc);
} return;
_dma_pbase = pbase;
if (dma_debug >= 1) {
gprintk("_alloc_mpool:%s _dma_vbase:%p pbase:%lx allocated:%lx dmaalloc:%d\n",
DMA_DEV(0)?"dma_dev":"", _dma_vbase, pbase, (unsigned long)size, dmaalloc);
} }
if (((pbase + (size - 1)) >> 16) > DMA_BIT_MASK(16)) { if (((pbase + (size - 1)) >> 16) > DMA_BIT_MASK(16)) {
@ -637,14 +677,15 @@ _alloc_mpool(size_t size)
return; return;
} }
if (_dma_vbase) { _dma_pbase = pbase;
_cpu_pbase = virt_to_bus(_dma_vbase);
if (dma_debug >= 1) gprintk("_cpu_pbase at %lx\n", (unsigned long)_cpu_pbase);
}
#ifdef REMAP_DMA_NONCACHED #ifdef REMAP_DMA_NONCACHED
_dma_vbase = IOREMAP(_dma_pbase, size); _dma_vbase = IOREMAP(_dma_pbase, size);
#endif #endif
if (dma_debug >= 1) {
gprintk("_use_dma_mapping:%d _dma_vbase:%p _dma_pbase:%lx _cpu_pbase:%lx allocated:%lx dmaalloc:%d\n",
_use_dma_mapping, _dma_vbase, (unsigned long)_dma_pbase,
(unsigned long)_cpu_pbase, (unsigned long)size, dmaalloc);
}
} }
} }
@ -678,8 +719,20 @@ _dma_cleanup(void)
return 0; return 0;
} }
void _dma_init(int robo_switch) void _dma_init(int robo_switch, int dev_index)
{ {
unsigned long pbase;
if (dev_index > 0) {
if ((_use_dma_mapping == 1) && DMA_DEV(dev_index) && _dma_vbase) {
pbase = dma_map_single(DMA_DEV(dev_index), _dma_vbase, _dma_mem_size, DMA_BIDIRECTIONAL);
if (dma_mapping_error(DMA_DEV(dev_index), pbase)) {
gprintk("Failed to map memory for device %d at %p\n", dev_index, _dma_vbase);
}
}
return;
}
/* DMA Setup */ /* DMA Setup */
if (dmasize) { if (dmasize) {
if ((dmasize[strlen(dmasize)-1] & ~0x20) == 'M') { if ((dmasize[strlen(dmasize)-1] & ~0x20) == 'M') {
@ -706,6 +759,18 @@ void _dma_init(int robo_switch)
} }
} }
if (himemaddr && strlen(himemaddr) > 0) {
char suffix = (himemaddr[strlen(himemaddr)-1] & ~0x20);
_himemaddr = simple_strtoul(himemaddr, NULL, 0);
if (suffix == 'M') {
_himemaddr *= ONE_MB;
} else if (suffix == 'G') {
_himemaddr *= ONE_GB;
} else {
gprintk("DMA high memory address must be specified as e.g. himemaddr=8[MG]\n");
}
}
if (_dma_mem_size) { if (_dma_mem_size) {
_alloc_mpool(_dma_mem_size); _alloc_mpool(_dma_mem_size);
if (_dma_vbase == NULL) { if (_dma_vbase == NULL) {

View File

@ -1,18 +1,17 @@
/* /*
* Unless you and Broadcom execute a separate written software license * Copyright 2017 Broadcom
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
* *
* As a special exception, the copyright holders of this software give * This program is free software; you can redistribute it and/or modify
* you permission to link this software with independent modules, and to * it under the terms of the GNU General Public License, version 2, as
* copy and distribute the resulting executable under terms of your * published by the Free Software Foundation (the "GPL").
* choice, provided that you also meet, for each linked independent *
* module, the terms and conditions of the license of that module. An * This program is distributed in the hope that it will be useful, but
* independent module is a module which is not derived from this * WITHOUT ANY WARRANTY; without even the implied warranty of
* software. The special exception does not apply to any modifications * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* of the software. * General Public License version 2 (GPLv2) for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 (GPLv2) along with this source code.
*/ */
/* /*
* $Id: $ * $Id: $

View File

@ -1,18 +1,17 @@
/* /*
* Unless you and Broadcom execute a separate written software license * Copyright 2017 Broadcom
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
* *
* As a special exception, the copyright holders of this software give * This program is free software; you can redistribute it and/or modify
* you permission to link this software with independent modules, and to * it under the terms of the GNU General Public License, version 2, as
* copy and distribute the resulting executable under terms of your * published by the Free Software Foundation (the "GPL").
* choice, provided that you also meet, for each linked independent *
* module, the terms and conditions of the license of that module. An * This program is distributed in the hope that it will be useful, but
* independent module is a module which is not derived from this * WITHOUT ANY WARRANTY; without even the implied warranty of
* software. The special exception does not apply to any modifications * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* of the software. * General Public License version 2 (GPLv2) for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 (GPLv2) along with this source code.
*/ */
/* /*
* $Id: $ * $Id: $

View File

@ -1,18 +1,17 @@
/* /*
* Unless you and Broadcom execute a separate written software license * Copyright 2017 Broadcom
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
* *
* As a special exception, the copyright holders of this software give * This program is free software; you can redistribute it and/or modify
* you permission to link this software with independent modules, and to * it under the terms of the GNU General Public License, version 2, as
* copy and distribute the resulting executable under terms of your * published by the Free Software Foundation (the "GPL").
* choice, provided that you also meet, for each linked independent *
* module, the terms and conditions of the license of that module. An * This program is distributed in the hope that it will be useful, but
* independent module is a module which is not derived from this * WITHOUT ANY WARRANTY; without even the implied warranty of
* software. The special exception does not apply to any modifications * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* of the software. * General Public License version 2 (GPLv2) for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 (GPLv2) along with this source code.
*/ */
/* /*
* $Id: mpool.c,v 1.18 Broadcom SDK $ * $Id: mpool.c,v 1.18 Broadcom SDK $

View File

@ -1,18 +1,17 @@
# #
# Unless you and Broadcom execute a separate written software license # Copyright 2017 Broadcom
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
# #
# As a special exception, the copyright holders of this software give # This program is free software; you can redistribute it and/or modify
# you permission to link this software with independent modules, and to # it under the terms of the GNU General Public License, version 2, as
# copy and distribute the resulting executable under terms of your # published by the Free Software Foundation (the "GPL").
# choice, provided that you also meet, for each linked independent #
# module, the terms and conditions of the license of that module. An # This program is distributed in the hope that it will be useful, but
# independent module is a module which is not derived from this # WITHOUT ANY WARRANTY; without even the implied warranty of
# software. The special exception does not apply to any modifications # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# of the software. # General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
# #
# -*- Makefile -*- # -*- Makefile -*-
# $Id: Makefile,v 1.1 Broadcom SDK $ # $Id: Makefile,v 1.1 Broadcom SDK $

View File

@ -1,18 +1,17 @@
/* /*
* Unless you and Broadcom execute a separate written software license * Copyright 2017 Broadcom
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
* *
* As a special exception, the copyright holders of this software give * This program is free software; you can redistribute it and/or modify
* you permission to link this software with independent modules, and to * it under the terms of the GNU General Public License, version 2, as
* copy and distribute the resulting executable under terms of your * published by the Free Software Foundation (the "GPL").
* choice, provided that you also meet, for each linked independent *
* module, the terms and conditions of the license of that module. An * This program is distributed in the hope that it will be useful, but
* independent module is a module which is not derived from this * WITHOUT ANY WARRANTY; without even the implied warranty of
* software. The special exception does not apply to any modifications * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* of the software. * General Public License version 2 (GPLv2) for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 (GPLv2) along with this source code.
*/ */
/* /*
* $Id: linux-user-bde.c,v 1.80 Broadcom SDK $ * $Id: linux-user-bde.c,v 1.80 Broadcom SDK $
@ -64,6 +63,8 @@ MODULE_LICENSE("GPL");
#define CMIC_CMCx_IRQ_STAT6_OFFSET(x) (0x314b4 + (0x1000 * x)) #define CMIC_CMCx_IRQ_STAT6_OFFSET(x) (0x314b4 + (0x1000 * x))
#define CMIC_CMCx_PCIE_IRQ_MASK5_OFFSET(x) (0x314b8 + (0x1000 * x)) #define CMIC_CMCx_PCIE_IRQ_MASK5_OFFSET(x) (0x314b8 + (0x1000 * x))
#define CMIC_CMCx_PCIE_IRQ_MASK6_OFFSET(x) (0x314bc + (0x1000 * x)) #define CMIC_CMCx_PCIE_IRQ_MASK6_OFFSET(x) (0x314bc + (0x1000 * x))
#define CMIC_CMCx_UC0_IRQ_MASK5_OFFSET(x) (0x314c0 + (0x1000 * x))
#define CMIC_CMCx_UC0_IRQ_MASK6_OFFSET(x) (0x314c4 + (0x1000 * x))
#define CMIC_CMCx_UC0_IRQ_MASK0_OFFSET(x) (0x31428 + (0x1000 * x)) #define CMIC_CMCx_UC0_IRQ_MASK0_OFFSET(x) (0x31428 + (0x1000 * x))
#define CMIC_CMCx_UC0_IRQ_MASK1_OFFSET(x) (0x3142c + (0x1000 * x)) #define CMIC_CMCx_UC0_IRQ_MASK1_OFFSET(x) (0x3142c + (0x1000 * x))
@ -72,16 +73,17 @@ MODULE_LICENSE("GPL");
#define CMIC_CMCx_UC0_IRQ_MASK4_OFFSET(x) (0x31438 + (0x1000 * x)) #define CMIC_CMCx_UC0_IRQ_MASK4_OFFSET(x) (0x31438 + (0x1000 * x))
/* CMICX defines */ /* CMICX defines */
#define INTC_INTR_REG_NUM (8) #define INTC_INTR_REG_NUM (8)
#define INTC_INTR_ENABLE_REG0 (0x180130f0) #define INTC_INTR_ENABLE_REG0 (0x180130f0)
#define INTC_INTR_STATUS_REG0 (0x18013190) #define INTC_INTR_STATUS_REG0 (0x18013190)
#define INTC_INTR_RAW_STATUS_REG0 (0x18013140) #define INTC_INTR_RAW_STATUS_REG0 (0x18013140)
#define INTC_INTR_ENABLE_BASE (INTC_INTR_ENABLE_REG0) #define INTC_INTR_ENABLE_BASE (INTC_INTR_ENABLE_REG0)
#define INTC_INTR_STATUS_BASE (INTC_INTR_STATUS_REG0) #define INTC_INTR_STATUS_BASE (INTC_INTR_STATUS_REG0)
#define INTC_INTR_RAW_STATUS_BASE (INTC_INTR_RAW_STATUS_REG0) #define INTC_INTR_RAW_STATUS_BASE (INTC_INTR_RAW_STATUS_REG0)
#define INTC_PDMA_INTR_REG_IND 4
#define READ_INTC_INTR(d, reg, v) \ #define READ_INTC_INTR(d, reg, v) \
(v = user_bde->iproc_read(d, reg)) (v = user_bde->iproc_read(d, reg))
@ -220,18 +222,45 @@ _cmic_interrupt(bde_ctrl_t *ctrl)
static void static void
_cmicx_interrupt(bde_ctrl_t *ctrl) _cmicx_interrupt(bde_ctrl_t *ctrl)
{ {
int d, i; int d, ind;
uint32 stat, iena, mask, fmask;
bde_inst_resource_t *res; bde_inst_resource_t *res;
d = (((uint8 *)ctrl - (uint8 *)_devices) / sizeof (bde_ctrl_t)); d = (((uint8 *)ctrl - (uint8 *)_devices) / sizeof (bde_ctrl_t));
res = &_bde_inst_resource[ctrl->inst]; res = &_bde_inst_resource[ctrl->inst];
lkbde_irq_mask_get(d, &mask, &fmask);
if (fmask) {
READ_INTC_INTR(d, INTC_INTR_STATUS_BASE + 4 * INTC_PDMA_INTR_REG_IND, stat);
READ_INTC_INTR(d, INTC_INTR_ENABLE_BASE + 4 * INTC_PDMA_INTR_REG_IND, iena);
if (stat & iena) {
WRITE_INTC_INTR(d, INTC_INTR_ENABLE_BASE + 4 * INTC_PDMA_INTR_REG_IND, 0);
for (ind = 0; ind < INTC_INTR_REG_NUM; ind++) {
if (ind == INTC_PDMA_INTR_REG_IND) {
continue;
}
READ_INTC_INTR(d, INTC_INTR_STATUS_BASE + 4 * ind, stat);
READ_INTC_INTR(d, INTC_INTR_ENABLE_BASE + 4 * ind, iena);
if (stat & iena) {
break;
}
}
if (ind >= INTC_INTR_REG_NUM) {
return;
}
}
}
/* Disable all interrupts.. Re-enable unserviced interrupts later /* Disable all interrupts.. Re-enable unserviced interrupts later
* So as to avoid getting new interrupts until the user level driver * So as to avoid getting new interrupts until the user level driver
* enumerates the interrupts to be serviced * enumerates the interrupts to be serviced
*/ */
for (i = 0 ; i < INTC_INTR_REG_NUM ; i++) { for (ind = 0; ind < INTC_INTR_REG_NUM; ind++) {
WRITE_INTC_INTR(d, (INTC_INTR_ENABLE_BASE + 4*i), 0); if (fmask && ind == INTC_PDMA_INTR_REG_IND) {
continue;
}
WRITE_INTC_INTR(d, INTC_INTR_ENABLE_BASE + 4 * ind, 0);
} }
/* Notify */ /* Notify */
@ -327,8 +356,108 @@ _cmicm_interrupt(bde_ctrl_t *ctrl)
#endif #endif
} }
/* some device has cmc0 only */
static void
_cmicd_cmc0_interrupt(bde_ctrl_t *ctrl)
{
int d;
int cmc = 0;
uint32 stat, mask = 0, fmask = 0, imask = 0;
bde_inst_resource_t *res;
static void d = (((uint8 *)ctrl - (uint8 *)_devices) / sizeof (bde_ctrl_t));
res = &_bde_inst_resource[ctrl->inst];
lkbde_irq_mask_get(d, &mask, &fmask);
while (fmask) {
stat = user_bde->read(d, CMIC_CMCx_IRQ_STAT0_OFFSET(cmc));
imask = mask & ~fmask;
if (stat & imask) {
break;
}
stat = user_bde->read(d, CMIC_CMCx_IRQ_STAT1_OFFSET(cmc));
if (ctrl->dev_type & BDE_AXI_DEV_TYPE) {
mask = user_bde->read(d, CMIC_CMCx_UC0_IRQ_MASK1_OFFSET(cmc));
} else {
mask = user_bde->read(d, CMIC_CMCx_PCIE_IRQ_MASK1_OFFSET(cmc));
}
if (stat & mask) {
break;
}
stat = user_bde->read(d, CMIC_CMCx_IRQ_STAT2_OFFSET(cmc));
if (ctrl->dev_type & BDE_AXI_DEV_TYPE) {
mask = user_bde->read(d, CMIC_CMCx_UC0_IRQ_MASK2_OFFSET(cmc));
} else {
mask = user_bde->read(d, CMIC_CMCx_PCIE_IRQ_MASK2_OFFSET(cmc));
}
if (stat & mask) {
break;
}
stat = user_bde->read(d, CMIC_CMCx_IRQ_STAT3_OFFSET(cmc));
if (ctrl->dev_type & BDE_AXI_DEV_TYPE) {
mask = user_bde->read(d, CMIC_CMCx_UC0_IRQ_MASK3_OFFSET(cmc));
} else {
mask = user_bde->read(d, CMIC_CMCx_PCIE_IRQ_MASK3_OFFSET(cmc));
}
if (stat & mask) {
break;
}
stat = user_bde->read(d, CMIC_CMCx_IRQ_STAT4_OFFSET(cmc));
if (ctrl->dev_type & BDE_AXI_DEV_TYPE) {
mask = user_bde->read(d, CMIC_CMCx_UC0_IRQ_MASK4_OFFSET(cmc));
} else {
mask = user_bde->read(d, CMIC_CMCx_PCIE_IRQ_MASK4_OFFSET(cmc));
}
if (stat & mask) {
break;
}
stat = user_bde->read(d, CMIC_CMCx_IRQ_STAT5_OFFSET(cmc));
if (ctrl->dev_type & BDE_AXI_DEV_TYPE) {
mask = user_bde->read(d, CMIC_CMCx_UC0_IRQ_MASK5_OFFSET(cmc));
} else {
mask = user_bde->read(d, CMIC_CMCx_PCIE_IRQ_MASK5_OFFSET(cmc));
}
if (stat & mask) {
break;
}
stat = user_bde->read(d, CMIC_CMCx_IRQ_STAT6_OFFSET(cmc));
if (ctrl->dev_type & BDE_AXI_DEV_TYPE) {
mask = user_bde->read(d, CMIC_CMCx_UC0_IRQ_MASK6_OFFSET(cmc));
} else {
mask = user_bde->read(d, CMIC_CMCx_PCIE_IRQ_MASK6_OFFSET(cmc));
}
if (stat & mask) {
break;
}
return;
}
if (ctrl->dev_type & BDE_AXI_DEV_TYPE) {
lkbde_irq_mask_set(d, CMIC_CMCx_UC0_IRQ_MASK0_OFFSET(cmc), 0, 0);
user_bde->write(d, CMIC_CMCx_UC0_IRQ_MASK1_OFFSET(cmc), 0);
user_bde->write(d, CMIC_CMCx_UC0_IRQ_MASK2_OFFSET(cmc), 0);
user_bde->write(d, CMIC_CMCx_UC0_IRQ_MASK3_OFFSET(cmc), 0);
user_bde->write(d, CMIC_CMCx_UC0_IRQ_MASK4_OFFSET(cmc), 0);
user_bde->write(d, CMIC_CMCx_UC0_IRQ_MASK5_OFFSET(cmc), 0);
user_bde->write(d, CMIC_CMCx_UC0_IRQ_MASK6_OFFSET(cmc), 0);
} else {
lkbde_irq_mask_set(d, CMIC_CMCx_PCIE_IRQ_MASK0_OFFSET(cmc), 0, 0);
user_bde->write(d, CMIC_CMCx_PCIE_IRQ_MASK1_OFFSET(cmc), 0);
user_bde->write(d, CMIC_CMCx_PCIE_IRQ_MASK2_OFFSET(cmc), 0);
user_bde->write(d, CMIC_CMCx_PCIE_IRQ_MASK3_OFFSET(cmc), 0);
user_bde->write(d, CMIC_CMCx_PCIE_IRQ_MASK4_OFFSET(cmc), 0);
user_bde->write(d, CMIC_CMCx_PCIE_IRQ_MASK5_OFFSET(cmc), 0);
user_bde->write(d, CMIC_CMCx_PCIE_IRQ_MASK6_OFFSET(cmc), 0);
}
atomic_set(&res->intr, 1);
#ifdef BDE_LINUX_NON_INTERRUPTIBLE
wake_up(&res->intr_wq);
#else
wake_up_interruptible(&res->intr_wq);
#endif
}
static void
_cmicd_interrupt(bde_ctrl_t *ctrl) _cmicd_interrupt(bde_ctrl_t *ctrl)
{ {
int d; int d;
@ -347,46 +476,83 @@ _cmicd_interrupt(bde_ctrl_t *ctrl)
break; break;
} }
stat = user_bde->read(d, CMIC_CMCx_IRQ_STAT1_OFFSET(cmc)); stat = user_bde->read(d, CMIC_CMCx_IRQ_STAT1_OFFSET(cmc));
mask = user_bde->read(d, CMIC_CMCx_PCIE_IRQ_MASK1_OFFSET(cmc)); if (ctrl->dev_type & BDE_AXI_DEV_TYPE) {
mask = user_bde->read(d, CMIC_CMCx_UC0_IRQ_MASK1_OFFSET(cmc));
} else {
mask = user_bde->read(d, CMIC_CMCx_PCIE_IRQ_MASK1_OFFSET(cmc));
}
if (stat & mask) { if (stat & mask) {
break; break;
} }
stat = user_bde->read(d, CMIC_CMCx_IRQ_STAT2_OFFSET(cmc)); stat = user_bde->read(d, CMIC_CMCx_IRQ_STAT2_OFFSET(cmc));
mask = user_bde->read(d, CMIC_CMCx_PCIE_IRQ_MASK2_OFFSET(cmc)); if (ctrl->dev_type & BDE_AXI_DEV_TYPE) {
mask = user_bde->read(d, CMIC_CMCx_UC0_IRQ_MASK2_OFFSET(cmc));
} else {
mask = user_bde->read(d, CMIC_CMCx_PCIE_IRQ_MASK2_OFFSET(cmc));
}
if (stat & mask) { if (stat & mask) {
break; break;
} }
stat = user_bde->read(d, CMIC_CMCx_IRQ_STAT3_OFFSET(cmc)); stat = user_bde->read(d, CMIC_CMCx_IRQ_STAT3_OFFSET(cmc));
mask = user_bde->read(d, CMIC_CMCx_PCIE_IRQ_MASK3_OFFSET(cmc)); if (ctrl->dev_type & BDE_AXI_DEV_TYPE) {
mask = user_bde->read(d, CMIC_CMCx_UC0_IRQ_MASK3_OFFSET(cmc));
} else {
mask = user_bde->read(d, CMIC_CMCx_PCIE_IRQ_MASK3_OFFSET(cmc));
}
if (stat & mask) { if (stat & mask) {
break; break;
} }
stat = user_bde->read(d, CMIC_CMCx_IRQ_STAT4_OFFSET(cmc)); stat = user_bde->read(d, CMIC_CMCx_IRQ_STAT4_OFFSET(cmc));
mask = user_bde->read(d, CMIC_CMCx_PCIE_IRQ_MASK4_OFFSET(cmc)); if (ctrl->dev_type & BDE_AXI_DEV_TYPE) {
mask = user_bde->read(d, CMIC_CMCx_UC0_IRQ_MASK4_OFFSET(cmc));
} else {
mask = user_bde->read(d, CMIC_CMCx_PCIE_IRQ_MASK4_OFFSET(cmc));
}
if (stat & mask) { if (stat & mask) {
break; break;
} }
stat = user_bde->read(d, CMIC_CMCx_IRQ_STAT5_OFFSET(cmc)); stat = user_bde->read(d, CMIC_CMCx_IRQ_STAT5_OFFSET(cmc));
mask = user_bde->read(d, CMIC_CMCx_PCIE_IRQ_MASK5_OFFSET(cmc)); if (ctrl->dev_type & BDE_AXI_DEV_TYPE) {
mask = user_bde->read(d, CMIC_CMCx_UC0_IRQ_MASK5_OFFSET(cmc));
} else {
mask = user_bde->read(d, CMIC_CMCx_PCIE_IRQ_MASK5_OFFSET(cmc));
}
if (stat & mask) { if (stat & mask) {
break; break;
} }
stat = user_bde->read(d, CMIC_CMCx_IRQ_STAT6_OFFSET(cmc)); stat = user_bde->read(d, CMIC_CMCx_IRQ_STAT6_OFFSET(cmc));
mask = user_bde->read(d, CMIC_CMCx_PCIE_IRQ_MASK6_OFFSET(cmc)); if (ctrl->dev_type & BDE_AXI_DEV_TYPE) {
mask = user_bde->read(d, CMIC_CMCx_UC0_IRQ_MASK6_OFFSET(cmc));
} else {
mask = user_bde->read(d, CMIC_CMCx_PCIE_IRQ_MASK6_OFFSET(cmc));
}
if (stat & mask) { if (stat & mask) {
break; break;
} }
return; return;
} }
lkbde_irq_mask_set(d, CMIC_CMCx_PCIE_IRQ_MASK0_OFFSET(cmc), 0, 0); if (ctrl->dev_type & BDE_AXI_DEV_TYPE) {
user_bde->write(d, CMIC_CMCx_PCIE_IRQ_MASK1_OFFSET(cmc), 0); lkbde_irq_mask_set(d, CMIC_CMCx_UC0_IRQ_MASK0_OFFSET(cmc), 0, 0);
user_bde->write(d, CMIC_CMCx_PCIE_IRQ_MASK2_OFFSET(cmc), 0); user_bde->write(d, CMIC_CMCx_UC0_IRQ_MASK1_OFFSET(cmc), 0);
user_bde->write(d, CMIC_CMCx_PCIE_IRQ_MASK3_OFFSET(cmc), 0); user_bde->write(d, CMIC_CMCx_UC0_IRQ_MASK2_OFFSET(cmc), 0);
user_bde->write(d, CMIC_CMCx_PCIE_IRQ_MASK4_OFFSET(cmc), 0); user_bde->write(d, CMIC_CMCx_UC0_IRQ_MASK3_OFFSET(cmc), 0);
user_bde->write(d, CMIC_CMCx_PCIE_IRQ_MASK5_OFFSET(cmc), 0); user_bde->write(d, CMIC_CMCx_UC0_IRQ_MASK4_OFFSET(cmc), 0);
user_bde->write(d, CMIC_CMCx_PCIE_IRQ_MASK6_OFFSET(cmc), 0); user_bde->write(d, CMIC_CMCx_UC0_IRQ_MASK5_OFFSET(cmc), 0);
user_bde->write(d, CMIC_CMCx_UC0_IRQ_MASK6_OFFSET(cmc), 0);
user_bde->write(d, CMIC_CMCx_UC0_IRQ_MASK0_OFFSET(1), 0);
user_bde->write(d, CMIC_CMCx_UC0_IRQ_MASK0_OFFSET(2), 0);
} else {
lkbde_irq_mask_set(d, CMIC_CMCx_PCIE_IRQ_MASK0_OFFSET(cmc), 0, 0);
user_bde->write(d, CMIC_CMCx_PCIE_IRQ_MASK1_OFFSET(cmc), 0);
user_bde->write(d, CMIC_CMCx_PCIE_IRQ_MASK2_OFFSET(cmc), 0);
user_bde->write(d, CMIC_CMCx_PCIE_IRQ_MASK3_OFFSET(cmc), 0);
user_bde->write(d, CMIC_CMCx_PCIE_IRQ_MASK4_OFFSET(cmc), 0);
user_bde->write(d, CMIC_CMCx_PCIE_IRQ_MASK5_OFFSET(cmc), 0);
user_bde->write(d, CMIC_CMCx_PCIE_IRQ_MASK6_OFFSET(cmc), 0);
user_bde->write(d, CMIC_CMCx_PCIE_IRQ_MASK0_OFFSET(1), 0);
user_bde->write(d, CMIC_CMCx_PCIE_IRQ_MASK0_OFFSET(2), 0);
}
atomic_set(&res->intr, 1); atomic_set(&res->intr, 1);
#ifdef BDE_LINUX_NON_INTERRUPTIBLE #ifdef BDE_LINUX_NON_INTERRUPTIBLE
wake_up(&res->intr_wq); wake_up(&res->intr_wq);
@ -551,6 +717,7 @@ static struct _intr_mode_s {
{ (isr_f)_cmic_interrupt, "CMIC/CMICe" }, { (isr_f)_cmic_interrupt, "CMIC/CMICe" },
{ (isr_f)_cmicm_interrupt, "CMICm" }, { (isr_f)_cmicm_interrupt, "CMICm" },
{ (isr_f)_cmicd_interrupt, "CMICd" }, { (isr_f)_cmicd_interrupt, "CMICd" },
{ (isr_f)_cmicd_cmc0_interrupt, "CMICd CMC0" },
{ (isr_f)_qe2k_interrupt, "QE2K" }, { (isr_f)_qe2k_interrupt, "QE2K" },
{ (isr_f)_fe2k_interrupt, "FE2K" }, { (isr_f)_fe2k_interrupt, "FE2K" },
{ (isr_f)_fe2kxt_interrupt, "FE2KXT" }, { (isr_f)_fe2kxt_interrupt, "FE2KXT" },
@ -580,7 +747,9 @@ static void
_devices_init(int d) _devices_init(int d)
{ {
bde_ctrl_t *ctrl; bde_ctrl_t *ctrl;
uint32 ver; uint32 ver;
uint16 device_id_mask = 0xFFF0;
uint16 device_id;
ctrl = &_devices[d]; ctrl = &_devices[d];
/* Initialize our control info */ /* Initialize our control info */
@ -616,7 +785,10 @@ _devices_init(int d)
case BCM88752_DEVICE_ID: case BCM88752_DEVICE_ID:
ctrl->isr = (isr_f)_bcm88750_interrupt; ctrl->isr = (isr_f)_bcm88750_interrupt;
break; break;
/* FIXME: might use _devices[i].dev_type & BDE_AXI_DEV_TYPE*/ case BCM53540_DEVICE_ID:
case BCM53547_DEVICE_ID:
case BCM53548_DEVICE_ID:
case BCM53549_DEVICE_ID:
case BCM88670_DEVICE_ID: case BCM88670_DEVICE_ID:
case BCM88671_DEVICE_ID: case BCM88671_DEVICE_ID:
case BCM88671M_DEVICE_ID: case BCM88671M_DEVICE_ID:
@ -662,29 +834,35 @@ _devices_init(int d)
case BCM88474H_DEVICE_ID: case BCM88474H_DEVICE_ID:
case BCM88476_DEVICE_ID: case BCM88476_DEVICE_ID:
case BCM88477_DEVICE_ID: case BCM88477_DEVICE_ID:
case BCM88270_DEVICE_ID: case BCM88270_DEVICE_ID:
case BCM88272_DEVICE_ID: case BCM88272_DEVICE_ID:
case BCM88273_DEVICE_ID: case BCM88273_DEVICE_ID:
case BCM88278_DEVICE_ID: case BCM88278_DEVICE_ID:
case BCM88279_DEVICE_ID:
case BCM8206_DEVICE_ID: case BCM8206_DEVICE_ID:
case BCM88950_DEVICE_ID: case BCM88950_DEVICE_ID:
case BCM88953_DEVICE_ID: case BCM88953_DEVICE_ID:
case BCM88954_DEVICE_ID: case BCM88954_DEVICE_ID:
case BCM88955_DEVICE_ID: case BCM88955_DEVICE_ID:
case BCM88956_DEVICE_ID: case BCM88956_DEVICE_ID:
case BCM88790_DEVICE_ID:
case BCM88772_DEVICE_ID: case BCM88772_DEVICE_ID:
case BCM88952_DEVICE_ID: case BCM88952_DEVICE_ID:
ctrl->isr = (isr_f)_cmicd_interrupt; ctrl->isr = (isr_f)_cmicd_cmc0_interrupt;
break; break;
default: default:
/* Get CMIC version */ /* Get CMIC version */
if (user_bde->get_cmic_ver(d, &ver) != 0) { if (user_bde->get_cmic_ver(d, &ver) != 0) {
ver = -1; ver = -1;
} }
device_id = ctrl->devid & device_id_mask;
/* TH/TH+/TH2 should use cmicd interrupt handler */
if (BCM56960_DEVICE_ID == device_id ||
BCM56930_DEVICE_ID == device_id ||
BCM56970_DEVICE_ID == device_id) {
ctrl->isr = (isr_f)_cmicd_interrupt;
}
/* check if version is CMICX */ /* check if version is CMICX */
if (ver == 0x04) { else if (ver == 0x04) {
ctrl->isr = (isr_f)_cmicx_interrupt; ctrl->isr = (isr_f)_cmicx_interrupt;
} else { } else {
ctrl->isr = (isr_f)_cmic_interrupt; ctrl->isr = (isr_f)_cmic_interrupt;
@ -698,6 +876,10 @@ _devices_init(int d)
} }
break; break;
} }
/*All Ramon devices from 0x8790 to 0x879F*/
if ((user_bde->get_dev(d)->device & BCM88790_DEVICE_ID) == BCM88790_DEVICE_ID) {
ctrl->isr = (isr_f)_cmicx_interrupt;
}
if (_intr_mode_str(ctrl->isr) == NULL) { if (_intr_mode_str(ctrl->isr) == NULL) {
gprintk("Warning: Unknown interrupt mode\n"); gprintk("Warning: Unknown interrupt mode\n");
} }
@ -1002,7 +1184,7 @@ _ioctl(unsigned int cmd, unsigned long arg)
break; break;
case LUBDE_GET_DEVICE: case LUBDE_GET_DEVICE:
if (!VALID_DEVICE(io.dev)) { if (!VALID_DEVICE(io.dev)) {
return -EINVAL; return -EINVAL;
} }
bde_dev = user_bde->get_dev(io.dev); bde_dev = user_bde->get_dev(io.dev);
if (bde_dev) { if (bde_dev) {
@ -1019,7 +1201,7 @@ _ioctl(unsigned int cmd, unsigned long arg)
break; break;
case LUBDE_GET_DEVICE_TYPE: case LUBDE_GET_DEVICE_TYPE:
if (!VALID_DEVICE(io.dev)) { if (!VALID_DEVICE(io.dev)) {
return -EINVAL; return -EINVAL;
} }
io.d0 = _devices[io.dev].dev_type; io.d0 = _devices[io.dev].dev_type;
break; break;
@ -1029,7 +1211,7 @@ _ioctl(unsigned int cmd, unsigned long arg)
break; break;
case LUBDE_PCI_CONFIG_PUT32: case LUBDE_PCI_CONFIG_PUT32:
if (!VALID_DEVICE(io.dev)) { if (!VALID_DEVICE(io.dev)) {
return -EINVAL; return -EINVAL;
} }
if (_devices[io.dev].dev_type & BDE_PCI_DEV_TYPE) { if (_devices[io.dev].dev_type & BDE_PCI_DEV_TYPE) {
user_bde->pci_conf_write(io.dev, io.d0, io.d1); user_bde->pci_conf_write(io.dev, io.d0, io.d1);
@ -1039,7 +1221,7 @@ _ioctl(unsigned int cmd, unsigned long arg)
break; break;
case LUBDE_PCI_CONFIG_GET32: case LUBDE_PCI_CONFIG_GET32:
if (!VALID_DEVICE(io.dev)) { if (!VALID_DEVICE(io.dev)) {
return -EINVAL; return -EINVAL;
} }
if (_devices[io.dev].dev_type & BDE_PCI_DEV_TYPE) { if (_devices[io.dev].dev_type & BDE_PCI_DEV_TYPE) {
io.d0 = user_bde->pci_conf_read(io.dev, io.d0); io.d0 = user_bde->pci_conf_read(io.dev, io.d0);
@ -1068,7 +1250,7 @@ _ioctl(unsigned int cmd, unsigned long arg)
break; break;
case LUBDE_ENABLE_INTERRUPTS: case LUBDE_ENABLE_INTERRUPTS:
if (!VALID_DEVICE(io.dev)) { if (!VALID_DEVICE(io.dev)) {
return -EINVAL; return -EINVAL;
} }
if (_devices[io.dev].dev_type & BDE_SWITCH_DEV_TYPE) { if (_devices[io.dev].dev_type & BDE_SWITCH_DEV_TYPE) {
if (_devices[io.dev].isr && !_devices[io.dev].enabled) { if (_devices[io.dev].isr && !_devices[io.dev].enabled) {
@ -1090,7 +1272,7 @@ _ioctl(unsigned int cmd, unsigned long arg)
break; break;
case LUBDE_DISABLE_INTERRUPTS: case LUBDE_DISABLE_INTERRUPTS:
if (!VALID_DEVICE(io.dev)) { if (!VALID_DEVICE(io.dev)) {
return -EINVAL; return -EINVAL;
} }
if (_devices[io.dev].enabled) { if (_devices[io.dev].enabled) {
user_bde->interrupt_disconnect(io.dev); user_bde->interrupt_disconnect(io.dev);
@ -1099,7 +1281,7 @@ _ioctl(unsigned int cmd, unsigned long arg)
break; break;
case LUBDE_WAIT_FOR_INTERRUPT: case LUBDE_WAIT_FOR_INTERRUPT:
if (!VALID_DEVICE(io.dev)) { if (!VALID_DEVICE(io.dev)) {
return -EINVAL; return -EINVAL;
} }
if (_devices[io.dev].dev_type & BDE_SWITCH_DEV_TYPE) { if (_devices[io.dev].dev_type & BDE_SWITCH_DEV_TYPE) {
res = &_bde_inst_resource[_devices[io.dev].inst]; res = &_bde_inst_resource[_devices[io.dev].inst];
@ -1200,7 +1382,7 @@ _ioctl(unsigned int cmd, unsigned long arg)
#endif #endif
case LUBDE_DEV_RESOURCE: case LUBDE_DEV_RESOURCE:
if (!VALID_DEVICE(io.dev)) { if (!VALID_DEVICE(io.dev)) {
return -EINVAL; return -EINVAL;
} }
bde_dev = user_bde->get_dev(io.dev); bde_dev = user_bde->get_dev(io.dev);
if (bde_dev) { if (bde_dev) {
@ -1235,7 +1417,7 @@ _ioctl(unsigned int cmd, unsigned long arg)
io.rc = LUBDE_FAIL; io.rc = LUBDE_FAIL;
break; break;
} }
if (copy_to_user((void *)arg, &io, sizeof(io))) { if (copy_to_user((void *)arg, &io, sizeof(io))) {
return -EFAULT; return -EFAULT;
} }

View File

@ -1,18 +1,17 @@
/* /*
* Unless you and Broadcom execute a separate written software license * Copyright 2017 Broadcom
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
* *
* As a special exception, the copyright holders of this software give * This program is free software; you can redistribute it and/or modify
* you permission to link this software with independent modules, and to * it under the terms of the GNU General Public License, version 2, as
* copy and distribute the resulting executable under terms of your * published by the Free Software Foundation (the "GPL").
* choice, provided that you also meet, for each linked independent *
* module, the terms and conditions of the license of that module. An * This program is distributed in the hope that it will be useful, but
* independent module is a module which is not derived from this * WITHOUT ANY WARRANTY; without even the implied warranty of
* software. The special exception does not apply to any modifications * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* of the software. * General Public License version 2 (GPLv2) for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 (GPLv2) along with this source code.
*/ */
/* /*
* $Id: linux-user-bde.h,v 1.23 Broadcom SDK $ * $Id: linux-user-bde.h,v 1.23 Broadcom SDK $

View File

@ -1,18 +1,17 @@
/* /*
* Unless you and Broadcom execute a separate written software license * Copyright 2017 Broadcom
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
* *
* As a special exception, the copyright holders of this software give * This program is free software; you can redistribute it and/or modify
* you permission to link this software with independent modules, and to * it under the terms of the GNU General Public License, version 2, as
* copy and distribute the resulting executable under terms of your * published by the Free Software Foundation (the "GPL").
* choice, provided that you also meet, for each linked independent *
* module, the terms and conditions of the license of that module. An * This program is distributed in the hope that it will be useful, but
* independent module is a module which is not derived from this * WITHOUT ANY WARRANTY; without even the implied warranty of
* software. The special exception does not apply to any modifications * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* of the software. * General Public License version 2 (GPLv2) for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 (GPLv2) along with this source code.
*/ */
/* /*
* $Id: $ * $Id: $

View File

@ -1,18 +1,17 @@
/* /*
* Unless you and Broadcom execute a separate written software license * Copyright 2017 Broadcom
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
* *
* As a special exception, the copyright holders of this software give * This program is free software; you can redistribute it and/or modify
* you permission to link this software with independent modules, and to * it under the terms of the GNU General Public License, version 2, as
* copy and distribute the resulting executable under terms of your * published by the Free Software Foundation (the "GPL").
* choice, provided that you also meet, for each linked independent *
* module, the terms and conditions of the license of that module. An * This program is distributed in the hope that it will be useful, but
* independent module is a module which is not derived from this * WITHOUT ANY WARRANTY; without even the implied warranty of
* software. The special exception does not apply to any modifications * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* of the software. * General Public License version 2 (GPLv2) for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 (GPLv2) along with this source code.
*/ */
/* /*
* $Id: $ * $Id: $

View File

@ -1,18 +1,17 @@
/* /*
* Unless you and Broadcom execute a separate written software license * Copyright 2017 Broadcom
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
* *
* As a special exception, the copyright holders of this software give * This program is free software; you can redistribute it and/or modify
* you permission to link this software with independent modules, and to * it under the terms of the GNU General Public License, version 2, as
* copy and distribute the resulting executable under terms of your * published by the Free Software Foundation (the "GPL").
* choice, provided that you also meet, for each linked independent *
* module, the terms and conditions of the license of that module. An * This program is distributed in the hope that it will be useful, but
* independent module is a module which is not derived from this * WITHOUT ANY WARRANTY; without even the implied warranty of
* software. The special exception does not apply to any modifications * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* of the software. * General Public License version 2 (GPLv2) for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 (GPLv2) along with this source code.
*/ */
/* /*
* $Id: $ * $Id: $

View File

@ -1,18 +1,17 @@
/* /*
* Unless you and Broadcom execute a separate written software license * Copyright 2017 Broadcom
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
* *
* As a special exception, the copyright holders of this software give * This program is free software; you can redistribute it and/or modify
* you permission to link this software with independent modules, and to * it under the terms of the GNU General Public License, version 2, as
* copy and distribute the resulting executable under terms of your * published by the Free Software Foundation (the "GPL").
* choice, provided that you also meet, for each linked independent *
* module, the terms and conditions of the license of that module. An * This program is distributed in the hope that it will be useful, but
* independent module is a module which is not derived from this * WITHOUT ANY WARRANTY; without even the implied warranty of
* software. The special exception does not apply to any modifications * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* of the software. * General Public License version 2 (GPLv2) for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 (GPLv2) along with this source code.
*/ */
/* /*
* $Id: $ * $Id: $

View File

@ -1,18 +1,17 @@
/* /*
* Unless you and Broadcom execute a separate written software license * Copyright 2017 Broadcom
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
* *
* As a special exception, the copyright holders of this software give * This program is free software; you can redistribute it and/or modify
* you permission to link this software with independent modules, and to * it under the terms of the GNU General Public License, version 2, as
* copy and distribute the resulting executable under terms of your * published by the Free Software Foundation (the "GPL").
* choice, provided that you also meet, for each linked independent *
* module, the terms and conditions of the license of that module. An * This program is distributed in the hope that it will be useful, but
* independent module is a module which is not derived from this * WITHOUT ANY WARRANTY; without even the implied warranty of
* software. The special exception does not apply to any modifications * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* of the software. * General Public License version 2 (GPLv2) for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 (GPLv2) along with this source code.
*/ */
/* /*
* $Id: $ * $Id: $
@ -145,12 +144,14 @@ shbde_iproc_config_init(shbde_iproc_config_t *icfg,
icfg->dma_hi_bits = 0x2; icfg->dma_hi_bits = 0x2;
break; break;
case 0xb560: /* Apache */ case 0xb560: /* Apache */
case 0xb670: /* MO */
case 0xb760: /* Maverick */ case 0xb760: /* Maverick */
icfg->iproc_ver = 0xB; icfg->iproc_ver = 0xB;
break; break;
case 0xb160: /* Hurricane3 */ case 0xb160: /* Hurricane3 */
case 0x8440: /* Wolfhound2 */ case 0x8440: /* Buckhound2 */
case 0x8430: /* Foxhound2 */ case 0x8430: /* Foxhound2 */
case 0x8540: /* Wolfhound2 */
icfg->iproc_ver = 10; icfg->iproc_ver = 10;
icfg->dma_hi_bits = 0x2; icfg->dma_hi_bits = 0x2;
break; break;
@ -272,17 +273,17 @@ shbde_iproc_paxb_init(shbde_hal_t *shbde, void *iproc_regs,
reg = ROFFS(iproc_regs, BAR0_PAXB_PCIE_EP_AXI_CONFIG); reg = ROFFS(iproc_regs, BAR0_PAXB_PCIE_EP_AXI_CONFIG);
iproc32_write(shbde, reg, 0x0); iproc32_write(shbde, reg, 0x0);
if(icfg->cmic_ver < 4) { /* Non-CMICX */ if(icfg->cmic_ver < 4) { /* Non-CMICX */
reg = ROFFS(iproc_regs, BAR0_PAXB_OARR_2); reg = ROFFS(iproc_regs, BAR0_PAXB_OARR_2);
iproc32_write(shbde, reg, 0x1); iproc32_write(shbde, reg, 0x1);
reg = ROFFS(iproc_regs, BAR0_PAXB_OARR_2_UPPER); reg = ROFFS(iproc_regs, BAR0_PAXB_OARR_2_UPPER);
iproc32_write(shbde, reg, icfg->dma_hi_bits); iproc32_write(shbde, reg, icfg->dma_hi_bits);
/* Configure MSI interrupt page */ /* Configure MSI interrupt page */
if (icfg->use_msi) { if (icfg->use_msi) {
reg = ROFFS(iproc_regs, BAR0_PAXB_OARR_FUNC0_MSI_PAGE); reg = ROFFS(iproc_regs, BAR0_PAXB_OARR_FUNC0_MSI_PAGE);
data = iproc32_read(shbde, reg); data = iproc32_read(shbde, reg);
iproc32_write(shbde, reg, data | 0x1); iproc32_write(shbde, reg, data | 0x1);
} }
} }
return pci_num; return pci_num;
} }
@ -318,15 +319,15 @@ shbde_iproc_pci_read(shbde_hal_t *shbde, void *iproc_regs,
/* Route the INTC block access through IMAP0_6 */ /* Route the INTC block access through IMAP0_6 */
reg = ROFFS(iproc_regs, 0x6000 + (addr & 0xfff)); reg = ROFFS(iproc_regs, 0x6000 + (addr & 0xfff));
} else { } else {
/* Update base address for sub-window 7 */ /* Update base address for sub-window 7 */
subwin_base |= 1; /* Valid bit */ subwin_base |= 1; /* Valid bit */
reg = ROFFS(iproc_regs, BAR0_PAXB_IMAP0_7); reg = ROFFS(iproc_regs, BAR0_PAXB_IMAP0_7);
iproc32_write(shbde, reg, subwin_base); iproc32_write(shbde, reg, subwin_base);
/* Read it to make sure the write actually goes through */ /* Read it to make sure the write actually goes through */
subwin_base = iproc32_read(shbde, reg); subwin_base = iproc32_read(shbde, reg);
/* Read register through sub-window 7 */ /* Read register through sub-window 7 */
reg = ROFFS(iproc_regs, 0x7000 + (addr & 0xfff)); reg = ROFFS(iproc_regs, 0x7000 + (addr & 0xfff));
} }
return iproc32_read(shbde, reg); return iproc32_read(shbde, reg);
@ -364,15 +365,15 @@ shbde_iproc_pci_write(shbde_hal_t *shbde, void *iproc_regs,
/* Route the INTC block access through IMAP0_6 */ /* Route the INTC block access through IMAP0_6 */
reg = ROFFS(iproc_regs, 0x6000 + (addr & 0xfff)); reg = ROFFS(iproc_regs, 0x6000 + (addr & 0xfff));
} else { } else {
/* Update base address for sub-window 7 */ /* Update base address for sub-window 7 */
subwin_base |= 1; /* Valid bit */ subwin_base |= 1; /* Valid bit */
reg = ROFFS(iproc_regs, BAR0_PAXB_IMAP0_7); reg = ROFFS(iproc_regs, BAR0_PAXB_IMAP0_7);
iproc32_write(shbde, reg, subwin_base); iproc32_write(shbde, reg, subwin_base);
/* Read it to make sure the write actually goes through */ /* Read it to make sure the write actually goes through */
subwin_base = iproc32_read(shbde, reg); subwin_base = iproc32_read(shbde, reg);
/* Read register through sub-window 7 */ /* Read register through sub-window 7 */
reg = ROFFS(iproc_regs, 0x7000 + (addr & 0xfff)); reg = ROFFS(iproc_regs, 0x7000 + (addr & 0xfff));
} }
iproc32_write(shbde, reg, data); iproc32_write(shbde, reg, data);

View File

@ -1,18 +1,17 @@
/* /*
* Unless you and Broadcom execute a separate written software license * Copyright 2017 Broadcom
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
* *
* As a special exception, the copyright holders of this software give * This program is free software; you can redistribute it and/or modify
* you permission to link this software with independent modules, and to * it under the terms of the GNU General Public License, version 2, as
* copy and distribute the resulting executable under terms of your * published by the Free Software Foundation (the "GPL").
* choice, provided that you also meet, for each linked independent *
* module, the terms and conditions of the license of that module. An * This program is distributed in the hope that it will be useful, but
* independent module is a module which is not derived from this * WITHOUT ANY WARRANTY; without even the implied warranty of
* software. The special exception does not apply to any modifications * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* of the software. * General Public License version 2 (GPLv2) for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 (GPLv2) along with this source code.
*/ */
/* /*
* $Id: $ * $Id: $

View File

@ -1,18 +1,17 @@
/* /*
* Unless you and Broadcom execute a separate written software license * Copyright 2017 Broadcom
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
* *
* As a special exception, the copyright holders of this software give * This program is free software; you can redistribute it and/or modify
* you permission to link this software with independent modules, and to * it under the terms of the GNU General Public License, version 2, as
* copy and distribute the resulting executable under terms of your * published by the Free Software Foundation (the "GPL").
* choice, provided that you also meet, for each linked independent *
* module, the terms and conditions of the license of that module. An * This program is distributed in the hope that it will be useful, but
* independent module is a module which is not derived from this * WITHOUT ANY WARRANTY; without even the implied warranty of
* software. The special exception does not apply to any modifications * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* of the software. * General Public License version 2 (GPLv2) for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 (GPLv2) along with this source code.
*/ */
/* /*
* $Id: $ * $Id: $

View File

@ -1,18 +1,17 @@
# #
# Unless you and Broadcom execute a separate written software license # Copyright 2017 Broadcom
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
# #
# As a special exception, the copyright holders of this software give # This program is free software; you can redistribute it and/or modify
# you permission to link this software with independent modules, and to # it under the terms of the GNU General Public License, version 2, as
# copy and distribute the resulting executable under terms of your # published by the Free Software Foundation (the "GPL").
# choice, provided that you also meet, for each linked independent #
# module, the terms and conditions of the license of that module. An # This program is distributed in the hope that it will be useful, but
# independent module is a module which is not derived from this # WITHOUT ANY WARRANTY; without even the implied warranty of
# software. The special exception does not apply to any modifications # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# of the software. # General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
# #
# -*- Makefile -*- # -*- Makefile -*-
# $Id: Makefile,v 1.10 Broadcom SDK $ # $Id: Makefile,v 1.10 Broadcom SDK $

View File

@ -1,18 +1,17 @@
# #
# Unless you and Broadcom execute a separate written software license # Copyright 2017 Broadcom
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
# #
# As a special exception, the copyright holders of this software give # This program is free software; you can redistribute it and/or modify
# you permission to link this software with independent modules, and to # it under the terms of the GNU General Public License, version 2, as
# copy and distribute the resulting executable under terms of your # published by the Free Software Foundation (the "GPL").
# choice, provided that you also meet, for each linked independent #
# module, the terms and conditions of the license of that module. An # This program is distributed in the hope that it will be useful, but
# independent module is a module which is not derived from this # WITHOUT ANY WARRANTY; without even the implied warranty of
# software. The special exception does not apply to any modifications # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# of the software. # General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
# #
# -*- Makefile -*- # -*- Makefile -*-
# $Id: Makefile,v 1.3 Broadcom SDK $ # $Id: Makefile,v 1.3 Broadcom SDK $

View File

@ -1,18 +1,17 @@
/* /*
* Unless you and Broadcom execute a separate written software license * Copyright 2017 Broadcom
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
* *
* As a special exception, the copyright holders of this software give * This program is free software; you can redistribute it and/or modify
* you permission to link this software with independent modules, and to * it under the terms of the GNU General Public License, version 2, as
* copy and distribute the resulting executable under terms of your * published by the Free Software Foundation (the "GPL").
* choice, provided that you also meet, for each linked independent *
* module, the terms and conditions of the license of that module. An * This program is distributed in the hope that it will be useful, but
* independent module is a module which is not derived from this * WITHOUT ANY WARRANTY; without even the implied warranty of
* software. The special exception does not apply to any modifications * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* of the software. * General Public License version 2 (GPLv2) for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 (GPLv2) along with this source code.
*/ */
/* /*
* $Id: bcm-knet.h,v 1.4 Broadcom SDK $ * $Id: bcm-knet.h,v 1.4 Broadcom SDK $

View File

@ -1,18 +1,17 @@
/* /*
* Unless you and Broadcom execute a separate written software license * Copyright 2017 Broadcom
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
* *
* As a special exception, the copyright holders of this software give * This program is free software; you can redistribute it and/or modify
* you permission to link this software with independent modules, and to * it under the terms of the GNU General Public License, version 2, as
* copy and distribute the resulting executable under terms of your * published by the Free Software Foundation (the "GPL").
* choice, provided that you also meet, for each linked independent *
* module, the terms and conditions of the license of that module. An * This program is distributed in the hope that it will be useful, but
* independent module is a module which is not derived from this * WITHOUT ANY WARRANTY; without even the implied warranty of
* software. The special exception does not apply to any modifications * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* of the software. * General Public License version 2 (GPLv2) for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 (GPLv2) along with this source code.
*/ */
/* /*
* $Id: gmodule.h,v 1.9 Broadcom SDK $ * $Id: gmodule.h,v 1.9 Broadcom SDK $

View File

@ -1,18 +1,17 @@
/* /*
* Unless you and Broadcom execute a separate written software license * Copyright 2017 Broadcom
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
* *
* As a special exception, the copyright holders of this software give * This program is free software; you can redistribute it and/or modify
* you permission to link this software with independent modules, and to * it under the terms of the GNU General Public License, version 2, as
* copy and distribute the resulting executable under terms of your * published by the Free Software Foundation (the "GPL").
* choice, provided that you also meet, for each linked independent *
* module, the terms and conditions of the license of that module. An * This program is distributed in the hope that it will be useful, but
* independent module is a module which is not derived from this * WITHOUT ANY WARRANTY; without even the implied warranty of
* software. The special exception does not apply to any modifications * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* of the software. * General Public License version 2 (GPLv2) for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 (GPLv2) along with this source code.
*/ */
/* /*
* $Id: lkm.h,v 1.22 Broadcom SDK $ * $Id: lkm.h,v 1.22 Broadcom SDK $

View File

@ -1,22 +1,21 @@
# #
# Unless you and Broadcom execute a separate written software license # Copyright 2017 Broadcom
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
# #
# As a special exception, the copyright holders of this software give # This program is free software; you can redistribute it and/or modify
# you permission to link this software with independent modules, and to # it under the terms of the GNU General Public License, version 2, as
# copy and distribute the resulting executable under terms of your # published by the Free Software Foundation (the "GPL").
# choice, provided that you also meet, for each linked independent #
# module, the terms and conditions of the license of that module. An # This program is distributed in the hope that it will be useful, but
# independent module is a module which is not derived from this # WITHOUT ANY WARRANTY; without even the implied warranty of
# software. The special exception does not apply to any modifications # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# of the software. # General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
# #
# -*- Makefile -*- # -*- Makefile -*-
# $Id: # $Id: Makefile,v 1.3 Broadcom SDK $
# $Copyright: (c) 2017 Broadcom Corp. # $Copyright: (c) 2005 Broadcom Corp.
# All Rights Reserved.$ # All Rights Reserved.$
# #
LOCALDIR = systems/linux/kernel/modules/knet-cb LOCALDIR = systems/linux/kernel/modules/knet-cb

View File

@ -1,21 +1,20 @@
/* /*
* Unless you and Broadcom execute a separate written software license * Copyright 2017 Broadcom
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
* *
* As a special exception, the copyright holders of this software give * This program is free software; you can redistribute it and/or modify
* you permission to link this software with independent modules, and to * it under the terms of the GNU General Public License, version 2, as
* copy and distribute the resulting executable under terms of your * published by the Free Software Foundation (the "GPL").
* choice, provided that you also meet, for each linked independent *
* module, the terms and conditions of the license of that module. An * This program is distributed in the hope that it will be useful, but
* independent module is a module which is not derived from this * WITHOUT ANY WARRANTY; without even the implied warranty of
* software. The special exception does not apply to any modifications * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* of the software. * General Public License version 2 (GPLv2) for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 (GPLv2) along with this source code.
*/ */
/* /*
* $Id: * $Id: $
* $Copyright: (c) 2017 Broadcom Corp. * $Copyright: (c) 2017 Broadcom Corp.
* All Rights Reserved.$ * All Rights Reserved.$
*/ */
@ -50,6 +49,13 @@ MODULE_AUTHOR("Broadcom Corporation");
MODULE_DESCRIPTION("Broadcom Linux KNET Call-Back Driver"); MODULE_DESCRIPTION("Broadcom Linux KNET Call-Back Driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
static int debug;
LKM_MOD_PARAM(debug, "i", int, 0);
MODULE_PARM_DESC(debug,
"Debug level (default 0)");
/* Module Information */ /* Module Information */
#define MODULE_MAJOR 121 #define MODULE_MAJOR 121
#define MODULE_NAME "linux-knet-cb" #define MODULE_NAME "linux-knet-cb"
@ -57,6 +63,9 @@ MODULE_LICENSE("GPL");
/* set KNET_CB_DEBUG for debug info */ /* set KNET_CB_DEBUG for debug info */
#define KNET_CB_DEBUG #define KNET_CB_DEBUG
#define FILTER_TAG_STRIP 0
#define FILTER_TAG_KEEP 1
/* Maintain tag strip statistics */ /* Maintain tag strip statistics */
struct strip_stats_s { struct strip_stats_s {
unsigned long stripped; /* Number of packets that have been stripped */ unsigned long stripped; /* Number of packets that have been stripped */
@ -113,63 +122,84 @@ get_tag_status(int dcb_type, void *meta)
uint32 *dcb = (uint32 *) meta; uint32 *dcb = (uint32 *) meta;
int tag_status; int tag_status;
switch (dcb_type) { switch (dcb_type) {
case 14: case 14:
case 19: case 19:
case 20: case 20:
case 21: case 21:
case 22: case 22:
case 30: case 30:
tag_status = (dcb[12] > 10) & 0x3; tag_status = (dcb[12] > 10) & 0x3;
break; break;
case 23: case 23:
case 29: case 29:
case 31: case 31:
case 34: case 34:
case 37: case 37:
case 26: case 26:
case 32: case 32:
case 33: case 33:
case 35: case 35:
tag_status = dcb[13] & 0x3; tag_status = dcb[13] & 0x3;
break; break;
default: case 36:
tag_status = -1; /* TD3 */
break; tag_status = ((dcb[13] >> 9) & 0x3);
break;
break;
case 38:
{
/* untested */
/* TH3 only parses outer tag. */
const int tag_map[4] = { 0, 2, -1, -1 };
tag_status = tag_map[(dcb[9] >> 13) & 0x3];
}
break;
default:
tag_status = -1;
break;
} }
#ifdef KNET_CB_DEBUG
if (debug & 0x1) {
gprintk("%s; DCB Type: %d; tag status: %d\n", __func__, dcb_type, tag_status);
}
#endif
return tag_status; return tag_status;
} }
/*
* SDK-134189 added the ability to pass two 4 byte unsigned values to the
* KNET callback function, one from the matching filter and one from the
* network interface. The usage of this data is completely defined by the
* user. In this case, if bit 0 of the interface value is set, tag stripping
* is enabled for that interface. When creating the interface and filter,
* something like the following is necessary: "netif.cb_user_data = uflags".
*/
#define NETIF_UNTAGGED_STRIP (1 << 0)
/* Rx packet callback function */ /* Rx packet callback function */
static struct sk_buff * static struct sk_buff *
strip_tag_rx_cb(struct sk_buff *skb, int dev_no, void *meta) strip_tag_rx_cb(struct sk_buff *skb, int dev_no, void *meta)
{ {
unsigned netif_flags = KNET_SKB_CB(skb)->netif_user_data; unsigned netif_flags = KNET_SKB_CB(skb)->netif_user_data;
unsigned filter_flags = KNET_SKB_CB(skb)->filter_user_data;
unsigned dcb_type; unsigned dcb_type;
int tag_status; int tag_status;
unsigned int strip_tag = 0;
/* Currently not using filter flags: /* Currently not using filter flags:
* unsigned filter_flags = KNET_SKB_CB(skb)->filter_user_data; * unsigned filter_flags = KNET_SKB_CB(skb)->filter_user_data;
*/ */
#ifdef KNET_CB_DEBUG #ifdef KNET_CB_DEBUG
gprintk("%s Enter; Flags: %08X\n", __func__, netif_flags); if (debug & 0x1) {
gprintk("%s Enter; netif Flags: %08X filter_flags %08X \n",
__func__, netif_flags, filter_flags);
}
#endif #endif
if ((netif_flags & NETIF_UNTAGGED_STRIP) == 0) { /* KNET implements this already */
/* Untagged stripping not enabled on this netif */ if (filter_flags == FILTER_TAG_KEEP)
{
strip_stats.skipped++; strip_stats.skipped++;
return skb; return skb;
} }
/* SAI strip implies always strip. If the packet is untagged or
inner taged, SDK adds a .1q tag, so we need to strip tag
anyway */
if (filter_flags == FILTER_TAG_STRIP)
{
strip_tag = 1;
}
/* Get DCB type for this packet, passed by KNET driver */ /* Get DCB type for this packet, passed by KNET driver */
dcb_type = KNET_SKB_CB(skb)->dcb_type; dcb_type = KNET_SKB_CB(skb)->dcb_type;
@ -177,7 +207,9 @@ strip_tag_rx_cb(struct sk_buff *skb, int dev_no, void *meta)
tag_status = get_tag_status(dcb_type, meta); tag_status = get_tag_status(dcb_type, meta);
#ifdef KNET_CB_DEBUG #ifdef KNET_CB_DEBUG
gprintk("%s; DCB Type: %d; tag status: %d\n", __func__, dcb_type, tag_status); if (debug & 0x1) {
gprintk("%s; DCB Type: %d; tag status: %d\n", __func__, dcb_type, tag_status);
}
#endif #endif
if (tag_status < 0) { if (tag_status < 0) {
@ -186,22 +218,24 @@ strip_tag_rx_cb(struct sk_buff *skb, int dev_no, void *meta)
} }
strip_stats.checked++; strip_stats.checked++;
/*
* Untagged and inner tagged packet will get a new tag from the switch if (strip_tag) {
* device, we need to strip this off.
*/
if (tag_status < 2) {
#ifdef KNET_CB_DEBUG #ifdef KNET_CB_DEBUG
gprintk("%s; Stripping VLAN\n", __func__); if (debug & 0x1) {
gprintk("%s; Stripping VLAN\n", __func__);
}
#endif #endif
strip_stats.stripped++; strip_stats.stripped++;
strip_vlan_tag(skb); strip_vlan_tag(skb);
} }
#ifdef KNET_CB_DEBUG #ifdef KNET_CB_DEBUG
else { else {
gprintk("%s; Preserve VLAN\n", __func__); if (debug & 0x1) {
gprintk("%s; Preserve VLAN\n", __func__);
}
} }
#endif #endif
return skb; return skb;
} }
@ -216,7 +250,7 @@ strip_tag_tx_cb(struct sk_buff *skb, int dev_no, void *meta)
/* Filter callback not used */ /* Filter callback not used */
static int static int
strip_tag_filter_cb(uint8_t * pkt, int size, int dev_no, void *meta, strip_tag_filter_cb(uint8_t * pkt, int size, int dev_no, void *meta,
int chan, kcom_filter_t *kf) int chan, kcom_filter_t *kf)
{ {
/* Pass through for now */ /* Pass through for now */
return 0; return 0;

View File

@ -1,18 +1,17 @@
# #
# Unless you and Broadcom execute a separate written software license # Copyright 2017 Broadcom
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
# #
# As a special exception, the copyright holders of this software give # This program is free software; you can redistribute it and/or modify
# you permission to link this software with independent modules, and to # it under the terms of the GNU General Public License, version 2, as
# copy and distribute the resulting executable under terms of your # published by the Free Software Foundation (the "GPL").
# choice, provided that you also meet, for each linked independent #
# module, the terms and conditions of the license of that module. An # This program is distributed in the hope that it will be useful, but
# independent module is a module which is not derived from this # WITHOUT ANY WARRANTY; without even the implied warranty of
# software. The special exception does not apply to any modifications # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# of the software. # General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
# #
# -*- Makefile -*- # -*- Makefile -*-
# $Id: Makefile,v 1.2 Broadcom SDK $ # $Id: Makefile,v 1.2 Broadcom SDK $

View File

@ -1,18 +1,17 @@
/* /*
* Unless you and Broadcom execute a separate written software license * Copyright 2017 Broadcom
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
* *
* As a special exception, the copyright holders of this software give * This program is free software; you can redistribute it and/or modify
* you permission to link this software with independent modules, and to * it under the terms of the GNU General Public License, version 2, as
* copy and distribute the resulting executable under terms of your * published by the Free Software Foundation (the "GPL").
* choice, provided that you also meet, for each linked independent *
* module, the terms and conditions of the license of that module. An * This program is distributed in the hope that it will be useful, but
* independent module is a module which is not derived from this * WITHOUT ANY WARRANTY; without even the implied warranty of
* software. The special exception does not apply to any modifications * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* of the software. * General Public License version 2 (GPLv2) for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 (GPLv2) along with this source code.
*/ */
/* /*
* $Id: gmodule.c,v 1.20 Broadcom SDK $ * $Id: gmodule.c,v 1.20 Broadcom SDK $

View File

@ -1,18 +1,17 @@
/* /*
* Unless you and Broadcom execute a separate written software license * Copyright 2017 Broadcom
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
* *
* As a special exception, the copyright holders of this software give * This program is free software; you can redistribute it and/or modify
* you permission to link this software with independent modules, and to * it under the terms of the GNU General Public License, version 2, as
* copy and distribute the resulting executable under terms of your * published by the Free Software Foundation (the "GPL").
* choice, provided that you also meet, for each linked independent *
* module, the terms and conditions of the license of that module. An * This program is distributed in the hope that it will be useful, but
* independent module is a module which is not derived from this * WITHOUT ANY WARRANTY; without even the implied warranty of
* software. The special exception does not apply to any modifications * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* of the software. * General Public License version 2 (GPLv2) for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 (GPLv2) along with this source code.
*/ */
/* /*
* $Id: ksal.c,v 1.1 Broadcom SDK $ * $Id: ksal.c,v 1.1 Broadcom SDK $

View File

@ -0,0 +1,63 @@
#
# Copyright 2017 Broadcom
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2, as
# published by the Free Software Foundation (the "GPL").
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
#
# -*- Makefile -*-
# $Id: Makefile,v 1.4 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp.
# All Rights Reserved.$
#
# This make job requires the following environment variables to be set:
#
# SDK - path to StrataXGS SDK root directory
#
# Optionally the following environment variables can be set to
# override the default build server configuration:
#
# PPC_TOOLS_DIR - path to build tools (if not in PATH already)
# PPC_CROSS_COMPILE - cross compile tools prefix
# LINUX_INCLUDE - path to Linux kernel include directory
#
SDK :=$(shell if [ -n "$$SDK" ] ; then\
echo $$SDK;\
else\
cd $(dir $(lastword $(MAKEFILE_LIST))); while /usr/bin/test ! -e RELEASE ; do \
dir=`cd ../;pwd`; \
if [ "$$dir" = "/" ] ; then \
echo Cannot find SDK in $(lastword $(MAKEFILE_LIST)) 1>&2; \
exit 1; \
fi ; \
cd $$dir; \
done ; \
pwd; \
fi)
ifeq ($(SDK),)
$(error Please run this in a tree)
endif
export SDK
override kernel_version=2_6
platform=bmw-$(kernel_version)
# Windriver linux version
#WRS_LINUX_VERSION=1.4
#WRS_LINUX_VERSION=2.0
LINUX_MAKE_USER=1
include ${SDK}/make/Make.linux

View File

@ -1,18 +1,17 @@
# #
# Unless you and Broadcom execute a separate written software license # Copyright 2017 Broadcom
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
# #
# As a special exception, the copyright holders of this software give # This program is free software; you can redistribute it and/or modify
# you permission to link this software with independent modules, and to # it under the terms of the GNU General Public License, version 2, as
# copy and distribute the resulting executable under terms of your # published by the Free Software Foundation (the "GPL").
# choice, provided that you also meet, for each linked independent #
# module, the terms and conditions of the license of that module. An # This program is distributed in the hope that it will be useful, but
# independent module is a module which is not derived from this # WITHOUT ANY WARRANTY; without even the implied warranty of
# software. The special exception does not apply to any modifications # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# of the software. # General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
# #
# -*- Makefile -*- # -*- Makefile -*-
# $Id: Makefile,v 1.4 Broadcom SDK $ # $Id: Makefile,v 1.4 Broadcom SDK $
@ -86,12 +85,12 @@ KERNEL_BDE :=$(DEST_DIR)/$(KERNEL_BDE_LOCAL)
USER_BDE_LOCAL :=linux-user-bde.$(KOBJ) USER_BDE_LOCAL :=linux-user-bde.$(KOBJ)
USER_BDE=$(DEST_DIR)/$(USER_BDE_LOCAL) USER_BDE=$(DEST_DIR)/$(USER_BDE_LOCAL)
BCM_KNET_LOCAL :=linux-bcm-knet.$(KOBJ)
BCM_KNET=$(DEST_DIR)/$(BCM_KNET_LOCAL)
KNET_CB_LOCAL := linux-knet-cb.$(KOBJ) KNET_CB_LOCAL := linux-knet-cb.$(KOBJ)
KNET_CB := $(DEST_DIR)/$(KNET_CB_LOCAL) KNET_CB := $(DEST_DIR)/$(KNET_CB_LOCAL)
BCM_KNET_LOCAL :=linux-bcm-knet.$(KOBJ)
BCM_KNET=$(DEST_DIR)/$(BCM_KNET_LOCAL)
ifeq (,$(findstring DELIVER,$(MAKECMDGOALS))) ifeq (,$(findstring DELIVER,$(MAKECMDGOALS)))
.DEFAULT_GOAL := all .DEFAULT_GOAL := all
all_targets := kernel_modules $(KERNEL_BDE) $(USER_BDE) all_targets := kernel_modules $(KERNEL_BDE) $(USER_BDE)
@ -118,11 +117,7 @@ LOCAL_TARGETS +=$(patsubst %,../$(platform)/%,$(BCM_KNET_LOCAL))
all_targets +=$(LOCAL_TARGETS) all_targets +=$(LOCAL_TARGETS)
endif endif
ADD_TO_CFLAGS += -I$(SDK)/systems/linux/kernel/modules/include ifdef BUILD_KNET_CB
COND_KNET_LIBS = libuser.$(libext)
ifeq ($(BUILD_KNET_CB),1)
# KNET callback module support
all_targets += $(KNET_CB) all_targets += $(KNET_CB)
ifeq ($(NO_LOCAL_TARGETS),) ifeq ($(NO_LOCAL_TARGETS),)
@ -131,9 +126,11 @@ all_targets +=$(LOCAL_TARGETS)
endif endif
endif endif
ADD_TO_CFLAGS += -I$(SDK)/systems/linux/kernel/modules/include
COND_KNET_LIBS = libuser.$(libext)
endif endif
#OPENNSL_FIXUP #SAI_FIXUP
.NOTPARALLEL: .NOTPARALLEL:
all: $(BLDDIR)/.tree $(all_targets) all: $(BLDDIR)/.tree $(all_targets)
@ -152,24 +149,20 @@ ADD_TO_CFLAGS += -I$(SDK)/systems/bde/linux/include
ADD_TO_CFLAGS += -DPROXY_SUPPORT=0 ADD_TO_CFLAGS += -DPROXY_SUPPORT=0
CFLAGS += $(ADD_TO_CFLAGS) CFLAGS += $(ADD_TO_CFLAGS)
#SAI_FIXUP
CFLAGS:=$(filter-out -fPIC, $(CFLAGS))
# Kernel network support
ifdef BUILD_KNET
knet_subdirs = shared bcm-knet
ifdef BUILD_KNET_CB
knet_subdirs += knet-cb
endif
endif # BUILD_KNET
kernel_modules: kernel_modules:
$(MAKE) -C $(SDK)/systems/bde/linux/kernel kernel_version=$(kernel_version) $(MAKE) -C $(SDK)/systems/bde/linux/kernel kernel_version=$(kernel_version)
$(MAKE) -C $(SDK)/systems/bde/linux/user/kernel kernel_version=$(kernel_version) $(MAKE) -C $(SDK)/systems/bde/linux/user/kernel kernel_version=$(kernel_version)
ifeq ($(BUILD_KNET),1) ifeq ($(BUILD_KNET),1)
$(MAKE) -j1 -C $(SDK)/systems/linux/kernel/modules kernel_version=$(kernel_version) \ $(MAKE) -j1 -C $(SDK)/systems/linux/kernel/modules kernel_version=$(kernel_version) \
subdirs="$(knet_subdirs)" override-target=linux-$(platform) CFLAGS="$(CFLAGS)" subdirs="shared bcm-knet" override-target=linux-$(platform) CFLAGS="$(CFLAGS)"
ifdef BUILD_KNET_CB
$(MAKE) -j1 -C $(SDK)/systems/linux/kernel/modules kernel_version=$(kernel_version) \
subdirs="knet-cb" override-target=linux-$(platform) CFLAGS="$(CFLAGS)"
endif
endif endif
$(KERNEL_BDE): $(KERN_BLDROOT)/linux-kernel-bde.$(KOBJ) $(KERNEL_BDE): $(KERN_BLDROOT)/linux-kernel-bde.$(KOBJ)
@ -193,14 +186,14 @@ clean::
$(MAKE) -C $(SDK)/systems/bde/linux/kernel $@ $(MAKE) -C $(SDK)/systems/bde/linux/kernel $@
$(MAKE) -C $(SDK)/systems/bde/linux/user/kernel $@ $(MAKE) -C $(SDK)/systems/bde/linux/user/kernel $@
$(MAKE) -C $(SDK)/systems/linux/kernel/modules \ $(MAKE) -C $(SDK)/systems/linux/kernel/modules \
subdirs="$(knet_subdirs)" \ subdirs="shared bcm-knet knet-cb" \
override-target=linux-$(platform) $@ override-target=linux-$(platform) $@
$(RM) $(KERNEL_BDE) $(USER_BDE) $(RM) $(KERNEL_BDE) $(USER_BDE)
$(RM) $(BCM_KNET) $(RM) $(BCM_KNET) $(KNET_CB)
$(RM) $(KNET_CB)
$(RM) $(KERN_BLDROOT)/linux-kernel-bde.$(KOBJ) $(RM) $(KERN_BLDROOT)/linux-kernel-bde.$(KOBJ)
$(RM) $(KERN_BLDROOT)/linux-user-bde.$(KOBJ) $(RM) $(KERN_BLDROOT)/linux-user-bde.$(KOBJ)
$(RM) $(KERN_BLDROOT)/linux-bcm-knet.$(KOBJ) $(RM) $(KERN_BLDROOT)/linux-bcm-knet.$(KOBJ)
$(RM) $(KERN_BLDROOT)/linux-knet-cb.$(KOBJ)
$(RM) $(LOCAL_TARGETS) $(RM) $(LOCAL_TARGETS)
distclean:: clean distclean:: clean

View File

@ -1,18 +1,17 @@
# #
# Unless you and Broadcom execute a separate written software license # Copyright 2017 Broadcom
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
# #
# As a special exception, the copyright holders of this software give # This program is free software; you can redistribute it and/or modify
# you permission to link this software with independent modules, and to # it under the terms of the GNU General Public License, version 2, as
# copy and distribute the resulting executable under terms of your # published by the Free Software Foundation (the "GPL").
# choice, provided that you also meet, for each linked independent #
# module, the terms and conditions of the license of that module. An # This program is distributed in the hope that it will be useful, but
# independent module is a module which is not derived from this # WITHOUT ANY WARRANTY; without even the implied warranty of
# software. The special exception does not apply to any modifications # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# of the software. # General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
# #
# -*- Makefile -*- # -*- Makefile -*-
# $Id: Makefile,v 1.9 Broadcom SDK $ # $Id: Makefile,v 1.9 Broadcom SDK $

View File

@ -1,18 +1,17 @@
# #
# Unless you and Broadcom execute a separate written software license # Copyright 2017 Broadcom
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
# #
# As a special exception, the copyright holders of this software give # This program is free software; you can redistribute it and/or modify
# you permission to link this software with independent modules, and to # it under the terms of the GNU General Public License, version 2, as
# copy and distribute the resulting executable under terms of your # published by the Free Software Foundation (the "GPL").
# choice, provided that you also meet, for each linked independent #
# module, the terms and conditions of the license of that module. An # This program is distributed in the hope that it will be useful, but
# independent module is a module which is not derived from this # WITHOUT ANY WARRANTY; without even the implied warranty of
# software. The special exception does not apply to any modifications # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# of the software. # General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
# #
# -*- Makefile -*- # -*- Makefile -*-
# $Id: Makefile,v 1.9 Broadcom SDK $ # $Id: Makefile,v 1.9 Broadcom SDK $

View File

@ -1,18 +1,17 @@
# #
# Unless you and Broadcom execute a separate written software license # Copyright 2017 Broadcom
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
# #
# As a special exception, the copyright holders of this software give # This program is free software; you can redistribute it and/or modify
# you permission to link this software with independent modules, and to # it under the terms of the GNU General Public License, version 2, as
# copy and distribute the resulting executable under terms of your # published by the Free Software Foundation (the "GPL").
# choice, provided that you also meet, for each linked independent #
# module, the terms and conditions of the license of that module. An # This program is distributed in the hope that it will be useful, but
# independent module is a module which is not derived from this # WITHOUT ANY WARRANTY; without even the implied warranty of
# software. The special exception does not apply to any modifications # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# of the software. # General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
# #
# -*- Makefile -*- # -*- Makefile -*-
# $Id: Makefile,v 1.7 Broadcom SDK $ # $Id: Makefile,v 1.7 Broadcom SDK $

View File

@ -1,18 +1,17 @@
# #
# Unless you and Broadcom execute a separate written software license # Copyright 2017 Broadcom
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
# #
# As a special exception, the copyright holders of this software give # This program is free software; you can redistribute it and/or modify
# you permission to link this software with independent modules, and to # it under the terms of the GNU General Public License, version 2, as
# copy and distribute the resulting executable under terms of your # published by the Free Software Foundation (the "GPL").
# choice, provided that you also meet, for each linked independent #
# module, the terms and conditions of the license of that module. An # This program is distributed in the hope that it will be useful, but
# independent module is a module which is not derived from this # WITHOUT ANY WARRANTY; without even the implied warranty of
# software. The special exception does not apply to any modifications # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# of the software. # General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
# #
# -*- Makefile -*- # -*- Makefile -*-
# $Id: Makefile,v 1.7 Broadcom SDK $ # $Id: Makefile,v 1.7 Broadcom SDK $

View File

@ -0,0 +1,79 @@
#
# Copyright 2017 Broadcom
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2, as
# published by the Free Software Foundation (the "GPL").
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
#
# -*- Makefile -*-
# $Id: Makefile,v 1.4 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp.
# All Rights Reserved.$
#
# This make job requires the following environment variables to be set:
#
# SDK - path to StrataXGS SDK root directory
#
# Optionally the following environment variables can be set to
# override the default build server configuration:
#
# MIPS_TOOLS_DIR - path to build tools (if not in PATH already)
# MIPS_CROSS_COMPILE - cross compile tools prefix
# LINUX_INCLUDE - path to Linux kernel include directory
#
SDK :=$(shell if [ -n "$$SDK" ] ; then\
echo $$SDK;\
else\
cd $(dir $(lastword $(MAKEFILE_LIST))); while /usr/bin/test ! -e RELEASE ; do \
dir=`cd ../;pwd`; \
if [ "$$dir" = "/" ] ; then \
echo Cannot find SDK in $(lastword $(MAKEFILE_LIST)) 1>&2; \
exit 1; \
fi ; \
cd $$dir; \
done ; \
pwd; \
fi)
ifeq ($(SDK),)
$(error Please run this in a tree)
endif
export SDK
override kernel_version=2_6
platform=jag-$(kernel_version)
# Select the build environment
#BUILD_PLATFORM=ELDK
#BUILD_PLATFORM=WR_LINUX
#Select the LINUX KERNEL VERSION
#KERN_VER = 2.6.21.7
# Select the ELDK version
#ELDK_VERSION=4.1
# Windriver linux version
#WRS_LINUX_VERSION=1.4
#WRS_LINUX_VERSION=2.0
export KERN_VER
export ELDK_VERSION
export BUILD_PLATFORM
export WRS_LINUX_VERSION
LINUX_MAKE_USER=1
include ${SDK}/make/Make.linux

View File

@ -0,0 +1,58 @@
#
# Copyright 2017 Broadcom
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2, as
# published by the Free Software Foundation (the "GPL").
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
#
# -*- Makefile -*-
# $Id: Makefile,v 1.4 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp.
# All Rights Reserved.$
#
# This make job requires the following environment variables to be set:
#
# SDK - path to StrataXGS SDK root directory
#
# Optionally the following environment variables can be set to
# override the default build server configuration:
#
# MIPS_TOOLS_DIR - path to build tools (if not in PATH already)
# MIPS_CROSS_COMPILE - cross compile tools prefix
# LINUX_INCLUDE - path to Linux kernel include directory
#
SDK :=$(shell if [ -n "$$SDK" ] ; then\
echo $$SDK;\
else\
cd $(dir $(lastword $(MAKEFILE_LIST))); while /usr/bin/test ! -e RELEASE ; do \
dir=`cd ../;pwd`; \
if [ "$$dir" = "/" ] ; then \
echo Cannot find SDK in $(lastword $(MAKEFILE_LIST)) 1>&2; \
exit 1; \
fi ; \
cd $$dir; \
done ; \
pwd; \
fi)
ifeq ($(SDK),)
$(error Please run this in a tree)
endif
export SDK
override kernel_version=2_6
platform=nsx-$(kernel_version)
LINUX_MAKE_USER=1
include ${SDK}/make/Make.linux

View File

@ -0,0 +1,57 @@
#
# Copyright 2017 Broadcom
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2, as
# published by the Free Software Foundation (the "GPL").
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
#
# -*- Makefile -*-
# $Id: Makefile,v 1.3 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp.
# All Rights Reserved.$
#
# This make job requires the following environment variables to be set:
#
# SDK - path to StrataXGS SDK root directory
#
# Optionally the following environment variables can be set to
# override the default build server configuration:
#
# MIPS_TOOLS_DIR - path to build tools (if not in PATH already)
# MIPS_CROSS_COMPILE - cross compile tools prefix
# LINUX_INCLUDE - path to Linux kernel include directory
#
SDK :=$(shell if [ -n "$$SDK" ] ; then\
echo $$SDK;\
else\
cd $(dir $(lastword $(MAKEFILE_LIST))); while /usr/bin/test ! -e RELEASE ; do \
dir=`cd ../;pwd`; \
if [ "$$dir" = "/" ] ; then \
echo Cannot find SDK in $(lastword $(MAKEFILE_LIST)) 1>&2; \
exit 1; \
fi ; \
cd $$dir; \
done ; \
pwd; \
fi)
ifeq ($(SDK),)
$(error Please run this in a tree)
endif
export SDK
platform=nsx64
LINUX_MAKE_USER=1
include ${SDK}/make/Make.linux

View File

@ -0,0 +1,65 @@
#
# Copyright 2017 Broadcom
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2, as
# published by the Free Software Foundation (the "GPL").
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
#
# -*- Makefile -*-
# $Id: Makefile,v 1.3 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp.
# All Rights Reserved.$
#
# This make job requires the following environment variables to be set:
#
# SDK - path to StrataXGS SDK root directory
#
# Optionally the following environment variables can be set to
# override the default build server configuration:
#
# MIPS_TOOLS_DIR - path to build tools (if not in PATH already)
# MIPS_CROSS_COMPILE - cross compile tools prefix
# LINUX_INCLUDE - path to Linux kernel include directory
#
SDK :=$(shell if [ -n "$$SDK" ] ; then\
echo $$SDK;\
else\
cd $(dir $(lastword $(MAKEFILE_LIST))); while /usr/bin/test ! -e RELEASE ; do \
dir=`cd ../;pwd`; \
if [ "$$dir" = "/" ] ; then \
echo Cannot find SDK in $(lastword $(MAKEFILE_LIST)) 1>&2; \
exit 1; \
fi ; \
cd $$dir; \
done ; \
pwd; \
fi)
ifeq ($(SDK),)
$(error Please run this in a tree)
endif
export SDK
override kernel_version=2_6
platform=nsx_wrl-$(kernel_version)
# Windriver linux version
#WRS_LINUX_VERSION=1.4
#WRS_LINUX_VERSION=2.0
export WRS_LINUX_VERSION
LINUX_MAKE_USER=1
include ${SDK}/make/Make.linux

View File

@ -0,0 +1,79 @@
#
# Copyright 2017 Broadcom
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2, as
# published by the Free Software Foundation (the "GPL").
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
#
# -*- Makefile -*-
# $Id: Makefile,v 1.5 Broadcom SDK $
# $Copyright: (c) 2007 Broadcom Corp.
# All Rights Reserved.$
#
# This make job requires the following environment variables to be set:
#
# SDK - path to StrataXGS SDK root directory
#
# Optionally the following environment variables can be set to
# override the default build server configuration:
#
# MIPS_TOOLS_DIR - path to build tools (if not in PATH already)
# MIPS_CROSS_COMPILE - cross compile tools prefix
# LINUX_INCLUDE - path to Linux kernel include directory
#
SDK :=$(shell if [ -n "$$SDK" ] ; then\
echo $$SDK;\
else\
cd $(dir $(lastword $(MAKEFILE_LIST))); while /usr/bin/test ! -e RELEASE ; do \
dir=`cd ../;pwd`; \
if [ "$$dir" = "/" ] ; then \
echo Cannot find SDK in $(lastword $(MAKEFILE_LIST)) 1>&2; \
exit 1; \
fi ; \
cd $$dir; \
done ; \
pwd; \
fi)
ifeq ($(SDK),)
$(error Please run this in a tree)
endif
export SDK
override kernel_version=2_6
platform=raptor-$(kernel_version)
# Select the build environment
#BUILD_PLATFORM=ELDK
#BUILD_PLATFORM=WR_LINUX
#Select the LINUX KERNEL VERSION
#KERN_VER = 2.6.21.7
# Select the ELDK version
#ELDK_VERSION=4.1
# Windriver linux version
#WRS_LINUX_VERSION=1.4
#WRS_LINUX_VERSION=2.0
export KERN_VER
export ELDK_VERSION
export BUILD_PLATFORM
export WRS_LINUX_VERSION
LINUX_MAKE_USER=1
include ${SDK}/make/Make.linux

View File

@ -0,0 +1,58 @@
#
# Copyright 2017 Broadcom
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2, as
# published by the Free Software Foundation (the "GPL").
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
#
# -*- Makefile -*-
# $Id: Makefile,v 1.1 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp.
# All Rights Reserved.$
#
# This make job requires the following environment variables to be set:
#
# SDK - path to StrataXGS SDK root directory
#
# Optionally the following environment variables can be set to
# override the default build server configuration:
#
# MIPS_TOOLS_DIR - path to build tools (if not in PATH already)
# MIPS_CROSS_COMPILE - cross compile tools prefix
# LINUX_INCLUDE - path to Linux kernel include directory
#
SDK :=$(shell if [ -n "$$SDK" ] ; then\
echo $$SDK;\
else\
cd $(dir $(lastword $(MAKEFILE_LIST))); while /usr/bin/test ! -e RELEASE ; do \
dir=`cd ../;pwd`; \
if [ "$$dir" = "/" ] ; then \
echo Cannot find SDK in $(lastword $(MAKEFILE_LIST)) 1>&2; \
exit 1; \
fi ; \
cd $$dir; \
done ; \
pwd; \
fi)
ifeq ($(SDK),)
$(error Please run this in a tree)
endif
export SDK
platform=raptor
LINUX_MAKE_USER=1
CFGFLAGS += -DBCM_ICS
include ${SDK}/make/Make.linux

View File

@ -1,18 +1,17 @@
# #
# Unless you and Broadcom execute a separate written software license # Copyright 2017 Broadcom
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
# #
# As a special exception, the copyright holders of this software give # This program is free software; you can redistribute it and/or modify
# you permission to link this software with independent modules, and to # it under the terms of the GNU General Public License, version 2, as
# copy and distribute the resulting executable under terms of your # published by the Free Software Foundation (the "GPL").
# choice, provided that you also meet, for each linked independent #
# module, the terms and conditions of the license of that module. An # This program is distributed in the hope that it will be useful, but
# independent module is a module which is not derived from this # WITHOUT ANY WARRANTY; without even the implied warranty of
# software. The special exception does not apply to any modifications # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# of the software. # General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
# #
# -*- Makefile -*- # -*- Makefile -*-
# $Id: Makefile,v 1.2 Broadcom SDK $ # $Id: Makefile,v 1.2 Broadcom SDK $

View File

@ -1,18 +1,17 @@
# #
# Unless you and Broadcom execute a separate written software license # Copyright 2017 Broadcom
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
# #
# As a special exception, the copyright holders of this software give # This program is free software; you can redistribute it and/or modify
# you permission to link this software with independent modules, and to # it under the terms of the GNU General Public License, version 2, as
# copy and distribute the resulting executable under terms of your # published by the Free Software Foundation (the "GPL").
# choice, provided that you also meet, for each linked independent #
# module, the terms and conditions of the license of that module. An # This program is distributed in the hope that it will be useful, but
# independent module is a module which is not derived from this # WITHOUT ANY WARRANTY; without even the implied warranty of
# software. The special exception does not apply to any modifications # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# of the software. # General Public License version 2 (GPLv2) for more details.
#
# You should have received a copy of the GNU General Public License
# version 2 (GPLv2) along with this source code.
# #
# #
# mktool.pl # mktool.pl