Skip to content

Commit

Permalink
Merge pull request #6 from vlsunil/reorg
Browse files Browse the repository at this point in the history
Reorganize individual chapters as separate files
  • Loading branch information
vlsunil authored Sep 5, 2024
2 parents 292cea5 + de05db1 commit e000c4b
Show file tree
Hide file tree
Showing 7 changed files with 338 additions and 371 deletions.
47 changes: 11 additions & 36 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,16 @@
# This Makefile is designed to automate the process of building and packaging
# the Doc Template for RISC-V Extensions.

DOCS := \
rimt-spec.adoc

DATE ?= $(shell date +%Y-%m-%d)
VERSION ?= 1.0.0-rc1
VERSION ?= v1.0.0-rc1
REVMARK ?= Draft
DOCKER_IMG := riscvintl/riscv-docs-base-container-image:latest
ifneq ($(SKIP_DOCKER),true)
DOCKER_CMD := docker run --rm -v ${PWD}:/build -w /build \
${DOCKER_IMG} \
/bin/sh -c
DOCKER_QUOTE := "
endif
DOCKER_RUN := docker run --rm -v ${PWD}:/build -w /build \
riscvintl/riscv-docs-base-container-image:latest

SRC_DIR := src
SRC_DIR := ./src
BUILD_DIR := build
HEADER_SOURCE := ${SRC_DIR}/rimt-spec.adoc

DOCS_PDF := $(DOCS:%.adoc=%.pdf)
DOCS_HTML := $(DOCS:%.adoc=%.html)

XTRA_ADOC_OPTS :=
ASCIIDOCTOR_PDF := asciidoctor-pdf
ASCIIDOCTOR_HTML := asciidoctor
OPTIONS := --trace \
Expand All @@ -43,28 +32,16 @@ OPTIONS := --trace \
-a revdate=${DATE} \
-a pdf-fontsdir=docs-resources/fonts \
-a pdf-theme=docs-resources/themes/riscv-pdf.yml \
$(XTRA_ADOC_OPTS) \
-D build \
-D $(BUILD_DIR) \
--failure-level=ERROR
REQUIRES := --require=asciidoctor-bibtex \
--require=asciidoctor-diagram \
--require=asciidoctor-lists \
--require=asciidoctor-mathematical

.PHONY: all build clean build-container build-no-container build-docs
.PHONY: all build clean build-container build-no-container

all: build

build-docs: $(DOCS_PDF) $(DOCS_HTML)

vpath %.adoc $(SRC_DIR)

%.pdf: %.adoc
$(DOCKER_CMD) $(DOCKER_QUOTE) $(ASCIIDOCTOR_PDF) $(OPTIONS) $(REQUIRES) $< $(DOCKER_QUOTE)

%.html: %.adoc
$(DOCKER_CMD) $(DOCKER_QUOTE) $(ASCIIDOCTOR_HTML) $(OPTIONS) $(REQUIRES) $< $(DOCKER_QUOTE)

build:
@echo "Checking if Docker is available..."
@if command -v docker >/dev/null 2>&1 ; then \
Expand All @@ -77,18 +54,16 @@ build:

build-container:
@echo "Starting build inside Docker container..."
$(MAKE) build-docs
$(DOCKER_RUN) /bin/sh -c "$(ASCIIDOCTOR_PDF) $(OPTIONS) $(REQUIRES) $(HEADER_SOURCE)"
$(DOCKER_RUN) /bin/sh -c "$(ASCIIDOCTOR_HTML) $(OPTIONS) $(REQUIRES) $(HEADER_SOURCE)"
@echo "Build completed successfully inside Docker container."

build-no-container:
@echo "Starting build..."
$(MAKE) SKIP_DOCKER=true build-docs
$(ASCIIDOCTOR_PDF) $(OPTIONS) $(REQUIRES) $(HEADER_SOURCE)
$(ASCIIDOCTOR_HTML) $(OPTIONS) $(REQUIRES) $(HEADER_SOURCE)
@echo "Build completed successfully."

# Update docker image to latest
docker-pull-latest:
docker pull ${DOCKER_IMG}

clean:
@echo "Cleaning up generated files..."
rm -rf $(BUILD_DIR)
Expand Down
8 changes: 6 additions & 2 deletions src/bibliography.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
[bibliography]
== Bibliography
== References

bibliography::[]
* link:https://github.com/riscv-non-isa/riscv-iommu/releases/download/v1.0.0/riscv-iommu.pdf[RISC-V IOMMU Specification], v1.0.0
* link:https://uefi.org/specs/ACPI/6.5/[ACPI Specification], Version: v6.5

// REVISIT
//bibliography::[]
6 changes: 6 additions & 0 deletions src/intro.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
== Introduction

The RISC-V IO Mapping Table (RIMT) provides information about the RISC-V IOMMU and the relationship
between the IO topology and the IOMMU in ACPI based RISC-V platforms. The RIMT identifies which
components are behind IOMMU and how they are connected together. RISC-V IOMMU can be implemented as
either a PCI device or a platform device.
19 changes: 19 additions & 0 deletions src/mapping-example.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[[Mapping-Examples]]
== ID Mapping Examples

.PCIe device ID mapping example
[[pci_rc_id_mapping_2]]
[cols="2,2,2,4,1", width=95%, options="header"]
|===
| *Source ID Base* | *Number of IDs* | *Destination Device ID Base* | *Destination IOMMU Offset* | *Flags*
| 0x0000 | 0x10 | 0x0 | IOMMU0_OFFSET_IN_RIMT | 0
| 0x0100 | 0x10 | 0x10 | IOMMU0_OFFSET_IN_RIMT | 0
|===

.Platform device ID mapping example
[[platform_id_mapping]]
[cols="2,2,2,4,1", width=95%, options="header"]
|===
| *Source ID Base* | *Number of IDs* | *Destination Device ID Base* | *Destination IOMMU Offset* | *Flags*
| 0x0000 | 0x1 | 0x20 | IOMMU0_OFFSET_IN_RIMT | 0
|===
Loading

0 comments on commit e000c4b

Please sign in to comment.