Docs: Enable RTD on tf-m-extras

Added files required for the tf-m-extras documentation to be displayed on Read the Docs.

Change-Id: I813589f566b58834dc75142b7a92349589d8da87
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
diff --git a/.readthedocs.yaml b/.readthedocs.yaml
new file mode 100644
index 0000000..baf1fd1
--- /dev/null
+++ b/.readthedocs.yaml
@@ -0,0 +1,34 @@
+#-------------------------------------------------------------------------------
+#
+# Copyright (c) 2023, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+
+# Read the Docs configuration file
+# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
+
+# Version of the configuration file, v1 is no longer supported
+version: 2
+
+# Configuration for the documentation build
+build:
+  os: ubuntu-22.04
+  tools:
+    python: "3.11"
+  apt_packages:
+    - plantuml
+
+# Build documentation in the "docs/" directory with Sphinx
+sphinx:
+  configuration: docs/conf.py
+
+# The documentation will also be built in a pdf format
+formats:
+   - pdf
+
+# Configuration of the Python environment
+python:
+   install:
+   - requirements: docs/requirements.txt
diff --git a/docs/_static/css/tf_custom.css b/docs/_static/css/tf_custom.css
new file mode 100644
index 0000000..5085397
--- /dev/null
+++ b/docs/_static/css/tf_custom.css
@@ -0,0 +1,77 @@
+/*-----------------------------------------------------------------------------
+# Copyright (c) 2023, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#----------------------------------------------------------------------------*/
+
+/* Limit page width */
+@media only screen and (min-width: 780px) {
+    .wy-nav-content {
+        max-width: 1100px;
+    }
+}
+
+/* Flexbox Tile Grid Settings  */
+.grid {
+    list-style-type: none !important;
+    display: -webkit-box;
+    display: -ms-flexbox;
+    display: flex;
+    -ms-flex-wrap: wrap;
+        flex-wrap: wrap;
+    -webkit-box-pack: center;
+        -ms-flex-pack: center;
+            justify-content: center;
+    margin: 1rem auto;
+    max-width: calc((250px + 2rem) * 4);
+}
+
+.grid-item {
+    list-style-type: none !important;
+    -webkit-box-flex: 0;
+        -ms-flex: 0 0 auto;
+            flex: 0 0 auto;
+    width: 200px;
+    text-align: center;
+    margin: 1rem;
+}
+
+.grid-item a {
+    display: block;
+    width: 190px;
+    height: 190px;
+    padding: 12px;
+    display: -webkit-box;
+    display: -ms-flexbox;
+    display: flex;
+    -webkit-box-orient: vertical;
+    -webkit-box-direction: normal;
+        -ms-flex-direction: column;
+            flex-direction: column;
+    -webkit-box-pack: center;
+        -ms-flex-pack: center;
+            justify-content: center;
+    -webkit-box-align: center;
+        -ms-flex-align: center;
+            align-items: center;
+    border: 1px solid #c6cbce;
+    background-color: #2980B9;
+    color: white;
+}
+
+.grid-item h2 {
+    font-size: 1rem;
+    margin-bottom: 0.5rem;
+}
+
+.grid-item img {
+    max-width: 75%;
+    margin-bottom: 0.5rem;
+}
+
+
+.grid-item a:hover {
+    background-color: #32cd32;
+    color: white;
+}
diff --git a/docs/_static/images/favicon.ico b/docs/_static/images/favicon.ico
new file mode 100644
index 0000000..915353d
--- /dev/null
+++ b/docs/_static/images/favicon.ico
Binary files differ
diff --git a/docs/_static/images/tf_logo_white.png b/docs/_static/images/tf_logo_white.png
new file mode 100644
index 0000000..e7bff71
--- /dev/null
+++ b/docs/_static/images/tf_logo_white.png
Binary files differ
diff --git a/docs/conf.py b/docs/conf.py
new file mode 100644
index 0000000..da80cd3
--- /dev/null
+++ b/docs/conf.py
@@ -0,0 +1,157 @@
+# -*- coding: utf-8 -*-
+#-------------------------------------------------------------------------------
+# Copyright (c) 2019-2022, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+
+# Configuration file for the Sphinx documentation builder.
+#
+# This file does only contain a selection of the most common options. For a
+# full list see the documentation:
+# http://www.sphinx-doc.org/en/master/config
+
+import os
+import sys
+import re
+from subprocess import check_output
+
+# -- Project information -----------------------------------------------------
+
+project = 'Trusted Firmware-M Extras'
+copyright = '2023, ARM CE-OSS'
+author = 'ARM CE-OSS'
+title = 'User Guide'
+
+# -- Extract current version -------------------------------------------------
+
+try:
+    vrex = re.compile(r'TF-M(?P<GIT_VERSION>v.+?)'
+                      r'(-[0-9]+-g)?(?P<GIT_SHA>[a-f0-9]{7,})?$')
+
+    version = check_output("git describe --tags --always",
+                            shell = True, encoding = 'UTF-8')
+
+    _v = vrex.match(version)
+    release = _v.group('GIT_VERSION')
+    if _v.group('GIT_SHA'):
+        version = release + "+" + _v.group('GIT_SHA')[:7]
+
+except:
+    version = release = 'Unknown'
+
+# -- General configuration ---------------------------------------------------
+
+extensions = [
+    'sphinx.ext.imgmath',
+    'm2r2', #Support markdown files. Needed for external code.
+    'sphinx.ext.autosectionlabel', #Make sphinx generate a label for each section
+    'sphinxcontrib.plantuml', #Add support for PlantUML drawings
+    'sphinxcontrib.rsvgconverter', #Add support for SVG to PDF
+    'sphinx_tabs.tabs', #Enable tab extension in Sphinx
+]
+
+# Make auto section labels generated be prefixed with file name.
+autosectionlabel_prefix_document=True
+# Add auto section label for level 2 headers only.
+autosectionlabel_maxdepth=2
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix(es) of source filenames.
+# You can specify multiple suffix as a list of string:
+#
+source_suffix = ['.rst', '.md']
+
+# The master toctree document.
+master_doc = 'index'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#
+# This is also used if you do content translation via gettext catalogs.
+# Usually you set "language" from the command line for these cases.
+language = None
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+# This pattern also affects html_static_path and html_extra_path .
+exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'readme.rst',
+                    'platform/cypress/psoc64/security/keys/readme.rst',
+                    'lib/ext/**']
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# -- Options for HTML output -------------------------------------------------
+
+html_theme = 'sphinx_rtd_theme'
+
+html_theme_options = {
+    'collapse_navigation' : False,
+    'prev_next_buttons_location' : None,   # Hide Prev and Next buttons
+    'display_version': True,    # Show version under logo
+    'sticky_navigation': True,
+    'navigation_depth': 3,
+}
+
+# Remove the "View page source" link from the top of docs pages
+html_show_sourcelink = False
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to configuration directory. They are copied after the builtin static
+# files, so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# Set the documentation logo relative to configuration directory
+html_logo = '_static/images/tf_logo_white.png'
+
+# Set the documentation favicon
+html_favicon = '_static/images/favicon.ico'
+
+#Disable adding conf.py copyright notice to HTML output
+html_show_copyright = False
+
+# Disable showing Sphinx footer message:
+# "Built with Sphinx using a theme provided by Read the Docs. "
+html_show_sphinx = False
+
+#Add custom css for HTML. Used to allow full page width rendering
+def setup(app):
+    app.add_css_file('css/tfm_custom.css')
+
+# -- Options for HTMLHelp output ---------------------------------------------
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'TF-M doc'
+
+# Enable figures and tables auto numbering
+numfig = True
+numfig_secnum_depth = 0
+numfig_format = {
+    'figure': 'Figure %s:',
+    'table': 'Table %s:',
+    'code-block': 'Listing %s:',
+    'section': '%s'
+}
+
+# -- Options for LaTeX output ------------------------------------------------
+
+latex_elements = {
+    # 'papersize': 'letterpaper',
+    # 'pointsize': '10pt',
+    # 'preamble': '',
+    # 'figure_align': 'htbp',
+}
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title,
+#  author, documentclass [howto, manual, or own class]).
+latex_documents = [
+    (master_doc, 'TF-M.tex', title,
+     author, 'manual'),
+]
+
+language = 'en'
diff --git a/examples/corstone310_fvp_dma/clcd_example/readme.rst b/docs/examples/corstone310_fvp_dma/clcd_example.rst
similarity index 86%
rename from examples/corstone310_fvp_dma/clcd_example/readme.rst
rename to docs/examples/corstone310_fvp_dma/clcd_example.rst
index 9f40836..30b9bd5 100644
--- a/examples/corstone310_fvp_dma/clcd_example/readme.rst
+++ b/docs/examples/corstone310_fvp_dma/clcd_example.rst
@@ -8,7 +8,7 @@
 a simple 2D example.
 
 For detailed description of how privilege separation can be achieved with
