Commit d2f716dd authored by Manohar Vanga's avatar Manohar Vanga

simulation: add copyright headers and clean directories

Signed-off-by: 's avatarManohar Vanga <manohar.vanga@gmail.com>
parent 53527b89
/*
* Fake DAC Wishbone driver
*
* Author: Manohar Vanga <manohar.vanga@cern.ch>
* Copyright (C) 2011 CERN
*
* 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.
*/
#include <linux/wishbone.h>
#define WB_CERN_VENDOR 0x0
......
/*
* Fake ADC Wishbone driver
*
* Author: Manohar Vanga <manohar.vanga@cern.ch>
* Copyright (C) 2011 CERN
*
* 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.
*/
#include <linux/wishbone.h>
#define WB_CERN_VENDOR 0x0
......
/*
* Fake SPEC board Wishbone driver
*
* Author: Manohar Vanga <manohar.vanga@cern.ch>
* Copyright (C) 2011 CERN
*
* 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.
*/
#include <linux/module.h>
#include <linux/init.h>
#include <linux/pci.h>
......
CFLAGS += -I../include
all: wb_addrgen
wb_addrgen: wb_addrgen.o
gcc wb_addrgen.o -o wb_addrgen
clean:
rm -rf wb_addrgen *.o
Generating Firmware
===================
To generate a Wishbone memory map, we assume that all devices
are at 1KB addresses. This can be changed easily later.
To generate the firmware file for the spec board:
$ ./wb_addrgen wbone.def firmware.bin
The wbone.def file looks like this:
$ cat wbone.def
#Vendor Device Subdevice Priority Class Version
1 2 3 4 5 6
10 11 12 13 14 15
Installing Firmware
===================
The generated firmware file should be 4KB in size.
copy the firmware file into /lib/firmware/NAME
NAME is as specified in the driver
......@@ -7,4 +28,4 @@ For the spec driver, the firmware name is expected to be
Default Vendor ID (4 bytes): 0x0000babe
Default Device ID (2 bytes): 0xbabe
$ cp fw/wb_addr/firmware.bin /lib/firmware/fakespec-0000babe-babe
$ cp firmware.bin /lib/firmware/fakespec-0000babe-babe
all: wb_fw
wb_fw: firmware.o
gcc firmware.o -o wb_fw
clean:
rm -rf wb_fw *.o
To generate a Wishbone memory map, we assume that all devices
are at 1KB addresses. This can be changed easily later.
To generate the firmware file for the spec board:
$ ./wb_fw wbone.def firmware.bin
The wbone.def file looks like this:
$ cat wbone.def
#Vendor Device Subdevice Priority Class Version
1 2 3 4 5 6
10 11 12 13 14 15
The generated firmware file should be 4KB in size.
/*
* Wishbone memory map firmware generator
*
* Author: Manohar Vanga <manohar.vanga@cern.ch>
* Copyright (C) 2011 CERN
*
* 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.
*/
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
#include "../../sdwb.h"
#include <linux/sdwb.h>
#define PRIORITY(flag) ((flag >> 28) & 0xf)
#define CLASS(flag) ((flag >> 16) & 0xfff)
......
/* Self-Describing Wishbone Bus (SDWB) specification header file */
/*
* Self-Describing Wishbone Bus (SDWB) specification header file
*
* Author: Manohar Vanga <manohar.vanga@cern.ch>
* Copyright (C) 2011 CERN
*
* 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.
*/
#ifndef _SDWB_H
#define _SDWB_H
......
/*
* Wishbone bus driver
*
* Author: Manohar Vanga <manohar.vanga@cern.ch>
* Copyright (C) 2011 CERN
*
* 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.
*/
#ifndef _LINUX_WISHBONE_H
#define _LINUX_WISHBONE_H
......
/*
* Wishbone bus driver
*
* Author: Manohar Vanga <manohar.vanga@cern.ch>
* Copyright (C) 2011 CERN
*
* 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.
*/
#include <linux/version.h>
#include <linux/module.h>
#include <linux/init.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment