Skip to content

Tags: M-Vaittinen/juputin

Tags

u-boot-bd71885-bd2659-initial-reference-v2

Toggle u-boot-bd71885-bd2659-initial-reference-v2's commit message
Draft for supporting BD71885 and BD2659 on u-boot

This is a reference u-boot code to support part of the features provided
by the combined use of ROHM BD71885 and BD2659 "main" and "companion"
PMICs. The code should be considered as a reference code only. No
functionality is guaranteed to work as intended. No warranty can be
given.

The code has been tested on an BD71885/BD2659 test board connected to a
beaglebone black SOC via I2C. Please note that only some features of the
driver are tested, and even they are not tested thoroughly.

Things that were partially tested:

BD71885:
- regulator enabling / disabling.
- regulator voltage setting.
- ADC source selection
- ADC voltage source selection
- ADC voltage measurement
- Reading reset and power-on reasons

ADC measurement for current and power have not been fully verified.
Values have only been checked to "look like they're at a reasonable
magnitude".

BD2659:
- Regulator enabling/disabling. (disabling/enabling done using VID
  register. S0/S3 enable register assumed to default 0x1f)
- Regulator voltage setting. (MAX VID not set)

u-boot-bd71885-bd2659-untested-v1

Toggle u-boot-bd71885-bd2659-untested-v1's commit message
Draft for supporting BD71885 and BD2659 on u-boot

This is a first untested code draft aiming to support part of the
features provided by the combined use of ROHM BD71885 and BD2659 "main"
and "companion" PMICs. The code should be considered as a reference code
only. No functionality is guaranteed to work as intended. No warranty
can be given.

The code has only been tested on an FPGA environment which is partially
simulating the BD71885 PMIC. Please note that only some features of the
BD71885 driver are tested, and even they are not tested thoroughly.
The BD2659 code is not tested at all.

This particular u-boot code contains beagle bone black specific patches
and can be built and installed on beagle bone black development board.
The PMIC can be wired to the beagle bone black I2C2 on the connector 9.
Please see the arch/arm/dts/am335x-boneblack.dts for binding details.

Features that are implemented partially tested:
BD71885 regulator voltage changes at RUN state.
BD71885 state transfers RUN => IDLE, IDLE => RUN
BD71885 measuring voltage, current, power or temperature using ADC.
BD71885: Reading the pmic state
BD71885: Reading the selected ADC sources
BD71885: Getting the ADC gain

Feartures that are implemented but not tested:
BD71885: Reset reason
BD71885: Power-on reason
BD71885: transfer to HIBERNATE
BD71885: Setting the ADC limits
BD71885: Setting the ADC gain
BD71885: Initializing the power-button press duration based on
device-tree.
BD2659 regulator voltage changes

Special notes:
Most of the BD71885 functions are implemented as u-boot commands. Idea
is that the driver SW can be tested using the u-boot command-prompt. The
standard u-boot commands "pmic" and "regulator" sould be usable. The
other BD71885 specirfic features like the ADC measurements are
implemented as a command "bd71885".

One notable thing to mention is that IRQ handling is not implemented at
all. The ADC measurement implemntation is done by calculating the time
required for sampling based on the number of samples and the sampling
interval. The IRQ code would in any case be very architecture specific
and needs in any case to be rewritten for real target architecture.
Furthermore, there has been no PMIC hardware where IRQ handling could
have been tested.