Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Zhuoyu Zhang | fe4f288 | 2015-08-17 18:55:12 +0800 | [diff] [blame] | 2 | /* |
| 3 | * Copyright 2015 Freescale Semiconductor, Inc. |
| 4 | * Author: Zhuoyu Zhang <Zhuoyu.Zhang@freescale.com> |
Zhuoyu Zhang | fe4f288 | 2015-08-17 18:55:12 +0800 | [diff] [blame] | 5 | */ |
Tom Rini | a78a977 | 2024-05-01 19:30:58 -0600 | [diff] [blame] | 6 | #include <config.h> |
Zhuoyu Zhang | fe4f288 | 2015-08-17 18:55:12 +0800 | [diff] [blame] | 7 | #include <asm/io.h> |
| 8 | #include <asm/arch-ls102xa/immap_ls102xa.h> |
| 9 | #include <asm/arch-ls102xa/config.h> |
| 10 | #include <linux/compiler.h> |
| 11 | #include <hwconfig.h> |
| 12 | #include <fsl_devdis.h> |
| 13 | |
| 14 | void device_disable(const struct devdis_table *tbl, uint32_t num) |
| 15 | { |
| 16 | int i; |
Tom Rini | 376b88a | 2022-10-28 20:27:13 -0400 | [diff] [blame] | 17 | struct ccsr_gur __iomem *gur = (void *)CFG_SYS_FSL_GUTS_ADDR; |
Zhuoyu Zhang | fe4f288 | 2015-08-17 18:55:12 +0800 | [diff] [blame] | 18 | |
| 19 | /* |
| 20 | * Extract hwconfig from environment and disable unused device. |
| 21 | */ |
| 22 | for (i = 0; i < num; i++) { |
| 23 | if (hwconfig_sub("devdis", tbl[i].name)) |
| 24 | setbits_be32(&gur->devdisr + tbl[i].offset, |
| 25 | tbl[i].mask); |
| 26 | } |
| 27 | } |