-DMA-350, checkout :doc:`DMA-350 privilege separation <../../../partitions/dma350_unpriv_partition/dma350_privilege_separation.rst>`_
+DMA-350, checkout :doc:`DMA-350 privilege separation </partitions/dma350_unpriv_partition/dma350_privilege_separation>`
 
 ***********
 Build steps
diff --git a/examples/corstone310_fvp_dma/triggering_example/readme.rst b/docs/examples/corstone310_fvp_dma/triggering_example.rst
old mode 100755
new mode 100644
similarity index 100%
rename from examples/corstone310_fvp_dma/triggering_example/readme.rst
rename to docs/examples/corstone310_fvp_dma/triggering_example.rst
diff --git a/examples/example_partition/README.rst b/docs/examples/example_partition.rst
similarity index 90%
rename from examples/example_partition/README.rst
rename to docs/examples/example_partition.rst
index de9fcd7..ac3f4c3 100644
--- a/examples/example_partition/README.rst
+++ b/docs/examples/example_partition.rst
@@ -134,13 +134,13 @@
   https://documentation-service.arm.com/static/600067c09b9c2d1bb22cd1c5?token=
 
 .. _Adding Secure Partition:
-  https://tf-m-user-guide.trustedfirmware.org/integration_guide/services/tfm_secure_partition_addition.html
+  https://trustedfirmware-m.readthedocs.io/en/latest/integration_guide/services/tfm_secure_partition_addition.html
 
 .. _TF-M Manifest List:
