imx8m: imx8mq: get chip rev for B1 revision
The i.MX8MQ B1 uses OCOTP_HW_OCOTP_READ_FUSE_DATA register for chip id. It returns a magic number 0xff0055aa. update get_cpu_rev to support it, and enable ocotp clock to access ocotp. Signed-off-by: Peng Fan <peng.fan@nxp.com>
This commit is contained in:
		
							parent
							
								
									cde421cfc8
								
							
						
					
					
						commit
						9e09445549
					
				| 
						 | 
					@ -804,6 +804,7 @@ int clock_init(void)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	init_wdog_clk();
 | 
						init_wdog_clk();
 | 
				
			||||||
	clock_enable(CCGR_TSENSOR, 1);
 | 
						clock_enable(CCGR_TSENSOR, 1);
 | 
				
			||||||
 | 
						clock_enable(CCGR_OCOTP, 1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -202,14 +202,21 @@ u32 get_cpu_rev(void)
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		if (reg == CHIP_REV_1_0) {
 | 
							if (reg == CHIP_REV_1_0) {
 | 
				
			||||||
			/*
 | 
								/*
 | 
				
			||||||
			 * For B0 chip, the DIGPROG is not updated, still TO1.0.
 | 
								 * For B0 chip, the DIGPROG is not updated,
 | 
				
			||||||
			 * we have to check ROM version further
 | 
								 * it is still TO1.0. we have to check ROM
 | 
				
			||||||
 | 
								 * version or OCOTP_READ_FUSE_DATA.
 | 
				
			||||||
 | 
								 * 0xff0055aa is magic number for B1.
 | 
				
			||||||
			 */
 | 
								 */
 | 
				
			||||||
			rom_version = readl((void __iomem *)ROM_VERSION_A0);
 | 
								if (readl((void __iomem *)(OCOTP_BASE_ADDR + 0x40)) == 0xff0055aa) {
 | 
				
			||||||
			if (rom_version != CHIP_REV_1_0) {
 | 
									reg = CHIP_REV_2_1;
 | 
				
			||||||
				rom_version = readl((void __iomem *)ROM_VERSION_B0);
 | 
								} else {
 | 
				
			||||||
				if (rom_version >= CHIP_REV_2_0)
 | 
									rom_version =
 | 
				
			||||||
					reg = CHIP_REV_2_0;
 | 
										readl((void __iomem *)ROM_VERSION_A0);
 | 
				
			||||||
 | 
									if (rom_version != CHIP_REV_1_0) {
 | 
				
			||||||
 | 
										rom_version = readl((void __iomem *)ROM_VERSION_B0);
 | 
				
			||||||
 | 
										if (rom_version == CHIP_REV_2_0)
 | 
				
			||||||
 | 
											reg = CHIP_REV_2_0;
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue