Skip to content

Commit

Permalink
Merge branch 'build-v0.7.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
ikwzm committed Mar 13, 2018
2 parents 5494dab + ed9bf8e commit b0272d8
Show file tree
Hide file tree
Showing 15 changed files with 206 additions and 336 deletions.
4 changes: 2 additions & 2 deletions doc/build/device-drivers.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ shell$ git clone https://github.com/ikwzm/PTTY_AXI4

```console
shell$ git archive --remote dtbocfg --prefix=dtbocfg/ --format=tar v0.0.3 | tar xf - -C drivers
shell$ git archive --remote fclkcfg --prefix=fclkcfg/ --format=tar v0.0.3 | tar xf - -C drivers
shell$ git archive --remote udmabuf --prefix=udmabuf/ --format=tar v0.10.0 | tar xf - -C drivers
shell$ git archive --remote fclkcfg --prefix=fclkcfg/ --format=tar v1.0.0 | tar xf - -C drivers
shell$ git archive --remote udmabuf --prefix=udmabuf/ --format=tar v1.1.0 | tar xf - -C drivers
shell$ cd PTTY_AXI4; git checkout v1.0.0; cp -r src/drivers/zptty ../drivers; cd ..
```

Expand Down
6 changes: 3 additions & 3 deletions doc/install/de0-nano-soc.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
```console
shell$ git clone git://github.com/ikwzm/FPGA-SoC-Linux
shell$ cd FPGA-SoC-Linux
shell$ git checkout v0.7.1
shell$ git checkout v0.7.2
shell$ git lfs pull
```

Expand All @@ -25,7 +25,7 @@ shell$ git lfs pull
* debian9-rootfs-vanilla.tgz : Debian9 Root File System (use Git LFS)
* linux-image-4.14.21-armv7-fpga_4.14.21-armv7-fpga-2_armhf.deb : Linux Image Package (use Git LFS)
* linux-headers-4.14.21-armv7-fpga_4.14.21-armv7-fpga-2_armhf.deb : Linux Headers Package (use Git LFS)
* fpga-soc-linux-drivers-4.14.21-armv7-fpga_0.1.1-1_armhf.deb : Device Drivers Package (use Git LFS)
* fpga-soc-linux-drivers-4.14.21-armv7-fpga_0.1.2-1_armhf.deb : Device Drivers Package (use Git LFS)
* fpga-soc-linux-services_0.0.9-1_armhf.deb : Device Services Package (use Git LFS)

#### Format SD-Card
Expand All @@ -51,7 +51,7 @@ shell# tar xfz debian9-rootfs-vanilla.tgz -C /mnt/u
shell# mkdir /mnt/usb2/home/fpga/debian
shell# cp linux-image-4.14.21-armv7-fpga_4.14.21-armv7-fpga-2_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp linux-headers-4.14.21-armv7-fpga_4.14.21-armv7-fpga-2_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp fpga-soc-linux-drivers-4.14.21-armv7-fpga_0.1.1-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp fpga-soc-linux-drivers-4.14.21-armv7-fpga_0.1.2-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp fpga-soc-linux-services_0.0.9-1_armhf.deb /mnt/usb2/home/fpga/debian
shell$ cp -r target/de0-nano-soc/examples /mnt/usb2/home/fpga
shell# umount mnt/usb1
Expand Down
36 changes: 25 additions & 11 deletions doc/install/device-drivers.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ Setting up linux-image-4.14.21-armv7-fpga (4.14.21-armv7-fpga-2) ...

