Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Move bfn asic drivers out of platform package (#30) #2183

Merged
merged 3 commits into from
Oct 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions platform/barefoot/bfn-modules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# BFN Platform modules

VERSION = 1.0

BFN_MODULE = bfn-modules_$(VERSION)_amd64.deb
$(BFN_MODULE)_SRC_PATH = $(PLATFORM_PATH)/bfn-modules
$(BFN_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON)
SONIC_DPKG_DEBS += $(BFN_MODULE)

SONIC_STRETCH_DEBS += $(BFN_MODULE)
37 changes: 37 additions & 0 deletions platform/barefoot/bfn-modules/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
BAREFOOT NETWORKS CONFIDENTIAL & PROPRIETARY

Copyright (c) 2015-2016 Barefoot Networks, Inc.

All Rights Reserved.

NOTICE: All information contained herein is, and remains the property of
Barefoot Networks, Inc. and its suppliers, if any. The intellectual and
technical concepts contained herein are proprietary to Barefoot Networks,
Inc.
and its suppliers and may be covered by U.S. and Foreign Patents, patents in
process, and are protected by trade secret or copyright law.
Dissemination of this information or reproduction of this material is
strictly forbidden unless prior written permission is obtained from
Barefoot Networks, Inc.

No warranty, explicit or implicit is provided, unless granted under a
written agreement with Barefoot Networks, Inc.


GPL LICENSE SUMMARY

Copyright(c) 2015 Barefoot Networks. All rights reserved.

This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License as
published by the Free Software Foundation.

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 for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the...


4 changes: 4 additions & 0 deletions platform/barefoot/bfn-modules/MAINTAINERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This file describes the maintainers for sonic-platform-modules-bfn
# See the SONiC project governance document for more information

Mailinglist = sonicproject@googlegroups.com
2 changes: 2 additions & 0 deletions platform/barefoot/bfn-modules/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# bfn-modules
Device drivers for support of BFN platform for the SONiC project
5 changes: 5 additions & 0 deletions platform/barefoot/bfn-modules/debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
bfn-modules (1.0) unstable; urgency=low

* Initial release

-- Support <support@barefootnetworks.com> Mon, 22 Oct 2018 11:11:11 -0800
1 change: 1 addition & 0 deletions platform/barefoot/bfn-modules/debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8
12 changes: 12 additions & 0 deletions platform/barefoot/bfn-modules/debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Source: bfn-modules
Section: main
Priority: extra
Maintainer: support <support@barefootnetworks.com>
Build-Depends: debhelper (>= 8.0.0), bzip2
Standards-Version: 3.9.3

Package: bfn-modules
Architecture: amd64
Depends: linux-image-4.9.0-7-amd64
Description: kernel modules for bfn asic for mmap

15 changes: 15 additions & 0 deletions platform/barefoot/bfn-modules/debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Provides linux kernel driver for BF PCIe devices

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

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 for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1 change: 1 addition & 0 deletions platform/barefoot/bfn-modules/debian/files
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bfn-modules_1.0_amd64.deb main extra
30 changes: 30 additions & 0 deletions platform/barefoot/bfn-modules/debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/make -f

export INSTALL_MOD_DIR:=extra

PACKAGE_NAME := bfn-modules
KVERSION ?= $(shell uname -r)
KERNEL_SRC := /lib/modules/$(KVERSION)
MODULE_SRC := $(shell pwd)/modules

%:
dh $@

override_dh_auto_build:
make -C $(KERNEL_SRC)/build M=$(MODULE_SRC)

override_dh_auto_install:
dh_installdirs -p$(PACKAGE_NAME) $(KERNEL_SRC)/$(INSTALL_MOD_DIR)
cp $(MODULE_SRC)/*.ko debian/$(PACKAGE_NAME)/$(KERNEL_SRC)/$(INSTALL_MOD_DIR)
dh_installdirs -p$(PACKAGE_NAME) usr/local/bin

override_dh_usrlocal:

override_dh_pysupport:

override_dh_clean:
dh_clean
rm -f $(MODULE_SRC)/*.o $(MODULE_SRC)/*.ko $(MODULE_SRC)/*.mod.c $(MODULE_SRC)/.*.cmd
rm -f $(MODULE_SRC)/Module.markers $(MODULE_SRC)/Module.symvers $(MODULE_SRC)/modules.order
rm -rf $(MODULE_SRC)/.tmp_versions

49 changes: 49 additions & 0 deletions platform/barefoot/bfn-modules/modules/bf_ioctl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*******************************************************************************
* BAREFOOT NETWORKS CONFIDENTIAL & PROPRIETARY
*
* Copyright (c) 2018-2018 Barefoot Networks, Inc.
*
* NOTICE: All information contained herein is, and remains the property of
* Barefoot Networks, Inc. and its suppliers, if any. The intellectual and
* technical concepts contained herein are proprietary to Barefoot Networks,
* Inc.
* and its suppliers and may be covered by U.S. and Foreign Patents, patents in
* process, and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material is
* strictly forbidden unless prior written permission is obtained from
* Barefoot Networks, Inc.
*
* No warranty, explicit or implicit is provided, unless granted under a
* written agreement with Barefoot Networks, Inc.
*
* $Id: $
*
******************************************************************************/

#ifndef _BF_IOCTL_H_
#define _BF_IOCTL_H_

#ifdef __KERNEL__
#include <linux/ioctl.h>
#else
#include <sys/ioctl.h>

#ifndef phys_addr_t
typedef uint64_t phys_addr_t;
#endif

#endif /* __KERNEL__ */

#define BF_IOC_MAGIC 'b'

typedef struct bf_dma_bus_map_s
{
phys_addr_t phy_addr;
void *dma_addr;
size_t size;
} bf_dma_bus_map_t;

#define BF_IOCMAPDMAADDR _IOWR(BF_IOC_MAGIC, 0, bf_dma_bus_map_t)
#define BF_IOCUNMAPDMAADDR _IOW(BF_IOC_MAGIC, 0, bf_dma_bus_map_t)

#endif /* _BF_IOCTL_H_ */
Loading