Skip to content

Commit

Permalink
bup
Browse files Browse the repository at this point in the history
  • Loading branch information
Spyros Papanastasiou committed Mar 26, 2024
1 parent f63973c commit e02600f
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ I prefer a top-down approach.
Next([Creating a project](site/projects/linux/preliminary/Project.md))
* Chapter 1: [Hellow World](site/projects/linux/hellow_world/README.md)
Next([Linux part](site/projects/linux/hellow_world/Code.md))
* ~~Chapter 2: [PS(Gpio)](site/projects/linux/gpio/README.md)~~
* Chapter 2: [Linux GPIO](site/projects/linux/gpio/README.md): LEDs w/ PL(CLK)
Next: [PS(BUTTON) 2 PL](site/projects/linux/gpio/part2.md)
* #### Goals:
* DMA?

Expand Down
89 changes: 89 additions & 0 deletions site/projects/linux/gpio/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
### Assuming [Hellow World](../hellow_world/README.md)

# Part 1: LEDs w/ PL(CLK)

---

## GPIO(test)

There is a list of [drivers] for linux. As per the [gpio] driver, let's test the:

* USER_LED1(0)
* USER_LED2(9)
* SW1(50)

Let's identify the GPIOChip:
Looking at `/sys/class/gpio`:
```bash
root@spyros:~# cd /sys/class/gpio/
root@spyros:/sys/class/gpio# grep . */*
gpiochip1022/base:1022
gpiochip1022/label:41210000.gpio
gpiochip1022/ngpio:1
gpiochip1023/base:1023
gpiochip1023/label:41200000.gpio
gpiochip1023/ngpio:1
gpiochip904/base:904
gpiochip904/label:zynq_gpio
gpiochip904/ngpio:118
```

Apparently, `gpiochip904` will contain the PS(GPIO). As per the [driver][gpio]:

* `904`: defines the base
* `118`: defines the amount

Thus, our PS(GPIO) pins are from 904 + 0 to 904 + 118.
[From previous chapters\], We need MIO(**0, 9 and 50**):
**Export** the pins: Fix the **directions**:

* `$ echo $((904 + 0)) > export`
* `$ echo out > gpio$((904 + 0))/direction`
* `$ echo $((904 + 9)) > export`
* `$ echo out > gpio$((904 + 9))/direction`
* `$ echo $((904 + 50)) > export`

(The remaining 1022/1023 gpios are AXI(button in) and AXI(CLK out). They both work).

---

# Crude notes

* rename nets and elements. Changes for dts (components).
* dtc -I fs /sys/firmware/devicetree/base
* &gpio0 (LEDs)
* /usr/src/linux/uapi/linux/input/input-event-codes.h
* include file
* reference to root
* /dev/input/by-path/platform-buttons-event (hexdump) < evtest
* build essential
* CONFIG_nano https://support.xilinx.com/s/question/0D52E00006xnpfBSAQ/add-nano-editor-to-petalinux-20202?language=en_US
* evtest button
* ~~IMAGE_INSTALL_append = "kernel-devsrc"~~ vitis
* merge downloads (w/ .done)
* first-boot checklist

troubleshooting

* error fetching (gitlab rename) (take git) (build keep done delete .git)

---

## Interrupt from PL(downscaled CLK)

Let's try to handle AXI(CLK out) as an interrupt.

---

# Next: Part 2: [PS(BUTTON) 2 PL](part2.md)

---

## Referencies

* [Linux Drivers](https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841873/Linux+Drivers) (GPIO, interrupt controler) (*wiki*)

---

[drivers]: https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841873/Linux+Drivers
[gpio]: https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842398/Linux+GPIO+Driver
Empty file.
2 changes: 1 addition & 1 deletion site/projects/standalone/PL&PS.synced/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
* [[Code] Explanation](code.md)
* Vitis: For those interested, renaming `.c` to `.cpp` and using `extern "C" {}` on `C` headers, seems to work (for now 😱).
* Instead of describing the code, i'll jump right to the next chapter, with the hopes of using an `AXI Interrupt Controller` [successfully].
* I suppose, it's not needed. (Proceeding with next chapters).
* I suppose, it's not needed. (Proceeding with next chapters).

---

Expand Down

0 comments on commit e02600f

Please sign in to comment.