From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Thu, 7 Feb 2019 07:55:24 +0100 Subject: [U-Boot] [PATCH v2 7/7] i2c: mux: Generate longer i2c mux name In-Reply-To: References: Message-ID: <8046a986-c62d-f491-e482-cc04bf1e1f73@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Michal, Am 31.01.2019 um 16:31 schrieb Michal Simek: > For !DM case busses are listed as > ZynqMP> i2c bus > Bus 0: zynq_0 > Bus 1: zynq_0->PCA9544A at 0x75:0 > Bus 2: zynq_0->PCA9544A at 0x75:1 > Bus 3: zynq_0->PCA9544A at 0x75:2 > Bus 4: zynq_1 > Bus 5: zynq_1->PCA9548 at 0x74:0 > Bus 6: zynq_1->PCA9548 at 0x74:1 > Bus 7: zynq_1->PCA9548 at 0x74:2 > Bus 8: zynq_1->PCA9548 at 0x74:3 > Bus 9: zynq_1->PCA9548 at 0x74:4 > Bus 10: zynq_1->PCA9548 at 0x75:0 > Bus 11: zynq_1->PCA9548 at 0x75:1 > Bus 12: zynq_1->PCA9548 at 0x75:2 > Bus 13: zynq_1->PCA9548 at 0x75:3 > Bus 14: zynq_1->PCA9548 at 0x75:4 > Bus 15: zynq_1->PCA9548 at 0x75:5 > Bus 16: zynq_1->PCA9548 at 0x75:6 > Bus 17: zynq_1->PCA9548 at 0x75:7 > > where is exactly describing i2c bus topology. > By moving to DM case i2c mux buses are using names from DT and because > i2c-muxes describing sub busses with the same names like i2c at 0, etc it > is hard to identify which bus is where. > Linux is adding topology information to i2c-mux busses to identify them > better. > This patch is doing the same and composing bus name with topology > information. > > When patch is applied with topology information on zcu102-revA. > ZynqMP> i2c bus > Bus 0: i2c at ff020000 > 20: gpio at 20, offset len 1, flags 0 > 21: gpio at 21, offset len 1, flags 0 > 75: i2c-mux at 75, offset len 1, flags 0 > Bus 2: i2c at ff020000->i2c-mux at 75->i2c at 0 > Bus 3: i2c at ff020000->i2c-mux at 75->i2c at 1 > Bus 4: i2c at ff020000->i2c-mux at 75->i2c at 2 > Bus 1: i2c at ff030000 (active 1) > 74: i2c-mux at 74, offset len 1, flags 0 > 75: i2c-mux at 75, offset len 1, flags 0 > Bus 5: i2c at ff030000->i2c-mux at 74->i2c at 0 (active 5) > 54: eeprom at 54, offset len 1, flags 0 > Bus 6: i2c at ff030000->i2c-mux at 74->i2c at 1 > Bus 7: i2c at ff030000->i2c-mux at 74->i2c at 2 > Bus 8: i2c at ff030000->i2c-mux at 74->i2c at 3 > Bus 9: i2c at ff030000->i2c-mux at 74->i2c at 4 > Bus 10: i2c at ff030000->i2c-mux at 75->i2c at 0 > Bus 11: i2c at ff030000->i2c-mux at 75->i2c at 1 > Bus 12: i2c at ff030000->i2c-mux at 75->i2c at 2 > Bus 13: i2c at ff030000->i2c-mux at 75->i2c at 3 > Bus 14: i2c at ff030000->i2c-mux at 75->i2c at 4 > Bus 15: i2c at ff030000->i2c-mux at 75->i2c at 5 > Bus 16: i2c at ff030000->i2c-mux at 75->i2c at 6 > Bus 17: i2c at ff030000->i2c-mux at 75->i2c at 7 > > Behavior before the patch is applied. > ZynqMP> i2c bus > Bus 0: i2c at ff020000 > 20: gpio at 20, offset len 1, flags 0 > 21: gpio at 21, offset len 1, flags 0 > 75: i2c-mux at 75, offset len 1, flags 0 > Bus 2: i2c at 0 > Bus 3: i2c at 1 > Bus 4: i2c at 2 > Bus 1: i2c at ff030000 (active 1) > 74: i2c-mux at 74, offset len 1, flags 0 > 75: i2c-mux at 75, offset len 1, flags 0 > Bus 5: i2c at 0 (active 5) > 54: eeprom at 54, offset len 1, flags 0 > Bus 6: i2c at 1 > Bus 7: i2c at 2 > Bus 8: i2c at 3 > Bus 9: i2c at 4 > Bus 10: i2c at 0 > Bus 11: i2c at 1 > Bus 12: i2c at 2 > Bus 13: i2c at 3 > Bus 14: i2c at 4 > Bus 15: i2c at 5 > Bus 16: i2c at 6 > Bus 17: i2c at 7 > > Signed-off-by: Michal Simek > --- > > Changes in v2: > - Fix headers > - Change patch description to focus only on bus name > > drivers/i2c/muxes/i2c-mux-uclass.c | 29 ++++++++++++++++++++++++++--- > 1 file changed, 26 insertions(+), 3 deletions(-) Much more cleaner output, thanks! Reviewed-by: Heiko Schocher I have no chance to test this on another hardware, so if someone could test it, this would be nice. bye, Heiko -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-52 Fax: +49-8142-66989-80 Email: hs at denx.de