blob: 0cbb5fc9b395a3f7f8005fd8a4739e354b052472 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001# SPDX-License-Identifier: GPL-2.0+
Simon Glasse28fcb22016-03-06 19:28:17 -07002#
3# Copyright (c) 2016 Google, Inc
Simon Glasse28fcb22016-03-06 19:28:17 -07004# Script to convert coreboot code to something similar to what U-Boot uses
5# sed -f coreboot.sed <coreboot_file.c>
6# Remember to add attribution to coreboot for new files added to U-Boot.
7s/REG_RES_WRITE32(\(.*\), \(.*\), \(.*\)),/writel(\3, base + \2);/
8s/REG_RES_POLL32(\(.*\), \(.*\), \(.*\), \(.*\), \(.*\)),/ret = poll32(base + \2, \3, \4, \5);/
9s/REG_RES_OR32(\(.*\), \(.*\), \(.*\)),/setbits_le32(base + \2, \3);/
10s/REG_RES_RMW32(\(.*\), \(.*\), \(.*\), \(.*\)),/clrsetbits_le32(base + \2, ~\3, \4);/
11/REG_SCRIPT_END/d
12s/read32/readl/
13s/write32(\(.*\), \(.*\))/writel(\2, \1)/
14s/conf->/plat->/
15s/static const struct reg_script \(.*\)_script\[\] = {/static int \1(struct udevice *dev)/