-  https://tf-m-user-guide.trustedfirmware.org/integration_guide/services/tfm_manifest_tool_user_guide.html#manifest-list
+  https://trustedfirmware-m.readthedocs.io/en/latest/integration_guide/services/tfm_manifest_tool_user_guide.html#manifest-list
 
 .. _Out-of-tree Secure Partition build:
-  https://tf-m-user-guide.trustedfirmware.org/integration_guide/services/tfm_secure_partition_addition.html#out-of-tree-secure-partition-build
+  https://trustedfirmware-m.readthedocs.io/en/latest/integration_guide/services/tfm_secure_partition_addition.html#out-of-tree-secure-partition-build
 
 .. _Adding TF-M Regression Test Suite:
   https://git.trustedfirmware.org/TF-M/tf-m-tests.git/tree/docs/tfm_test_suites_addition.rst
diff --git a/examples/examples_readme.rst b/docs/examples/examples.rst
old mode 100755
new mode 100644
similarity index 74%
rename from examples/examples_readme.rst
rename to docs/examples/examples.rst
index feddd68..2df2ee1
--- a/examples/examples_readme.rst
+++ b/docs/examples/examples.rst
@@ -1,55 +1,62 @@
-########
-Examples
-########
-
 The list and simple introduction of the examples in this folder.
 
+###################
 corstone310_fvp_dma
-===================
+###################
 
+***********
 Description
------------
-
+***********
 * DMA-350 Secure tests
 * Non-secure DMA-350 examples for the Corstone-310 FVP platform
 
+***********
 Maintainers
------------
+***********
 - Bence Balogh `<bence.balogh@arm.com> <bence.balogh@arm.com>`_
 - Mark Horvath `<mark.horvath@arm.com> <mark.horvath@arm.com>`_
 
+#########################
 extra_test_suites_example
-=========================
+#########################
 
+***********
 Description
------------
+***********
 An example and template of out-of-tree build of extra regression test suites.
 
+***********
 Maintainers
------------
+***********
 Jianliang Shen `<jianliang.shen@arm.com> <jianliang.shen@arm.com>`_
 
+#################
 example_partition
-=================
+#################
 
+***********
 Description
------------
+***********
 A simple secure partition implementation.
 
+***********
 Maintainers