```console
fpga@debian-fpga:~$ cd /home/fpga/debian
fpga@debian-fpga:~/debian$ sudo dpkg -i fpga-soc-linux-drivers-4.14.21-armv7-fpga_0.1.1-1_armhf.deb
fpga@debian-fpga:~/debian$ sudo dpkg -i fpga-soc-linux-drivers-4.14.21-armv7-fpga_0.1.2-1_armhf.deb
Selecting previously unselected package fpga-soc-linux-drivers-4.14.21-armv7-fpga.
(Reading database ... 62106 files and directories currently installed.)
Preparing to unpack fpga-soc-linux-drivers-4.14.21-armv7-fpga_0.1.1-1_armhf.deb ...
Unpacking fpga-soc-linux-drivers-4.14.21-armv7-fpga (0.1.1-1) ...
Setting up fpga-soc-linux-drivers-4.14.21-armv7-fpga (0.1.1-1) ...
(Reading database ... 81599 files and directories currently installed.)
Preparing to unpack fpga-soc-linux-drivers-4.14.21-armv7-fpga_0.1.2-1_armhf.deb ...
Unpacking fpga-soc-linux-drivers-4.14.21-armv7-fpga (0.1.2-1) ...
Setting up fpga-soc-linux-drivers-4.14.21-armv7-fpga (0.1.2-1) ...
```

```console
Expand Down Expand Up @@ -70,10 +70,10 @@ Created symlink /etc/systemd/system/multi-user.target.wants/zptty.service → /e
```console
fpga@debian-fpga:~$ sudo lsmod
Module Size Used by
zptty 16384 0
fclkcfg 16384 0
udmabuf 20480 0
dtbocfg 16384 0
zptty 16384 0
```

```console
Expand All @@ -85,7 +85,8 @@ fpga@debian-fpga:~/debian$ sudo systemctl status device-tree-overlay.service
Main PID: 1665 (code=exited, status=0/SUCCESS)
CGroup: /system.slice/device-tree-overlay.service

Feb 21 23:03:05 debian-fpga systemd[1]: Started Device Tree Overlay Service..
Mar 14 06:41:05 debian-fpga systemd[1]: Starting Device Tree Overlay Service..
Mar 14 06:41:05 debian-fpga systemd[1]: Started Device Tree Overlay Service..
```

```console
Expand All @@ -97,8 +98,8 @@ fpga@debian-fpga:~/debian$ sudo systemctl status udmabuf.service
Main PID: 1687 (code=exited, status=0/SUCCESS)
CGroup: /system.slice/udmabuf.service

Feb 21 23:03:06 debian-fpga systemd[1]: Started User space mappable DMA Buff....
Hint: Some lines were ellipsized, use -l to show in full.
Mar 14 06:41:06 debian-fpga systemd[1]: Starting User space mappable DMA Buff....
Mar 14 06:41:06 debian-fpga systemd[1]: Started User space mappable DMA Buff....
```

```console
Expand All @@ -109,7 +110,20 @@ fpga@debian-fpga:~/debian$ sudo systemctl status zptty.service
Process: 1694 ExecStart=/sbin/modprobe zptty (code=exited, status=0/SUCCESS)
Main PID: 1694 (code=exited, status=0/SUCCESS)

