global_data.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. * Copyright (c) 2012 The Chromium OS Authors.
  3. * (C) Copyright 2002-2010
  4. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  5. *
  6. * See file CREDITS for list of people who contributed to this
  7. * project.
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License as
  11. * published by the Free Software Foundation; either version 2 of
  12. * the License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  22. * MA 02111-1307 USA
  23. */
  24. #ifndef __ASM_GENERIC_GBL_DATA_H
  25. #define __ASM_GENERIC_GBL_DATA_H
  26. /*
  27. * The following data structure is placed in some memory which is
  28. * available very early after boot (like DPRAM on MPC8xx/MPC82xx, or
  29. * some locked parts of the data cache) to allow for a minimum set of
  30. * global variables during system initialization (until we have set
  31. * up the memory controller so that we can use RAM).
  32. *
  33. * Keep it *SMALL* and remember to set GENERATED_GBL_DATA_SIZE > sizeof(gd_t)
  34. *
  35. * Each architecture has its own private fields. For now all are private
  36. */
  37. #ifndef __ASSEMBLY__
  38. typedef struct global_data {
  39. bd_t *bd;
  40. unsigned long flags;
  41. unsigned int baudrate;
  42. unsigned long cpu_clk; /* CPU clock in Hz! */
  43. unsigned long bus_clk;
  44. /* We cannot bracket this with CONFIG_PCI due to mpc5xxx */
  45. unsigned long pci_clk;
  46. unsigned long mem_clk;
  47. #if defined(CONFIG_LCD) || defined(CONFIG_VIDEO)
  48. unsigned long fb_base; /* Base address of framebuffer mem */
  49. #endif
  50. #if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
  51. unsigned long post_log_word; /* Record POST activities */
  52. unsigned long post_log_res; /* success of POST test */
  53. unsigned long post_init_f_time; /* When post_init_f started */
  54. #endif
  55. #ifdef CONFIG_BOARD_TYPES
  56. unsigned long board_type;
  57. #endif
  58. unsigned long have_console; /* serial_init() was called */
  59. #ifdef CONFIG_PRE_CONSOLE_BUFFER
  60. unsigned long precon_buf_idx; /* Pre-Console buffer index */
  61. #endif
  62. #ifdef CONFIG_MODEM_SUPPORT
  63. unsigned long do_mdm_init;
  64. unsigned long be_quiet;
  65. #endif
  66. unsigned long env_addr; /* Address of Environment struct */
  67. unsigned long env_valid; /* Checksum of Environment valid? */
  68. unsigned long ram_top; /* Top address of RAM used by U-Boot */
  69. unsigned long relocaddr; /* Start address of U-Boot in RAM */
  70. phys_size_t ram_size; /* RAM size */
  71. unsigned long mon_len; /* monitor len */
  72. unsigned long irq_sp; /* irq stack pointer */
  73. unsigned long start_addr_sp; /* start_addr_stackpointer */
  74. unsigned long reloc_off;
  75. struct global_data *new_gd; /* relocated global data */
  76. const void *fdt_blob; /* Our device tree, NULL if none */
  77. void *new_fdt; /* Relocated FDT */
  78. unsigned long fdt_size; /* Space reserved for relocated FDT */
  79. void **jt; /* jump table */
  80. char env_buf[32]; /* buffer for getenv() before reloc. */
  81. struct arch_global_data arch; /* architecture-specific data */
  82. } gd_t;
  83. #endif
  84. /*
  85. * Global Data Flags
  86. */
  87. #define GD_FLG_RELOC 0x00001 /* Code was relocated to RAM */
  88. #define GD_FLG_DEVINIT 0x00002 /* Devices have been initialized */
  89. #define GD_FLG_SILENT 0x00004 /* Silent mode */
  90. #define GD_FLG_POSTFAIL 0x00008 /* Critical POST test failed */
  91. #define GD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted */
  92. #define GD_FLG_LOGINIT 0x00020 /* Log Buffer has been initialized */
  93. #define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in & out) */
  94. #define GD_FLG_ENV_READY 0x00080 /* Env. imported into hash table */
  95. #endif /* __ASM_GENERIC_GBL_DATA_H */