Skip to content

Commit

Permalink
Merge pull request #91 from vicharak-in/utsav
Browse files Browse the repository at this point in the history
Vaaman doc updates
  • Loading branch information
bojle authored Nov 7, 2023
2 parents 9155d01 + 7c77702 commit 1ac64d9
Show file tree
Hide file tree
Showing 6 changed files with 435 additions and 153 deletions.
273 changes: 146 additions & 127 deletions Pipfile.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions source/spelling_wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ toolchain
trion
txt
uboot
ums
updateimg
userdata
userspace
Expand Down
47 changes: 40 additions & 7 deletions source/vaaman-gpio-description.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,30 @@ orphan: true

# Vaaman GPIO Description

Vicharak Vaaman board features a 40-pin GPIO (General-Purpose Input/Output)
header that provides flexible options for connecting and controlling external
devices. Through software settings, you can configure these pins as either
input or output, making them adaptable for various applications.

Out of the 40 pins on the header, 27 are dedicated GPIO pins. These GPIO pins
can also be repurposed for SPI (Serial Peripheral Interface),
UART (Universal Asynchronous Receiver-Transmitter), and
I2C (Inter-Integrated Circuit) functions.

This versatility opens up a wide array of possibilities for interfacing with
different components and facilitating communication with other devices.

:::{tip}
**What? you want more GPIOs?**

Fear not, we have a solution for you. Vaaman board has additional 40-FPGA GPIOs
available to the user.\
These GPIOs are accessible from the FPGA and can be configured to be used inside
your project and applications
:::

<!-- TODO: Add FPGA GPIO user guide and description -->

## GPIO Voltage Level

RK3399 SoC has three multiple GPIO voltage levels. Below table shows the
Expand All @@ -15,19 +39,23 @@ voltage level of vaaman GPIOs.
:widths: 20 40 80
:header-rows: 1

- - GPIO
-
- GPIO
- Voltage Level
- Tolerance

- - ADC_IN0
-
- ADC_IN0
- 1.8V
- ~1.98V

- - GPIO3_C0 (Pin 32)
-
- GPIO3_C0 (Pin 32)
- 3.3V
- ~3.46V

- - Other GPIOs
-
- Other GPIOs
- 3.0V
- ~3.15V

Expand Down Expand Up @@ -71,13 +99,12 @@ or assigned to a GPIO at a time.

:::{note}

