Boot & Device Tree

Kernel은 올라오지만 peripheral driver가 연결되지 않는 상황

Bootloader가 kernel과 hardware description을 전달하고 driver가 binding 정보를 해석한다. Device Tree의 node는 device 사용 조건을 기술하며 driver 구현 자체를 대신하지 않는다.

Boot Flow

flowchart LR
 R[Boot ROM] --> B[Bootloader]
 B --> K[Kernel + DTB]
 K --> F[Root Filesystem]
 F --> I[Init / Service Manager]
 I --> A[Application]

Responsibilities

Bootloader는 보드에 필요한 초기화와 이미지 로딩·검증을 수행한다. Kernel은 메모리·스케줄링·driver를 초기화하고 Root Filesystem에서 첫 user process를 실행한다. initramfs 사용 여부와 상세 순서는 BSP마다 다르다.

Device Tree

Device Tree는 hardware 연결과 속성을 기술한다. compatible, reg, interrupts, clocks, pinctrl, status 등이 driver binding에 사용된다. DTS를 수정한다고 없는 driver가 만들어지지는 않는다. 잘못된 주소·핀·clock을 복사하지 말고 보드 schematic과 binding 문서를 확인한다.

Read-only Inspection

uname -a
cat /proc/cmdline
cat /proc/mounts
cat /proc/interrupts
# systemd를 사용하는 이미지에서
journalctl -b -k
systemctl --failed

Bring-up Procedure

UART console에서 Bootloader·Kernel·user service 중 어느 단계에서 실패하는지 나눈다. driver probe 실패라면 DT compatible, clock/regulator 공급, pinmux, 권한과 device node를 확인한다. Root FS mount 실패와 application crash를 같은 문제로 취급하지 않는다.

Image Management

Kernel, DTB, Modules, Root FS와 application version의 조합을 기록한다. 재현 가능한 BSP 빌드와 Artifact 서명·배포 정책을 사용한다. Bootloader 변경은 정상 부팅 경로와 복구 interface를 준비한 보드에서 검증한다.

이해를 확인하는 질문

Device Tree node를 추가하면 driver도 생기는가?

Matching driver와 binding, clock·reset·pin·interrupt resource가 함께 필요하다.