요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
Broadcom Northstar plus (NSP) GPIO/PINCONF Controller
Required properties:
- compatible:
Must be "brcm,nsp-gpio-a"
- reg:
Should contain the register physical address and length for each of
GPIO base, IO control registers
- #gpio-cells:
Must be two. The first cell is the GPIO pin number (within the
controller's pin space) and the second cell is used for the following:
bit[0]: polarity (0 for active high and 1 for active low)
- gpio-controller:
Specifies that the node is a GPIO controller
- ngpios:
Number of gpios supported (58x25 supports 32 and 58x23 supports 24)
Optional properties:
- interrupts:
Interrupt ID
- interrupt-controller:
Specifies that the node is an interrupt controller
- gpio-ranges:
Specifies the mapping between gpio controller and pin-controllers pins.
This requires 4 fields in cells defined as -
1. Phandle of pin-controller.
2. GPIO base pin offset.
3 Pin-control base pin offset.
4. number of gpio pins which are linearly mapped from pin base.
Supported generic PINCONF properties in child nodes:
- pins:
The list of pins (within the controller's own pin space) that properties
in the node apply to. Pin names are "gpio-<pin>"
- bias-disable:
Disable pin bias
- bias-pull-up:
Enable internal pull up resistor
- bias-pull-down:
Enable internal pull down resistor
- drive-strength:
Valid drive strength values include 2, 4, 6, 8, 10, 12, 14, 16 (mA)
Example:
gpioa: gpio@18000020 {
compatible = "brcm,nsp-gpio-a";
reg = <0x18000020 0x100>,
<0x1803f1c4 0x1c>;
#gpio-cells = <2>;
gpio-controller;
ngpios = <32>;
gpio-ranges = <&pinctrl 0 0 31>;
interrupt-controller;
interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>;
/* Hog a few default settings */
pinctrl-names = "default";
pinctrl-0 = <&led>;
led: led {
pins = "gpio-1";
bias-pull-up;
};
pwr: pwr {
gpio-hog;
gpios = <3 1>;
output-high;
};
};
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Broadcom NSP GPIO/PINCONF 필수 속성
1-21Broadcom Northstar Plus GPIO/PINCONF controller의 `compatible`은 `brcm,nsp-gpio-a`여야 합니다. `reg`에는 GPIO base와 I/O control register 각각의 물리 주소와 길이가 들어갑니다.
`#gpio-cells`는 2입니다. 첫 cell은 controller pin 공간 안의 GPIO 번호이고 두 번째 cell의 bit 0은 polarity로, 0은 active-high, 1은 active-low입니다.
`gpio-controller`는 노드가 GPIO controller임을 나타냅니다. `ngpios`는 지원 GPIO 수로 58x25는 32개, 58x23은 24개를 지원합니다.
NSP interrupt와 GPIO range
22-36선택 `interrupts`는 interrupt ID이고 `interrupt-controller`는 노드를 interrupt controller로 표시합니다.
`gpio-ranges`는 GPIO controller와 pin-controller pin의 매핑입니다. 네 cell은 pin-controller phandle, GPIO base pin offset, pin-control base pin offset, pin base에서 선형 매핑되는 GPIO pin 수입니다.
NSP generic pinconf
37-53하위 노드의 `pins`는 속성을 적용할 controller 내부 pin 목록이며 이름 형식은 `gpio-<pin>`입니다.
`bias-disable`은 bias를 끄고 `bias-pull-up`과 `bias-pull-down`은 내부 pull resistor를 켭니다. `drive-strength`의 유효한 mA 값은 2, 4, 6, 8, 10, 12, 14, 16입니다.
NSP GPIO 예제
54-80예제는 32개 GPIO와 선형 range 31개, GIC interrupt 85를 정의합니다. Default 상태는 `gpio-1`에 pull-up을 적용하고 GPIO 3은 active-low 지정자와 `output-high`를 사용하는 GPIO hog로 구성합니다.
gpioa: gpio@18000020 {
compatible = "brcm,nsp-gpio-a";
reg = <0x18000020 0x100>,
<0x1803f1c4 0x1c>;
#gpio-cells = <2>;
gpio-controller;
ngpios = <32>;
gpio-ranges = <&pinctrl 0 0 31>;
interrupt-controller;
interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>;
/* Hog a few default settings */
pinctrl-names = "default";
pinctrl-0 = <&led>;
led: led {
pins = "gpio-1";
bias-pull-up;
};
pwr: pwr {
gpio-hog;
gpios = <3 1>;
output-high;
};
};
요약과 해설
brcm,nsp-gpio.txt:1-80GPIO polarity, 선형 pin range, bias와 drive strength를 설명합니다.