- The default function of pins marked in <span class="orange">orange</span> is
specific to this board. For example, pin 3 and 5 cannot be used as GPIOs
- The default function of pins marked in <span class="orange">orange</span> are
specific to this board. For example, Pins 3 and 5 cannot be used as GPIOs
because they are connected to the I2C bus and are already in use.
- All pins, except those for power supply, are directly connected to the
System-on-Chip (SoC).
- **Pin 7** is directly connected to the `MIPI CSI` pin on the board.
- `UART2` is enabled as U-boot and Linux serial console by default.
Instructions to use UART2 as serial console can be found in
[Serial Console](#serial-console), and to disable it, refer to
[Vicharak Config Device tree overlays](#vicharak-config-device-tree-overlays)
Expand Down Expand Up @@ -161,3 +188,9 @@ or assigned to a GPIO at a time.
| <div class="yellow">D5</div> | 29 | | <div class="green">D5</div> | 61 | | <div class="blue">D5</div> | 93 | | <div class="red">D5</div> | 125 | | <div class="orange">D5</div> | 157 |
| <div class="yellow">D6</div> | 30 | | <div class="green">D6</div> | 62 | | <div class="blue">D6</div> | 94 | | <div class="red">D6</div> | 126 | | <div class="orange">D6</div> | 158 |
| <div class="yellow">D7</div> | 31 | | <div class="green">D7</div> | 63 | | <div class="blue">D7</div> | 95 | | <div class="red">D7</div> | 127 | | <div class="orange">D7</div> | 159 |

<!-- TODO: Add FPGA GPIO user guide and description -->

:::{seealso}
[Configure 40-Pin header using vicharak-config utility](#vicharak-config-device-tree-overlays)
:::
3 changes: 3 additions & 0 deletions source/vaaman-linux/linux-usage-guide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ and how to use it.
:caption: User Guides

Vicharak Linux Start Guide <linux-start-guide>
Rockchip MaskROM mode Guide <../../vaaman-maskrom-mode>
Rockchip DevelopTool Guide <rockchip-develop-guide>
How to flash FPGA firmware to SPI Flash <spi-configure>
How to use custom linux kernel <custom-linux-kernel>
U-Boot USB Mass Storage (UMS) mode <u-boot-ums>
Vaaman GPIO Programming Guide <../../vaaman-gpio-description>
100 changes: 100 additions & 0 deletions source/vaaman-linux/linux-usage-guide/u-boot-ums.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
(u-boot-ums-mode)

# U-Boot UMS

**USB Mass Storage (UMS)** mode is a feature that allows a device to function like
an external USB storage device when connected to a computer.

In UMS mode, the device's internal storage, such as eMMC (embedded MultiMediaCard),
is made accessible to the computer, similar to how you would connect a
USB drive or SD card to your computer.

This mode is useful for tasks like transferring files, flashing firmware,
or writing disk images to the device's storage.

Now, here are the steps for booting into UMS mode from either internal storage
or an SD card:

## Booting into UMS Mode from Internal Storage:

- Connect the device to a PC using a USB cable.
- Connect the FTDI to your board and to the Host computer.
- Open the serial monitor application on your Host computer.

:::{note}
More more information on Serial monitor application check out

[Serial Console Programs](#minicom-guide)
:::

- Power on the device.
- Quickly press `Ctrl + c` to enter the U-Boot console.
- From U-Boot console type `ums 1 mmc <dev number>`, where <dev number> is the device number for MMC card.

:::{dropdown} Help ums

```text
=> help ums (U-Boot cmdline)
ums - Use the UMS [USB Mass Storage]
Usage:
ums <USB_controller> [<devtype>] <dev[:part]> e.g. ums 0 mmc 0
devtype defaults to mmc
=>
```

:::

:::{note}
MMC device number is pre-configured from kernel device tree.

- `mmc0` is the device number for SD-Card.
- `mmc1` is the device number for eMMC.
:::

- The device will automatically boot into UMS mode, allowing you to share its internal storage like a USB drive.

:::{dropdown} Success Logs from UMS

```text
=> ums 1 mmc 1
UMS: LUN 0, dev 1, hwpart 0, sector 0x0, count 0x3a3e000
```

:::

- Check kernel logs on your Host computer and you should be able to see new Storage device added.

:::{dropdown} Successful Logs from host kernel

```text
[20104.826747] usb 7-1.4.3: new high-speed USB device number 41 using xhci_hcd
[20104.909195] usb 7-1.4.3: New USB device found, idVendor=2207, idProduct=0010, bcdDevice= 2.23
[20104.909211] usb 7-1.4.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[20104.909214] usb 7-1.4.3: Product: USB download gadget
[20104.909216] usb 7-1.4.3: Manufacturer: Rockchip
[20104.909221] usb 7-1.4.3: SerialNumber: ac4e87197c0c095
[20104.914797] usb-storage 7-1.4.3:1.0: USB Mass Storage device detected
[20104.914916] scsi host7: usb-storage 7-1.4.3:1.0
[20105.940727] scsi 7:0:0:0: Direct-Access Linux UMS disk 0 ffff PQ: 0 ANSI: 2
[20105.941285] sd 7:0:0:0: Attached scsi generic sg2 type 0
[20105.941594] sd 7:0:0:0: [sdc] 61071360 512-byte logical blocks: (31.3 GB/29.1 GiB)
[20105.941748] sd 7:0:0:0: [sdc] Write Protect is off
[20105.941752] sd 7:0:0:0: [sdc] Mode Sense: 0f 00 00 00
[20105.941880] sd 7:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[20105.947385] sdc: sdc1 sdc2 sdc3 sdc4 sdc5 sdc6 sdc7 sdc8
[20105.947726] sd 7:0:0:0: [sdc] Attached SCSI removable disk
```

:::

:::{note}
With UMS mode, you can easily access and manage the device's storage from your
computer, making it convenient for tasks that involve transferring or writing data to the device.
:::

:::{warning}
Do not insert SD-Card when after you previously entered UMS mode from eMMC. U-Boot will crash in such case.

Always reset the board before switching the storage for UMS mode.
:::
Loading

0 comments on commit 1ac64d9

Please sign in to comment.