------------
+***********
 Jianliang Shen `<jianliang.shen@arm.com> <jianliang.shen@arm.com>`_
 
+#########
 vad_an552
-=========
+#########
 
+***********
 Description
------------
+***********
 Example application for the AN552 FPGA image, details can be found
 `here </examples/vad_an552/readme.rst>`.
 
+***********
 Maintainers
------------
+***********
 - Gabor Toth `<gabor.toth@arm.com> <gabor.toth@arm.com>`_
 - Mark Horvath `<mark.horvath@arm.com> <mark.horvath@arm.com>`_
 
diff --git a/docs/examples/index.rst b/docs/examples/index.rst
new file mode 100644
index 0000000..7f447ef
--- /dev/null
+++ b/docs/examples/index.rst
@@ -0,0 +1,14 @@
+Examples
+========
+
+.. toctree::
+  :maxdepth: 1
+  :titlesonly:
+  :hidden:
+
+  Non-Secure DMA350 Example for FreeRTOS <corstone310_fvp_dma/clcd_example>
+  DMA350 Triggering Interface Example <corstone310_fvp_dma/triggering_example>
+  TF-M Example Partition <example_partition>
+  Threat Models <vad_an552/index>
+
+.. include:: examples.rst
diff --git a/examples/vad_an552/doc/index.rst b/docs/examples/vad_an552/index.rst
similarity index 100%
rename from examples/vad_an552/doc/index.rst
rename to docs/examples/vad_an552/index.rst
diff --git a/examples/vad_an552/doc/threat_model.rst b/docs/examples/vad_an552/threat_model.rst
similarity index 100%
rename from examples/vad_an552/doc/threat_model.rst
rename to docs/examples/vad_an552/threat_model.rst
diff --git a/examples/vad_an552/readme.rst b/docs/examples/vad_an552/vad_an552.rst
similarity index 94%
rename from examples/vad_an552/readme.rst
rename to docs/examples/vad_an552/vad_an552.rst
index 6dc6e83..b1071bc 100644
--- a/examples/vad_an552/readme.rst
+++ b/docs/examples/vad_an552/vad_an552.rst
@@ -55,9 +55,9 @@
 but this can be skipped if ``-DVAD_AN552_NO_CONNECTIVITY=ON`` is added for
 cmake.
 
-###################################
+-----------------------------------
 Create an IoT thing for your device
-###################################
+-----------------------------------
 
 #. Login to your account and browse to the `AWS IoT console <https://console.aws.amazon.com/iotv2/>`__.
 #. In the left navigation pane, choose ``All devices``, and then choose ``Things``.
@@ -75,9 +75,9 @@
    the certificate.
 #. Activate your certificate if it is not active by default.
 
-###############
+---------------
 Create a policy
-###############
+---------------
 
 For the sake of simplicity in this example a very permissive Policy is created,
 for production usage a more restrictive one is recommended.
@@ -108,9 +108,9 @@
    ]
    }
 
-#######################################
+---------------------------------------
 Attach the created policy to your thing
-#######################################
+---------------------------------------
 
 #. In the left navigation pane of the AWS IoT console, choose ``Secure``, and
    then choose ``Certificates``. You should see the certificate that you have
@@ -120,9 +120,9 @@
 #. In the ``Attach policies to certificate(s)`` window choose the created
    policy and click ``Attach``.
 
-####################################
+------------------------------------
 Update source with thing credentials
-####################################
+------------------------------------
 
 Edit `examples/vad_an552/ns_side/amazon-freertos/aws_clientcredential.h` file and
 set the value of the following macros:
@@ -154,9 +154,9 @@
 * ``keyCLIENT_PRIVATE_KEY_PEM``, content of ``<your-thing-certificate-unique-string>-private.pem.key``.
 * ``keyCLIENT_PUBLIC_KEY_PEM``, content of ``<your-thing-certificate-unique-string>-public.pem.key``.
 
-##################
+------------------
 Running TF-M build
-##################
+------------------
 
 For building TF-M's build system is used with the following mandatory CMAKE
 flags::
@@ -183,14 +183,14 @@
 times with release GCC build.
 
 You can check TF-M's build instructions
