החל מ-27 במרץ 2025, מומלץ להשתמש ב-android-latest-release
במקום ב-aosp-main
כדי ליצור תרומות ל-AOSP. מידע נוסף זמין במאמר שינויים ב-AOSP.
שימוש בכמה נכסי DT
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
ספקים רבים של SoC ו-ODM תומכים בשימוש במספר עצי מכשירים (DT) במכשיר, ומאפשרים לתמוך בתמונה אחת במספר מק"טים או תצורות. במקרים כאלה, bootloader מזהה את החומרה ומטעין את ה-DT התואם בזמן הריצה:

איור 1. שכבות-על מרובות של עץ המכשיר (DTO) בתוכנת האתחול.
הערה: אין חובה להשתמש בכמה טבלאות DT.
הגדרה
כדי להוסיף תמיכה בכמה DTs למודל ה-DTO, צריך להגדיר רשימה של DTs ראשיים ורשימת DTs נוספת של שכבות-על.

איור 2. הטמעת DTO בסביבת זמן ריצה למספר DTs.
מנהל האתחול אמור להיות מסוגל:
- קוראים את מזהה ה-SoC ובוחרים את קובץ ה-DT הראשי התואם.
- קוראים את מזהה הלוח ובוחרים את קבוצת ה-DT של שכבת-העל בהתאם.
צריך לבחור רק DT ראשי אחד לשימוש בזמן הריצה. אפשר לבחור כמה תבניות DT של שכבות-על, אבל הן חייבות להיות תואמות לתבנית ה-DT הראשית שנבחרה. שימוש בכמה שכבות-על יכול לעזור למנוע אחסון של שכבת-על אחת לכל לוח במחיצה של DTBO, ולאפשר למחולל האתחול לקבוע את קבוצת המשנה של שכבות-העל הנדרשות על סמך מזהה הלוח (או אולי על ידי בדיקה של הרכיבים החיצוניים). לדוגמה, לוח א' עשוי להזדקק למכשירים שנוספו על ידי שכבות-העל 1, 3 ו-5, ולוח ב' עשוי להזדקק למכשירים שנוספו על ידי שכבות-העל 1, 4 ו-5.
מחיצה
כדי ליצור מחיצות, צריך לקבוע מיקום מהימן שזמין ל-bootloader במהלך זמן הריצה בזיכרון הפלאש, כדי לאחסן את קובצי ה-DTB ו-DTBO (ה-bootloader צריך להיות מסוגל לאתר את הקבצים האלה בתהליך ההתאמה). חשוב לזכור ש-DTB ו-DTBO לא יכולים להתקיים באותו מחיצה. אם ה-DTB או ה-DTBO נמצאים במחיצה dtb
/dtbo
, צריך להשתמש במבנה הטבלה ובפורמט הכותרת שמפורטים בקטע פורמט המחיצה של DTB ו-DTBO.
הפעלה בתוכנת האתחול
כדי להריץ:
- מזהים את ה-SoC ומטעינים את קובץ ה-dtb .התואם מהאחסון לזיכרון.
- מזהים את הלוח ומטעינים את
.dtbo
התואם מהאחסון לזיכרון.
- מיזוג של
.dtb
עם .dtbo
ליצירת DT.
- הפעלת הליבה לפי כתובת הזיכרון של ה-DT הממוזג.
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. Java ו-OpenJDK הם סימנים מסחריים או סימנים מסחריים רשומים של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-26 (שעון UTC).
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 2025-07-26 (שעון UTC)."],[],[],null,["# Use multiple DTs\n\nMany SoC vendors and ODMs support the use of multiple device trees (DTs) on a device,\nenabling one image to power multiple SKUs or configurations. In such cases, the\nbootloader identifies the hardware and loads the corresponding DT at runtime:\n\n**Figure 1.** Multiple device tree overlays (DTOs) in bootloader.\n\n**Note:** Using multiple DTs isn't mandatory.\n\nSet up\n------\n\nTo add support for multiple DTs to the DTO model, set up a list of main DTs\nand another list of overlay DTs.\n\n**Figure 2.** Runtime DTO implementation for multiple DTs.\n\nThe bootloader should be able to:\n\n- Read the SoC ID and select the corresponding main DT.\n- Read the board ID and select the set of overlay DTs accordingly.\n\nOnly one main DT should be selected for use at runtime. Multiple overlay DTs\nmay be selected but they must be compatible with the chosen main DT. Using\nmultiple overlays can help avoid storing one overlay per board within the DTBO\npartition and enable the bootloader to determine the subset of required overlays\nbased on the board ID (or possibly by probing the peripherals). For\nexample, Board A may need the devices added by the overlays 1, 3, and 5 while\nBoard B may need the devices added by the overlays 1, 4, and 5.\n\nPartition\n---------\n\nTo partition, determine a bootloader runtime-accessible and trusted location\nin flash memory to store the DTBs and DTBOs (bootloader must be able to locate\nthese files in the matching process). Keep in mind that DTBs and DTBOs cann't\nexist in the same partition. If your DTBs/DTBOs are in the\n`dtb`/`dtbo` partition, use the table structure and header\nformat detailed in [DTB and DTBO\npartition format](/docs/core/architecture/dto/partitions).\n\nRun in bootloader\n-----------------\n\nTo run:\n\n1. **Identify the SoC** and load the corresponding .dtb from storage into memory.\n2. **Identify the board** and load the corresponding `.dtbo` from storage into memory.\n3. Overlay the `.dtb` with the `.dtbo` to be a merged DT.\n4. Start kernel given the memory address of the merged DT."]]