Feb 21 23:03:06 debian-fpga systemd[1]: Started Pseudo TTY Driver for commun....
Hint: Some lines were ellipsized, use -l to show in full.
Mar 14 06:42:06 debian-fpga systemd[1]: Starting Pseudo TTY Driver for commun....
Mar 14 06:42:06 debian-fpga systemd[1]: Started Pseudo TTY Driver for commun....
```

```console
fpga@debian-fpga:~/debian$ sudo systemctl status fpga-clock.service
● fpga-clock.service - FPGA Clock Service.
Loaded: loaded (/etc/systemd/system/fpga-clock.service; enabled; vendor prese
Active: active (exited) since Fri 2016-11-04 02:16:45 JST; 1 years 4 months a
Process: 1365 ExecStart=/sbin/modprobe fclkcfg (code=exited, status=0/SUCCESS)
Main PID: 1365 (code=exited, status=0/SUCCESS)
CGroup: /system.slice/fpga-clock.service

Mar 14 06:42:06 debian-fpga systemd[1]: Starting FPGA Clock Service....
Mar 14 06:42:06 debian-fpga systemd[1]: Started FPGA Clock Service....
```

6 changes: 3 additions & 3 deletions doc/install/zynq-pynqz1.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
```console
shell$ git clone git://github.com/ikwzm/FPGA-SoC-Linux
shell$ cd FPGA-SoC-Linux
shell$ git checkout v0.7.1
shell$ git checkout v0.7.2
shell$ git lfs pull
```

Expand All @@ -23,7 +23,7 @@ shell$ git lfs pull
* debian9-rootfs-vanilla.tgz : Debian9 Root File System (use Git LFS)
* linux-image-4.14.21-armv7-fpga_4.14.21-armv7-fpga-2_armhf.deb : Linux Image Package (use Git LFS)
* linux-headers-4.14.21-armv7-fpga_4.14.21-armv7-fpga-2_armhf.deb : Linux Headers Package (use Git LFS)
* fpga-soc-linux-drivers-4.14.21-armv7-fpga_0.1.1-1_armhf.deb : Device Drivers Package (use Git LFS)
* fpga-soc-linux-drivers-4.14.21-armv7-fpga_0.1.2-1_armhf.deb : Device Drivers Package (use Git LFS)
* fpga-soc-linux-services_0.0.9-1_armhf.deb : Device Services Package (use Git LFS)

#### Format SD-Card
Expand All @@ -47,7 +47,7 @@ shell# tar xfz debian9-rootfs-vanilla.tgz -C /mnt/u
shell# mkdir /mnt/usb2/home/fpga/debian
shell# cp linux-image-4.14.21-armv7-fpga_4.14.21-armv7-fpga-2_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp linux-headers-4.14.21-armv7-fpga_4.14.21-armv7-fpga-2_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp fpga-soc-linux-drivers-4.14.21-armv7-fpga_0.1.1-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp fpga-soc-linux-drivers-4.14.21-armv7-fpga_0.1.2-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp fpga-soc-linux-services_0.0.9-1_armhf.deb /mnt/usb2/home/fpga/debian
shell$ cp -r target/zynq-pynqz1/examples /mnt/usb2/home/fpga
shell# umount mnt/usb1
Expand Down
6 changes: 3 additions & 3 deletions doc/install/zynq-zybo-de0-nano-soc.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ It corresponds to boot of both ZYBO and DE0-Nano-SoC in one SD-Card.
```console
shell$ git clone git://github.com/ikwzm/FPGA-SoC-Linux
shell$ cd FPGA-SoC-Linux
shell$ git checkout v0.7.1
shell$ git checkout v0.7.2
shell$ git lfs pull
```
#### Build boot files
Expand Down Expand Up @@ -59,7 +59,7 @@ cp ../de0-nano-soc/u-boot/u-boot.img u-boot/u-boot.img
* debian9-rootfs-vanilla.tgz : Debian9 Root File System (use Git LFS)
* linux-image-4.14.21-armv7-fpga_4.14.21-armv7-fpga-2_armhf.deb : Linux Image Package (use Git LFS)
* linux-headers-4.14.21-armv7-fpga_4.14.21-armv7-fpga-2_armhf.deb : Linux Headers Package (use Git LFS)
* fpga-soc-linux-drivers-4.14.21-armv7-fpga_0.1.1-1_armhf.deb : Device Drivers Package (use Git LFS)
* fpga-soc-linux-drivers-4.14.21-armv7-fpga_0.1.2-1_armhf.deb : Device Drivers Package (use Git LFS)
* fpga-soc-linux-services_0.0.9-1_armhf.deb : Device Services Package (use Git LFS)

#### Format SD-Card
Expand All @@ -85,7 +85,7 @@ shell# tar xfz debian9-rootfs-vanilla.tgz -C /mnt/u
shell# mkdir /mnt/usb2/home/fpga/debian
shell# cp linux-image-4.14.21-armv7-fpga_4.14.21-armv7-fpga-2_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp linux-headers-4.14.21-armv7-fpga_4.14.21-armv7-fpga-2_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp fpga-soc-linux-drivers-4.14.21-armv7-fpga_0.1.1-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp fpga-soc-linux-drivers-4.14.21-armv7-fpga_0.1.2-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp fpga-soc-linux-services_0.0.9-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# umount mnt/usb1
shell# umount mnt/usb2
Expand Down
6 changes: 3 additions & 3 deletions doc/install/zynq-zybo-z7.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
```console
shell$ git clone git://github.com/ikwzm/FPGA-SoC-Linux
shell$ cd FPGA-SoC-Linux
shell$ git checkout v0.7.1
shell$ git checkout v0.7.2
shell$ git lfs pull
```

Expand All @@ -22,7 +22,7 @@ shell$ git lfs pull
* debian9-rootfs-vanilla.tgz : Debian9 Root File System (use Git LFS)
* linux-image-4.14.21-armv7-fpga_4.14.21-armv7-fpga-2_armhf.deb : Linux Image Package (use Git LFS)
* linux-headers-4.14.21-armv7-fpga_4.14.21-armv7-fpga-2_armhf.deb : Linux Headers Package (use Git LFS)
* fpga-soc-linux-drivers-4.14.21-armv7-fpga_0.1.1-1_armhf.deb : Device Drivers Package (use Git LFS)
* fpga-soc-linux-drivers-4.14.21-armv7-fpga_0.1.2-1_armhf.deb : Device Drivers Package (use Git LFS)
* fpga-soc-linux-services_0.0.9-1_armhf.deb : Device Services Package (use Git LFS)

#### Format SD-Card
Expand All @@ -46,7 +46,7 @@ shell# tar xfz debian9-rootfs-vanilla.tgz -C /mnt/u
shell# mkdir /mnt/usb2/home/fpga/debian
shell# cp linux-image-4.14.21-armv7-fpga_4.14.21-armv7-fpga-2_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp linux-headers-4.14.21-armv7-fpga_4.14.21-armv7-fpga-2_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp fpga-soc-linux-drivers-4.14.21-armv7-fpga_0.1.1-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp fpga-soc-linux-drivers-4.14.21-armv7-fpga_0.1.2-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp fpga-soc-linux-services_0.0.9-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# umount mnt/usb1
shell# umount mnt/usb2
Expand Down
6 changes: 3 additions & 3 deletions doc/install/zynq-zybo.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
```console
shell$ git clone git://github.com/ikwzm/FPGA-SoC-Linux
shell$ cd FPGA-SoC-Linux
shell$ git checkout v0.7.1
shell$ git checkout v0.7.2
shell$ git lfs pull
```

Expand All @@ -24,7 +24,7 @@ shell$ git lfs pull
* debian9-rootfs-vanilla.tgz : Debian9 Root File System (use Git LFS)
* linux-image-4.14.21-armv7-fpga_4.14.21-armv7-fpga-2_armhf.deb : Linux Image Package (use Git LFS)
* linux-headers-4.14.21-armv7-fpga_4.14.21-armv7-fpga-2_armhf.deb : Linux Headers Package (use Git LFS)
* fpga-soc-linux-drivers-4.14.21-armv7-fpga_0.1.1-1_armhf.deb : Device Drivers Package (use Git LFS)
* fpga-soc-linux-drivers-4.14.21-armv7-fpga_0.1.2-1_armhf.deb : Device Drivers Package (use Git LFS)
* fpga-soc-linux-services_0.0.9-1_armhf.deb : Device Services Package (use Git LFS)

#### Format SD-Card
Expand All @@ -48,7 +48,7 @@ shell# tar xfz debian9-rootfs-vanilla.tgz -C /mnt/u
shell# mkdir /mnt/usb2/home/fpga/debian
shell# cp linux-image-4.14.21-armv7-fpga_4.14.21-armv7-fpga-2_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp linux-headers-4.14.21-armv7-fpga_4.14.21-armv7-fpga-2_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp fpga-soc-linux-drivers-4.14.21-armv7-fpga_0.1.1-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp fpga-soc-linux-drivers-4.14.21-armv7-fpga_0.1.2-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp fpga-soc-linux-services_0.0.9-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp -r target/zynq-zybo/examples /mnt/usb2/home/fpga
shell# umount mnt/usb1
Expand Down
5 changes: 5 additions & 0 deletions drivers/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
fpga-soc-linux-drivers (0.1.2-1) unstable; urgency=low

* Update udmabuf v1.1.0
* Update fclkcfg v1.0.0

fpga-soc-linux-drivers (0.1.1-1) unstable; urgency=low

* Update udmabuf v0.10.0
Expand Down
21 changes: 9 additions & 12 deletions drivers/fclkcfg/fclkcfg.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*********************************************************************************
*
* Copyright (C) 2016-2017 Ichiro Kawazome
* Copyright (C) 2016-2018 Ichiro Kawazome
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -44,9 +44,9 @@
#include <linux/firmware.h>
#include <linux/fs.h>
#include <linux/version.h>
#include "minor_number_allocator.h"

#define DRIVER_NAME "fclkcfg"
#define DEVICE_MAX_NUM 32

#if (LINUX_VERSION_CODE >= 0x030B00)
#define USE_DEV_GROUPS 1
Expand All @@ -56,6 +56,7 @@

static struct class* fclkcfg_sys_class = NULL;
static dev_t fclkcfg_device_number = 0;
static DEFINE_IDA( fclkcfg_device_ida );

/**
* struct fclk_driver_data - Device driver structure
Expand Down Expand Up @@ -226,11 +227,6 @@ static const struct attribute_group* fclkcfg_attr_groups[] = {
#define SET_SYS_CLASS_ATTRIBUTES(sys_class) {(sys_class)->dev_attrs = fclkcfg_device_attrs;}
#endif

/**
* fclkcfg_device_minor_number_bitmap
*/
DECLARE_MINOR_NUMBER_ALLOCATOR(fclkcfg_device, 64);

/**
* fclkcfg_platform_driver_probe() - Probe call for the device.
*
Expand Down Expand Up @@ -265,7 +261,7 @@ static int fclkcfg_platform_driver_probe(struct platform_device *pdev)
*/
dev_dbg(&pdev->dev, "get device_number start.\n");
{
int minor_number = fclkcfg_device_minor_number_new();
int minor_number = ida_simple_get(&fclkcfg_device_ida, 0, DEVICE_MAX_NUM, GFP_KERNEL);
if (minor_number < 0) {
dev_err(&pdev->dev, "invalid or conflict minor number %d.\n", minor_number);
retval = -ENODEV;
Expand All @@ -282,7 +278,7 @@ static int fclkcfg_platform_driver_probe(struct platform_device *pdev)
{
this->clk = of_clk_get(pdev->dev.of_node, 0);
if (IS_ERR_OR_NULL(this->clk)) {
dev_err(&pdev->dev, "clk_get failed for fclk0.\n");
dev_err(&pdev->dev, "of_clk_get() failed.\n");
retval = PTR_ERR(this->clk);
this->clk = NULL;
goto failed;
Expand Down Expand Up @@ -428,7 +424,7 @@ static int fclkcfg_platform_driver_probe(struct platform_device *pdev)
this->device = NULL;
}
if (this->device_number){
fclkcfg_device_minor_number_free(MINOR(this->device_number));
ida_simple_remove(&fclkcfg_device_ida, MINOR(this->device_number));
this->device_number = 0;
}
kfree(this);
Expand Down Expand Up @@ -468,7 +464,7 @@ static int fclkcfg_platform_driver_remove(struct platform_device *pdev)
this->device = NULL;
}
if (this->device_number){
fclkcfg_device_minor_number_free(MINOR(this->device_number));
ida_simple_remove(&fclkcfg_device_ida, MINOR(this->device_number));
this->device_number = 0;
}
kfree(this);
Expand Down Expand Up @@ -508,6 +504,7 @@ static void __exit fclkcfg_module_exit(void)
if (fclkcfg_platform_driver_done ){platform_driver_unregister(&fclkcfg_platform_driver);}
if (fclkcfg_sys_class != NULL){class_destroy(fclkcfg_sys_class);}
if (fclkcfg_device_number != 0 ){unregister_chrdev_region(fclkcfg_device_number, 0);}
ida_destroy(&fclkcfg_device_ida);
}

/**
Expand All @@ -517,7 +514,7 @@ static int __init fclkcfg_module_init(void)
{
int retval = 0;

fclkcfg_device_minor_number_allocator_initilize();
ida_init(&fclkcfg_device_ida);

retval = alloc_chrdev_region(&fclkcfg_device_number, 0, 0, DRIVER_NAME);
if (retval != 0) {
Expand Down
Loading

0 comments on commit b0272d8

Please sign in to comment.