-`here <https://tf-m-user-guide.trustedfirmware.org/docs/technical_references/instructions/tfm_build_instruction.html>`__.
+`here <https://trustedfirmware-m.readthedocs.io/en/latest/building/tfm_build_instruction.html>`__.
 
 -----------------------
 Running the application
 -----------------------
 
 It is covered by the generic TF-M run instructions for AN552
-`here <https://tf-m-user-guide.trustedfirmware.org/platform/ext/target/arm/mps3/an552/README.html>`__.
+`here <https://trustedfirmware-m.readthedocs.io/en/latest/platform/arm/mps3/corstone300/README.html?highlight=an552#build-instructions-with-platform-name-arm-mps3-corstone300-an547>`__.
 
 ---------------------------
 Testing the voice algorithm
diff --git a/readme.rst b/docs/index.rst
old mode 100755
new mode 100644
similarity index 83%
rename from readme.rst
rename to docs/index.rst
index e29847c..89e5a81
--- a/readme.rst
+++ b/docs/index.rst
@@ -1,6 +1,8 @@
-#########################
+################################
 Trusted Firmware-M Extras
-#########################
+################################
+
+.. raw:: html
 
 The Trusted Firmware-M (TF-M) Extras repository is the extension of the TF-M
 main repository to host the examples, demonstrations, third-party modules,
@@ -28,7 +30,7 @@
 Contribute to this repository
 *****************************
 
-Refer to `contributing process <https://tf-m-user-guide.trustedfirmware.org/docs/contributing/contributing_process.html>`_
+Refer to `contributing process <https://trustedfirmware-m.readthedocs.io/en/latest/contributing/contributing_process.html>`_
 for the TF-M general contribution guideline.
 
 Please contact `TF-M development mailing list <https://lists.trustedfirmware.org/mailman3/lists/tf-m.lists.trustedfirmware.org>`_
@@ -78,6 +80,21 @@
         Optional. Specify the TF-M version/commit ID if it is not integrated or
         test with latest TF-M release.
 
------------------------
+.. toctree::
+  :caption: Overview
+  :maxdepth: 1
+  :hidden:
+
+  Partitions <partitions/index>
+  Examples <examples/index>
+
+.. toctree::
+  :caption: Links
+  :maxdepth: 1
+  :hidden:
+
+  Trusted Firmware-M <https://trustedfirmware-m.readthedocs.io/en/latest/>
+
+--------------
 
 *Copyright (c) 2021-2022, Arm Limited. All rights reserved.*
diff --git a/partitions/delegated_attestation/delegated_attest_flow.svg b/docs/partitions/delegated_attestation/delegated_attest_flow.svg
similarity index 100%
rename from partitions/delegated_attestation/delegated_attest_flow.svg
rename to docs/partitions/delegated_attestation/delegated_attest_flow.svg
diff --git a/partitions/delegated_attestation/delegated_attest_integration_guide.rst b/docs/partitions/delegated_attestation/delegated_attest_integration_guide.rst
similarity index 100%
rename from partitions/delegated_attestation/delegated_attest_integration_guide.rst
rename to docs/partitions/delegated_attestation/delegated_attest_integration_guide.rst
diff --git a/partitions/dice_protection_environment/dice_protection_environment.rst b/docs/partitions/dice_protection_environment.rst
similarity index 100%
rename from partitions/dice_protection_environment/dice_protection_environment.rst
rename to docs/partitions/dice_protection_environment.rst
diff --git a/partitions/dma350_unpriv_partition/DMA350_privilege_separation_flow.svg b/docs/partitions/dma350_unpriv_partition/DMA350_privilege_separation_flow.svg
similarity index 100%
rename from partitions/dma350_unpriv_partition/DMA350_privilege_separation_flow.svg
rename to docs/partitions/dma350_unpriv_partition/DMA350_privilege_separation_flow.svg
diff --git a/partitions/dma350_unpriv_partition/dma350_privilege_separation.rst b/docs/partitions/dma350_unpriv_partition/dma350_privillege_separation.rst
similarity index 100%
rename from partitions/dma350_unpriv_partition/dma350_privilege_separation.rst
rename to docs/partitions/dma350_unpriv_partition/dma350_privillege_separation.rst
diff --git a/partitions/dma350_unpriv_partition/tfm_dma350_unpriv_partition_readme.rst b/docs/partitions/dma350_unpriv_partition/dma350_unpriv_partition.rst
similarity index 100%
rename from partitions/dma350_unpriv_partition/tfm_dma350_unpriv_partition_readme.rst
rename to docs/partitions/dma350_unpriv_partition/dma350_unpriv_partition.rst
diff --git a/partitions/external_trusted_secure_storage/docs/ETSS_partition_application_note.pdf b/docs/partitions/external_trusted_secure_storage/ETSS_partition_application_note.pdf
similarity index 100%
rename from partitions/external_trusted_secure_storage/docs/ETSS_partition_application_note.pdf
rename to docs/partitions/external_trusted_secure_storage/ETSS_partition_application_note.pdf
Binary files differ
diff --git a/partitions/external_trusted_secure_storage/docs/External_Trusted_Secure_Storage_Proposal.pdf b/docs/partitions/external_trusted_secure_storage/External_Trusted_Secure_Storage_Proposal.pdf
similarity index 100%
rename from partitions/external_trusted_secure_storage/docs/External_Trusted_Secure_Storage_Proposal.pdf
rename to docs/partitions/external_trusted_secure_storage/External_Trusted_Secure_Storage_Proposal.pdf
Binary files differ
diff --git a/partitions/external_trusted_secure_storage/docs/etss_readme.rst b/docs/partitions/external_trusted_secure_storage/external_trusted_secure_storage.rst
old mode 100755
new mode 100644
similarity index 98%
rename from partitions/external_trusted_secure_storage/docs/etss_readme.rst
rename to docs/partitions/external_trusted_secure_storage/external_trusted_secure_storage.rst
index e46ae70..716604d
--- a/partitions/external_trusted_secure_storage/docs/etss_readme.rst
+++ b/docs/partitions/external_trusted_secure_storage/external_trusted_secure_storage.rst
@@ -1,5 +1,5 @@
 ###############################
