Rob Barnes has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/44834 )
Change subject: util/spd_tools: Support comments in json ......................................................................
util/spd_tools: Support comments in json
Allow comments in json file for better documentation. Comments must be on seperate line.
BUG=none TEST=Injest global_ddr4_mem_parts.json.txt with comments
Change-Id: I51295408d4f916708e4ed5bc42d5468ccdc68a6b Signed-off-by: Rob Barnes robbarnes@google.com --- M util/spd_tools/intel/ddr4/gen_spd.go M util/spd_tools/intel/ddr4/global_ddr4_mem_parts.json.txt 2 files changed, 8 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/34/44834/1
diff --git a/util/spd_tools/intel/ddr4/gen_spd.go b/util/spd_tools/intel/ddr4/gen_spd.go index 5adadc9..0462fd5 100644 --- a/util/spd_tools/intel/ddr4/gen_spd.go +++ b/util/spd_tools/intel/ddr4/gen_spd.go @@ -12,6 +12,7 @@ "reflect" "strconv" "strings" + "regexp" )
/* @@ -998,6 +999,10 @@ return err }
+ // Strip comments from json file + re := regexp.MustCompile(`(?m)^\s*//.*`) + databytes = re.ReplaceAll(databytes, []byte("")) + return json.Unmarshal(databytes, memParts) }
diff --git a/util/spd_tools/intel/ddr4/global_ddr4_mem_parts.json.txt b/util/spd_tools/intel/ddr4/global_ddr4_mem_parts.json.txt index 4e9c7c8..51068d5 100644 --- a/util/spd_tools/intel/ddr4/global_ddr4_mem_parts.json.txt +++ b/util/spd_tools/intel/ddr4/global_ddr4_mem_parts.json.txt @@ -1,3 +1,6 @@ +// Global list of ddr4 memory part attributes. +// These attributes match the part specifications and are independent +// of any SoC expectations. { "parts": [ {
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44834 )
Change subject: util/spd_tools: Support comments in json ......................................................................
Patch Set 1: Code-Review+2
Hello build bot (Jenkins), Furquan Shaikh, Nick Vaccaro,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/44834
to look at the new patch set (#2).
Change subject: util/spd_tools: Support comments in json ......................................................................
util/spd_tools: Support comments in json
Allow comments in json file for better documentation. Comments must be on seperate line.
BUG=none TEST=Injest global_ddr4_mem_parts.json.txt with comments
Change-Id: I51295408d4f916708e4ed5bc42d5468ccdc68a6b Signed-off-by: Rob Barnes robbarnes@google.com --- M util/spd_tools/ddr4/gen_spd.go M util/spd_tools/ddr4/global_ddr4_mem_parts.json.txt 2 files changed, 8 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/34/44834/2
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44834 )
Change subject: util/spd_tools: Support comments in json ......................................................................
Patch Set 2: Code-Review+2
Nick Vaccaro has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44834 )
Change subject: util/spd_tools: Support comments in json ......................................................................
Patch Set 2: Code-Review+2
Rob Barnes has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/44834 )
Change subject: util/spd_tools: Support comments in json ......................................................................
Abandoned
Reordered
Rob Barnes has restored this change. ( https://review.coreboot.org/c/coreboot/+/44834 )
Change subject: util/spd_tools: Support comments in json ......................................................................
Restored
Hello build bot (Jenkins), Furquan Shaikh, Nick Vaccaro, Nick Vaccaro,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/44834
to look at the new patch set (#7).
Change subject: util/spd_tools: Support comments in json ......................................................................
util/spd_tools: Support comments in json
Allow comments in json file for better documentation. Comments must be on seperate line.
BUG=none TEST=Injest global_ddr4_mem_parts.json.txt with comments
Change-Id: I51295408d4f916708e4ed5bc42d5468ccdc68a6b Signed-off-by: Rob Barnes robbarnes@google.com --- M util/spd_tools/ddr4/gen_spd.go M util/spd_tools/ddr4/global_ddr4_mem_parts.json.txt 2 files changed, 8 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/34/44834/7
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44834 )
Change subject: util/spd_tools: Support comments in json ......................................................................
Patch Set 7: Code-Review+2
Furquan Shaikh has submitted this change. ( https://review.coreboot.org/c/coreboot/+/44834 )
Change subject: util/spd_tools: Support comments in json ......................................................................
util/spd_tools: Support comments in json
Allow comments in json file for better documentation. Comments must be on seperate line.
BUG=none TEST=Injest global_ddr4_mem_parts.json.txt with comments
Change-Id: I51295408d4f916708e4ed5bc42d5468ccdc68a6b Signed-off-by: Rob Barnes robbarnes@google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/44834 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Furquan Shaikh furquan@google.com --- M util/spd_tools/ddr4/gen_spd.go M util/spd_tools/ddr4/global_ddr4_mem_parts.json.txt 2 files changed, 8 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Furquan Shaikh: Looks good to me, approved
diff --git a/util/spd_tools/ddr4/gen_spd.go b/util/spd_tools/ddr4/gen_spd.go index 5adadc9..0462fd5 100644 --- a/util/spd_tools/ddr4/gen_spd.go +++ b/util/spd_tools/ddr4/gen_spd.go @@ -12,6 +12,7 @@ "reflect" "strconv" "strings" + "regexp" )
/* @@ -998,6 +999,10 @@ return err }
+ // Strip comments from json file + re := regexp.MustCompile(`(?m)^\s*//.*`) + databytes = re.ReplaceAll(databytes, []byte("")) + return json.Unmarshal(databytes, memParts) }
diff --git a/util/spd_tools/ddr4/global_ddr4_mem_parts.json.txt b/util/spd_tools/ddr4/global_ddr4_mem_parts.json.txt index 4e9c7c8..51068d5 100644 --- a/util/spd_tools/ddr4/global_ddr4_mem_parts.json.txt +++ b/util/spd_tools/ddr4/global_ddr4_mem_parts.json.txt @@ -1,3 +1,6 @@ +// Global list of ddr4 memory part attributes. +// These attributes match the part specifications and are independent +// of any SoC expectations. { "parts": [ {