blob: 2c3d2348076258d0a9ca70d7fbebe312011d4ef0 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Zhuoyu Zhangfe4f2882015-08-17 18:55:12 +08002/*
3 * Copyright 2015 Freescale Semiconductor, Inc.
4 * Author: Zhuoyu Zhang <Zhuoyu.Zhang@freescale.com>
Zhuoyu Zhangfe4f2882015-08-17 18:55:12 +08005 */
Tom Rinidec7ea02024-05-20 13:35:03 -06006#include <config.h>
Zhuoyu Zhangfe4f2882015-08-17 18:55:12 +08007#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
14void device_disable(const struct devdis_table *tbl, uint32_t num)
15{
16 int i;
Tom Rini376b88a2022-10-28 20:27:13 -040017 struct ccsr_gur __iomem *gur = (void *)CFG_SYS_FSL_GUTS_ADDR;
Zhuoyu Zhangfe4f2882015-08-17 18:55:12 +080018
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}