-external trusted secure storage
+External Trusted Secure Storage
 ###############################
 
 ********
@@ -12,6 +12,7 @@
 ************
 Introduction
 ************
+
 A secure storage solution is very important when storage is external to MCU.
 Macronix and other Flash memory suppliers have developed several security memory
 products, and three major products are RPMC, Authentication Flash, and a more
@@ -55,6 +56,7 @@
 **************
 Design concept
 **************
+
 Overview
 ========
 An ETSS partition is developed as a PSA RoT secure partition to provide external
@@ -273,7 +275,7 @@
  - Add access rights management features to secure Flash filesystem.
 
 References
-----------
+==========
 
 .. [1] `ArmorFlash product instruction <https://www.mxic.com.tw/en-us/products/Pages/ArmorFlash.aspx>`_
 
@@ -283,4 +285,3 @@
 
 *Copyright (c) 2021-2022, Macronix International Co. LTD. All rights reserved.*
 *SPDX-License-Identifier: BSD-3-Clause*
-
diff --git a/partitions/external_trusted_secure_storage/docs/media/block_diagram_of_etss_components.png b/docs/partitions/external_trusted_secure_storage/media/block_diagram_of_etss_components.png
similarity index 100%
rename from partitions/external_trusted_secure_storage/docs/media/block_diagram_of_etss_components.png
rename to docs/partitions/external_trusted_secure_storage/media/block_diagram_of_etss_components.png
Binary files differ
diff --git a/partitions/external_trusted_secure_storage/docs/media/etss_with_secure_flash_framework.png b/docs/partitions/external_trusted_secure_storage/media/etss_with_secure_flash_framework.png
similarity index 100%
rename from partitions/external_trusted_secure_storage/docs/media/etss_with_secure_flash_framework.png
rename to docs/partitions/external_trusted_secure_storage/media/etss_with_secure_flash_framework.png
Binary files differ
diff --git a/partitions/external_trusted_secure_storage/docs/media/secure_communication_channel.png b/docs/partitions/external_trusted_secure_storage/media/secure_communication_channel.png
similarity index 100%
rename from partitions/external_trusted_secure_storage/docs/media/secure_communication_channel.png
rename to docs/partitions/external_trusted_secure_storage/media/secure_communication_channel.png
Binary files differ
diff --git a/docs/partitions/index.rst b/docs/partitions/index.rst
new file mode 100644
index 0000000..048cbb2
--- /dev/null
+++ b/docs/partitions/index.rst
@@ -0,0 +1,16 @@
+Partitions
+==========
+
+.. toctree::
+  :maxdepth: 1
+  :titlesonly:
+  :hidden:
+
+  Delegated Attestation Service Integration Guide <delegated_attestation/delegated_attest_integration_guide>
+  DICE Protection Environmnet <dice_protection_environment>
+  DMA-350 Privilege Separation <dma350_unpriv_partition/dma350_privilege_separation>
+  Corstone310 Build Steps <dma350_unpriv_partition/dma350_unpriv_partition>
+  External Trusted Secure Storage <external_trusted_secure_storage/external_trusted_secure_storage>
+  Measured Boot Service Integration Guide <measured_boot_integration_guide>
+
+.. include:: partitions.rst
diff --git a/partitions/measured_boot/measured_boot_integration_guide.rst b/docs/partitions/measured_boot_integration_guide.rst
similarity index 100%
rename from partitions/measured_boot/measured_boot_integration_guide.rst
rename to docs/partitions/measured_boot_integration_guide.rst
diff --git a/partitions/partitions_readme.rst b/docs/partitions/partitions.rst
old mode 100755
new mode 100644
similarity index 77%
rename from partitions/partitions_readme.rst
rename to docs/partitions/partitions.rst
index a3b3092..1bd240d
--- a/partitions/partitions_readme.rst
+++ b/docs/partitions/partitions.rst
@@ -1,77 +1,89 @@
-##########
-Partitions
-##########
-
 The list and simple introduction of 3rd-party Secure Partitions in this folder.
 
