Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/evbmips/cavium Add the structure of the CVMX boot d...



details:   https://anonhg.NetBSD.org/src/rev/87a2c5b3ff31
branches:  trunk
changeset: 934804:87a2c5b3ff31
user:      simonb <simonb%NetBSD.org@localhost>
date:      Sat Jun 20 02:01:56 2020 +0000

description:
Add the structure of the CVMX boot descriptor.
Extend the U-boot bootinfo descriptor with latest members, add a few comments.
Add a few extra board type IDs.

diffstat:

 sys/arch/evbmips/cavium/octeon_uboot.h |  83 +++++++++++++++++++++++++++++----
 1 files changed, 71 insertions(+), 12 deletions(-)

diffs (119 lines):

diff -r 99cb8d4f7137 -r 87a2c5b3ff31 sys/arch/evbmips/cavium/octeon_uboot.h
--- a/sys/arch/evbmips/cavium/octeon_uboot.h    Sat Jun 20 00:16:50 2020 +0000
+++ b/sys/arch/evbmips/cavium/octeon_uboot.h    Sat Jun 20 02:01:56 2020 +0000
@@ -1,12 +1,49 @@
-/*     $NetBSD: octeon_uboot.h,v 1.2 2020/06/05 07:17:38 simonb Exp $  */
+/*     $NetBSD: octeon_uboot.h,v 1.3 2020/06/20 02:01:56 simonb Exp $  */
 
 #ifndef _EVBMIPS_OCTEON_UBOOT_H_
-#define _EVBMIPS_OCTEON_UBOOT_H_
+#define        _EVBMIPS_OCTEON_UBOOT_H_
+
+#define        OCTEON_BTDESC_ARGV_MAX          64
+#define        OCTEON_BTDESC_SERIAL_LEN        20
+#define        OCTEON_BTDESC_DEP2_LEN          6
+
+#define        OCTEON_BTINFO_PADDR_OFFSET      392
+#define        OCTEON_BTINFO_SERIAL_LEN        20
+#define        OCTEON_BTINFO_MAJOR_VERSION     1
+#define        OCTEON_BTINFO_MINOR_VERSION     2
 
-#define OCTEON_BTINFO_PADDR_OFFSET     392
-#define OCTEON_BTINFO_SERIAL_LEN       20
-#define OCTEON_BTINFO_MAJOR_VERSION    1
-#define OCTEON_BTINFO_MINOR_VERSION    2
+struct octeon_btdesc {
+       uint32_t        obt_desc_ver;
+       uint32_t        obt_desc_size;
+       uint64_t        obt_stack_top;                  /* deprecated */
+       uint64_t        obt_heap_start;
+       uint64_t        obt_heap_end;
+       uint64_t        obt_deprecated17;
+       uint64_t        obt_deprecated16;
+       uint32_t        obt_deprecated18;
+       uint32_t        obt_deprecated15;
+       uint32_t        obt_deprecated14;
+       uint32_t        obt_argc;
+       uint32_t        obt_argv[OCTEON_BTDESC_ARGV_MAX];
+       uint32_t        obt_flags;                      /* deprecated */
+       uint32_t        obt_core_mask;                  /* deprecated */
+       uint32_t        obt_dram_size;                  /* deprecated */
+       uint32_t        obt_phy_mem_desc_addr;          /* deprecated */
+       uint32_t        obt_debugger_flag_addr;
+       uint32_t        obt_eclock;
+       uint32_t        obt_deprecated10;
+       uint32_t        obt_deprecated9;
+       uint16_t        obt_deprecated8;
+       uint8_t         obt_deprecated7;
+       uint8_t         obt_deprecated6;
+       uint16_t        obt_deprecated5;
+       uint8_t         obt_deprecated4;
+       uint8_t         obt_deprecated3;
+       uint8_t         obt_deprecated2[OCTEON_BTDESC_SERIAL_LEN];
+       uint8_t         obt_deprecated1[OCTEON_BTDESC_DEP2_LEN];
+       uint8_t         obt_deprecated0;
+       uint64_t        obt_boot_info_addr;
+};
 
 struct octeon_btinfo {
        uint32_t        obt_major_version;
@@ -20,12 +57,12 @@
        uint32_t        obt_ebase_addr;
        uint32_t        obt_stack_size;
        uint32_t        obt_flags;
-       uint32_t        obt_core_mask;
+       uint32_t        obt_core_mask;                  /* deprecated in v4 */
        uint32_t        obt_dram_size;                  /* in MB */
        uint32_t        obt_phy_mem_desc_addr;
        uint32_t        obt_dbg_flags_base_addr;
-       uint32_t        obt_eclock_hz;
-       uint32_t        obt_dclock_hz;
+       uint32_t        obt_eclock_hz;                  /* CPU clock speed */
+       uint32_t        obt_dclock_hz;                  /* DRAM clock speed */
        uint32_t        obt_reserved0;
 
        uint16_t        obt_board_type;
@@ -42,18 +79,40 @@
        /* version minor 1 or newer */
        uint64_t        obt_cf_common_base_addr;        /* paddr */
        uint64_t        obt_cf_attr_base_addr;          /* paddr */
-       uint64_t        obt_led_display_base_addr;
+       uint64_t        obt_led_display_base_addr;      /* deprecated */
 
        /* version minor 2 or newer */
-       uint32_t        obt_dfa_ref_clock_hz;
+       uint32_t        obt_dfa_ref_clock_hz;           /* DFA ref clock */
        uint32_t        obt_config_flags;
 
+       /* version minor 3 or newer */
+       uint64_t        obt_fdt_addr;                   /* FDT structure */
+
+       /* version minor 4 or newer */
+       uint64_t        obt_ext_core_mask;              /* 64-bit core mask */
 };
 
+extern struct octeon_btdesc octeon_btdesc;
 extern struct octeon_btinfo octeon_btinfo;
 
+#define        OCTEON_SUPPORTED_DESCRIPTOR_VERSION     7
+
 /* obt_board_type */
-#define BOARD_TYPE_UBIQUITI_E100       20002
+#define        BOARD_TYPE_UBIQUITI_E100        20002
+#define        BOARD_TYPE_UBIQUITI_E120                20004
+#define        BOARD_TYPE_UBIQUITI_E200                20003
+#define        BOARD_TYPE_UBIQUITI_E220                20005
+#define        BOARD_TYPE_UBIQUITI_E220                20005
+#define        BOARD_TYPE_UBIQUITI_E1000               20010
+#define        BOARD_TYPE_UBIQUITI_E300                20300
+
+/* obt_config_flags */
+#define        CONFIG_FLAGS_PCI_HOST                   __BIT(0)
+#define        CONFIG_FLAGS_PCI_TARGET                 __BIT(1)
+#define        CONFIG_FLAGS_DEBUG                      __BIT(2)
+#define        CONFIG_FLAGS_NO_MAGIC                   __BIT(3)
+#define        CONFIG_FLAGS_OVERSIZE_TLB_MAPPING       __BIT(4)
+#define        CONFIG_FLAGS_BREAK                      __BIT(5)
 
 
 struct octeon_bootmem_desc {



Home | Main Index | Thread Index | Old Index