xref: /rk3399_rockchip-uboot/scripts/coreboot.sed (revision e28fcb2279912e83eb789bef942f928a77d5ba46)
1*e28fcb22SSimon Glass#
2*e28fcb22SSimon Glass# Copyright (c) 2016 Google, Inc
3*e28fcb22SSimon Glass#
4*e28fcb22SSimon Glass# SPDX-License-Identifier:	GPL-2.0+
5*e28fcb22SSimon Glass#
6*e28fcb22SSimon Glass# Script to convert coreboot code to something similar to what U-Boot uses
7*e28fcb22SSimon Glass# sed -f coreboot.sed <coreboot_file.c>
8*e28fcb22SSimon Glass# Remember to add attribution to coreboot for new files added to U-Boot.
9*e28fcb22SSimon Glasss/REG_RES_WRITE32(\(.*\), \(.*\), \(.*\)),/writel(\3, base + \2);/
10*e28fcb22SSimon Glasss/REG_RES_POLL32(\(.*\), \(.*\), \(.*\), \(.*\), \(.*\)),/ret = poll32(base + \2, \3, \4, \5);/
11*e28fcb22SSimon Glasss/REG_RES_OR32(\(.*\), \(.*\), \(.*\)),/setbits_le32(base + \2, \3);/
12*e28fcb22SSimon Glasss/REG_RES_RMW32(\(.*\), \(.*\), \(.*\), \(.*\)),/clrsetbits_le32(base + \2, ~\3, \4);/
13*e28fcb22SSimon Glass/REG_SCRIPT_END/d
14*e28fcb22SSimon Glasss/read32/readl/
15*e28fcb22SSimon Glasss/write32(\(.*\), \(.*\))/writel(\2, \1)/
16*e28fcb22SSimon Glasss/conf->/plat->/
17*e28fcb22SSimon Glasss/static const struct reg_script \(.*\)_script\[\] = {/static int \1(struct udevice *dev)/
18