+######################
 dma350_upriv_partition
-======================
+######################
 
+***********
 Description
------------
+***********
 DMA-350 Example unprivileged partition
 
+***********
 Maintainers
------------
+***********
 - Bence Balogh `<bence.balogh@arm.com> <bence.balogh@arm.com>`_
 - Mark Horvath `<mark.horvath@arm.com> <mark.horvath@arm.com>`_
 
+#############
 measured_boot
-=============
+#############
 
+***********
 Description
------------
+***********
 Measured boot partition for extending and retrieving software component
 measurements for RSS platform.
 
+***********
 Maintainers
------------
+***********
 - Maulik Patel `<Maulik.Patel@arm.com>`_
 - David Vincze `<David.Vincze@arm.com>`_
 
+###############################
 external_trusted_secure_storage
-===============================
+###############################
 
+***********
 Description
------------
+***********
 ETSS partition for providing external trusted secure storage services
 to protect assets stored in external secure Flash from a variety of
 security attacks.
 
+***********
 Maintainers
------------
+***********
 - Poppy Wu `<poppywu@mxic.com.cn>`_
 
+************
 TF-M version
-------------
+************
 TF-M V1.4.0
 
+#####################
 delegated_attestation
-=====================
+#####################
 
+***********
 Description
------------
+***********
 The aim of the partition is to support platforms/systems using a delegated
 attestation model by providing services for delegated key generation and
 platform attestation token creation.
 
+***********
 Maintainers
------------
+***********
 - David Vincze `<David.Vincze@arm.com>`_
 
+############
 vad_an552_sp
-============
+############
 
+***********
 Description
------------
+***********
 Secure partition for the AN552 FPGA image. It implements voice activity
 detection on the microphone input of the MPS3 board, and if voice detected
 (which can be any noise) a short sample (~100 ms) is recorded. Then it can be
 calculated that which frequency component has the highest energy in the
 recorded sample.
 
+***********
 Maintainers
------------
+***********
 - Gabor Toth `<gabor.toth@arm.com> <gabor.toth@arm.com>`_
 - Mark Horvath `<mark.horvath@arm.com> <mark.horvath@arm.com>`_
 
diff --git a/docs/requirements.txt b/docs/requirements.txt
new file mode 100644
index 0000000..4678dc5
--- /dev/null
+++ b/docs/requirements.txt
@@ -0,0 +1,10 @@
+graphviz
+Jinja2>=3.0.2
+latex
+Sphinx==4.2.0
+m2r2
+sphinx-rtd-theme>=1.0.0
+sphinxcontrib-plantuml==0.22
+sphinxcontrib-svg2pdfconverter==1.1.1
+sphinx-tabs==3.2.0
+docutils==0.16